You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When bumping from 0.48.0 to 0.49.2, default features are enabled for targets that should not have them enabled, but optional dependencies that those features depend on are not.
My reproduction setup is a simple Rust binary with a single dependency, rstest 0.22.0 with default-features = false. It depends on rstest-macros, which also has default-features = false. The dependency is vendored with mode = "remote".
To vendor the packages, I am running the following command:
CARGO_BAZEL_REPIN=1 bazel run @@//:crates_vendor
When I rerun this command after bumping from 0.48.0 to 0.49.2, it produces the following changes:
Since rstest and rstest-macros are both defined with default-features = false, these features should not be enabled. (This can be seen by looking at the Cargo.lock file, where they are not present.
Furthermore, the crate-name feature of rstest-macros depends on the proc-macro-crate package, which is not specified as a dependency in the generated BUILD.rstest_macros-0.22.0.bazel file, which causes the build to fail.
Expand error message
INFO: Invocation ID: 82f7b5ee-5ea7-415e-b262-aea406e9d480
INFO: Analyzed target //:hello_world (0 packages loaded, 2 targets configured).
ERROR: /private/var/tmp/_bazel/55bb84ce8634c54cea85dd8427296db4/external/crates_vendor__rstest_macros-0.22.0/BUILD.bazel:14:16: Compiling Rust proc-macro rstest_macros v0.22.0 (27 files) [for tool] failed: (Exit 1): process_wrapper failed: error executing Rustc command (from target @@crates_vendor__rstest_macros-0.22.0//:rstest_macros) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_rust~/util/process_wrapper/process_wrapper --env-file ... (remaining 85 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error[E0432]: unresolved import `proc_macro_crate`
--> external/crates_vendor__rstest_macros-0.22.0/src/render/crate_resolver.rs:6:13
|
6 | use proc_macro_crate::FoundCrate;
| ^^^^^^^^^^^^^^^^ use of undeclared crate or module `proc_macro_crate`
error[E0433]: failed to resolve: use of undeclared crate or module `proc_macro_crate`
--> external/crates_vendor__rstest_macros-0.22.0/src/render/crate_resolver.rs:9:15
|
9 | match proc_macro_crate::crate_name("rstest").expect("rstest is present in `Cargo.toml` qed")
| ^^^^^^^^^^^^^^^^ use of undeclared crate or module `proc_macro_crate`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
Target //:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.794s, Critical Path: 0.68s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
The workspace looks something like this (simplified significantly, but still reproducible):
When bumping from
0.48.0
to0.49.2
, default features are enabled for targets that should not have them enabled, but optional dependencies that those features depend on are not.My reproduction setup is a simple Rust binary with a single dependency, rstest 0.22.0 with
default-features = false
. It depends on rstest-macros, which also hasdefault-features = false
. The dependency is vendored withmode = "remote"
.To vendor the packages, I am running the following command:
When I rerun this command after bumping from
0.48.0
to0.49.2
, it produces the following changes:Since rstest and rstest-macros are both defined with
default-features = false
, these features should not be enabled. (This can be seen by looking at theCargo.lock
file, where they are not present.Furthermore, the
crate-name
feature of rstest-macros depends on the proc-macro-crate package, which is not specified as a dependency in the generatedBUILD.rstest_macros-0.22.0.bazel
file, which causes the build to fail.Expand error message
The workspace looks something like this (simplified significantly, but still reproducible):
Expand
Cargo.toml
MODULE.bazel
WORKSPACE
BUILD.bazel
The text was updated successfully, but these errors were encountered: