Skip to content

Cranelift patch files are painful to maintain #153488

@RalfJung

Description

@RalfJung

The cranelift backend contains some patch files in compiler/rustc_codegen_cranelift/patches/ and CI will fail when those do not apply any more. That's quite painful; sometimes patch files can be fairly easily edited by hand but when that is not possible it's non-trivial to figure out what to do here. I don't think we should subject ourselves and our contributors to this. Patch files are a terrible way of maintaining code variants. I don't mind cranelift doing this in their subrepo, but the moment this becomes relevant for rustc contributors I think we should have a higher bar.

Can't we do something less hacky? With Miri we are setting --cfg miri and then we can use that to disable or otherwise adjust code that would make standard library tests fail with Miri. Can't whatever code runs the standard library tests with cranelift set --cfg cranelift and then we do something similar? That would be a lot better than patch files, IMO.

Cc @bjorn3

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-craneliftThings relevant to the [future] cranelift backendA-test-infraArea: test infrastructure (may span bootstrap/compiletest/more)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions