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

cannot override compilation_mode via alias_rules #3160

Open
deblasis opened this issue Jan 6, 2025 · 4 comments
Open

cannot override compilation_mode via alias_rules #3160

deblasis opened this issue Jan 6, 2025 · 4 comments

Comments

@deblasis
Copy link

deblasis commented Jan 6, 2025

Getting the error:

ERROR: error loading package '@@rules_rust++crate+crates//': cannot load '@@rules_rust++crate+crates//:alias_rules.bzl': no such file

with (bzlmod):

crate = use_extension(
    "@rules_rust//crate_universe:extensions.bzl",
    "crate",
)

crate.from_cargo(
    name = "crates",
    cargo_lockfile = "//:src/Cargo.lock",
    generate_binaries = True,
    generate_build_scripts = True,
    manifests = ["//:src/Cargo.toml"],
)

crate.annotation(
    crate = "somecrate",
    alias_rule = "dbg",
)


use_repo(crate, "crates")
@deblasis
Copy link
Author

deblasis commented Jan 6, 2025

Possibly related to #2832

@deblasis
Copy link
Author

deblasis commented Jan 6, 2025

I might have identified the cause and a PR with a fix is coming shortly, testing it a little bit more

@havasd
Copy link
Contributor

havasd commented Jan 6, 2025

I have a fix in this PR for it #3158

@deblasis
Copy link
Author

deblasis commented Jan 6, 2025

Nice! I spotted the offending line that was not adding alias_rules.bzl and your PR is much more wholesome than mine would be anyway.

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

2 participants