Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crate_vendor is broken in recent releases #2932

Open
ashi009 opened this issue Oct 10, 2024 · 0 comments
Open

crate_vendor is broken in recent releases #2932

ashi009 opened this issue Oct 10, 2024 · 0 comments

Comments

@ashi009
Copy link

ashi009 commented Oct 10, 2024

bazel run //third_party/rust:update-repos
INFO: Invocation ID: 515c31d7-a136-47ee-9680-d0dd6f8f2018
ERROR: no such package '@@cargo_bazel_bootstrap//': The repository '@@cargo_bazel_bootstrap' could not be resolved: Repository '@@cargo_bazel_bootstrap' is not defined
ERROR: third_party/rust/BUILD.bazel:3:14: every rule of type crates_vendor implicitly depends upon the target '@@cargo_bazel_bootstrap//:binary', but this target could not be found because of: no such package '@@cargo_bazel_bootstrap//': The repository '@@cargo_bazel_bootstrap' could not be resolved: Repository '@@cargo_bazel_bootstrap' is not defined
Documentation for implicit attribute cargo_bazel of rules of type crates_vendor:
The cargo-bazel binary to use for vendoring. If this attribute is not set, then a `CARGO_BAZEL_GENERATOR_PATH` action env will be used.
ERROR: Analysis of target '//third_party/rust:update-repos' failed; build aborted: Analysis failed

setting bootstrap = True in crate_universe_dependencies fails for not being able to find cargo:

bazel run //third_party/rust:update-repos
INFO: Invocation ID: cea31b86-7111-4f5a-8caf-16cccb4a3c48
INFO: Repository cargo_bazel_bootstrap instantiated at:
  WORKSPACE:325:28: in <toplevel>
  /private/var/tmp/_bazel_xiaoyishi/79c76c5b4224312419386af2e6f9c092/external/rules_rust/crate_universe/repositories.bzl:24:30: in crate_universe_dependencies
  /private/var/tmp/_bazel_xiaoyishi/79c76c5b4224312419386af2e6f9c092/external/rules_rust/crate_universe/deps_bootstrap.bzl:17:31: in cargo_bazel_bootstrap
Repository rule cargo_bootstrap_repository defined at:
  /private/var/tmp/_bazel_xiaoyishi/79c76c5b4224312419386af2e6f9c092/external/rules_rust/cargo/private/cargo_bootstrap.bzl:225:45: in <toplevel>
ERROR: An error occurred during the fetch of repository 'cargo_bazel_bootstrap':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_xiaoyishi/79c76c5b4224312419386af2e6f9c092/external/rules_rust/cargo/private/cargo_bootstrap.bzl", line 208, column 40, in _cargo_bootstrap_repository_impl
		cargo_bin = repository_ctx.path(tools.cargo),
Error in path: Unable to load package for @@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools//:bin/cargo: The repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' could not be resolved: Repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' is not defined
ERROR: no such package '@@cargo_bazel_bootstrap//': Unable to load package for @@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools//:bin/cargo: The repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' could not be resolved: Repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' is not defined
ERROR: /Users/xiaoyishi/Projects/monorepo/third_party/rust/BUILD.bazel:3:14: //third_party/rust:update-repos depends on @@cargo_bazel_bootstrap//:binary in repository @@cargo_bazel_bootstrap which failed to fetch. no such package '@@cargo_bazel_bootstrap//': Unable to load package for @@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools//:bin/cargo: The repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' could not be resolved: Repository '@@rust_darwin_aarch64__aarch64-apple-darwin__stable_tools' is not defined

as we are using nightly toolchains:

rust_register_toolchains(
    edition = "2021",
    versions = [
        "nightly/2024-04-05",
    ],
)

I haven't dug into the issue, but this is a change between 0.49.3 and 0.52.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant