Skip to content

Commit

Permalink
Fix testing the cranelift-reader test alone (#9372)
Browse files Browse the repository at this point in the history
This PR is intended to help unblock #9178. That PR uncovered the
consequence that testing the `cranelift-reader` crate alone does not
work on non-x86_64 platforms. One of its tests relies on parsing the
`x86_64` target specification to work, and that only works if the `x86`
feature of the cranelift-codegen crate is enabled. This PR
unconditionally enables this feature when testing.

This was uncovered on #9178 because the set of crates tested in each
shard of our sharded builders depends on the set of crates in the
workspace. When a new crate is added it may shuffle around which crates
are tested in which location. Previously `cranelift-reader` must have
been always tested with a crate that unconditionally enables
`cranelift-codegen/x86` as a feature, but #9178 got unlucky where it
moved to a set that didn't include this, thus exposing the failure.
  • Loading branch information
alexcrichton authored Oct 4, 2024
1 parent 350cb9b commit 4549585
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cranelift/reader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ anyhow = { workspace = true, features = ['std'] }
cranelift-codegen = { workspace = true }
smallvec = { workspace = true }
target-lexicon = { workspace = true, features = ['std'] }

[dev-dependencies]
# Some tests require that the x86_64 target parses for the target specification.
cranelift-codegen = { workspace = true, features = ['x86'] }

0 comments on commit 4549585

Please sign in to comment.