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

aliases: package name with hyphens not being matched #1983

Open
aristotle9 opened this issue May 31, 2023 · 0 comments
Open

aliases: package name with hyphens not being matched #1983

aristotle9 opened this issue May 31, 2023 · 0 comments

Comments

@aristotle9
Copy link

rules_rust version:

# To find additional information on this release or newer ones visit:
# https://github.com/bazelbuild/rules_rust/releases
http_archive(
    name = "rules_rust",  #0.22.0, 2023-05-22
    sha256 = "50272c39f20a3a3507cb56dcb5c3b348bda697a7d868708449e2fa6fb893444c",
    urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz"],
)

part of Cargo.toml:

[dependencies]
term_color = { package = "owo-colors", version = "3.6" }

[patch.crates-io]
owo-colors = { git = "https://github.com/jam1garner/owo-colors.git", rev = "509f6e68cfe0ce7e062837f60b33b0d9e0e5e374" }

BUILD.bazel:

load("@rules_rust//rust:defs.bzl", "rust_binary")
load("@crate_index//:defs.bzl", "aliases", "all_crate_deps")

print(aliases())

rust_binary(
    name = "main",
    srcs = glob(["src/**/*.rs"]),
    edition = "2021",
    aliases = aliases(),
    proc_macro_deps = all_crate_deps(
        proc_macro = True,
    ),
    deps = all_crate_deps(
        normal = True,
    ),
)

Error:

% bazel build --color=yes --subcommands --strip=always --compilation_mode=opt \
	--@rules_rust//:extra_rustc_flags="-C,panic=abort,-C,debuginfo=2,-C,opt-level=3" \
	//:main
DEBUG: /Users/user1/src/rust/some-test/BUILD.bazel:4:6: {"@crate_index__owo-colors-3.6.0//:owo-colors": "term_color"}
ERROR: /Users/user1/src/rust/some-test/BUILD.bazel:6:12: no such target '@crate_index__owo-colors-3.6.0//:owo-colors': target 'owo-colors' not declared in package '' defined by /private/var/tmp/_bazel_user1/81d27ea67214ab39b28fce880af4107d/external/crate_index__owo-colors-3.6.0/BUILD.bazel (did you mean 'owo_colors'? Tip: use `query "@crate_index__owo-colors-3.6.0//:*"` to see all the targets in that package) and referenced by '//:main'
ERROR: Analysis of target '//:main' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.521s
INFO: 0 processes.
% bazel query "@crate_index__owo-colors-3.6.0//:*"
@crate_index__owo-colors-3.6.0//:.github/dependabot.yml
@crate_index__owo-colors-3.6.0//:.github/workflows/ci.yml
@crate_index__owo-colors-3.6.0//:.gitignore
@crate_index__owo-colors-3.6.0//:BUILD.bazel
@crate_index__owo-colors-3.6.0//:Cargo.toml
@crate_index__owo-colors-3.6.0//:LICENSE
@crate_index__owo-colors-3.6.0//:README.md
@crate_index__owo-colors-3.6.0//:examples/all_xterm_colors.rs
@crate_index__owo-colors-3.6.0//:examples/banner.rs
@crate_index__owo-colors-3.6.0//:examples/colors.rs
@crate_index__owo-colors-3.6.0//:examples/custom_colors.rs
@crate_index__owo-colors-3.6.0//:examples/dyn_colors.rs
@crate_index__owo-colors-3.6.0//:examples/extra_colors.rs
@crate_index__owo-colors-3.6.0//:examples/override.rs
@crate_index__owo-colors-3.6.0//:examples/supports_color.rs
@crate_index__owo-colors-3.6.0//:owo_colors
@crate_index__owo-colors-3.6.0//:src/colors.rs
@crate_index__owo-colors-3.6.0//:src/colors/css.rs
@crate_index__owo-colors-3.6.0//:src/colors/custom.rs
@crate_index__owo-colors-3.6.0//:src/colors/dynamic.rs
@crate_index__owo-colors-3.6.0//:src/colors/xterm.rs
@crate_index__owo-colors-3.6.0//:src/combo.rs
@crate_index__owo-colors-3.6.0//:src/dyn_colors.rs
@crate_index__owo-colors-3.6.0//:src/dyn_styles.rs
@crate_index__owo-colors-3.6.0//:src/lib.rs
@crate_index__owo-colors-3.6.0//:src/overrides.rs
@crate_index__owo-colors-3.6.0//:src/styled_list.rs
@crate_index__owo-colors-3.6.0//:src/styles.rs
@crate_index__owo-colors-3.6.0//:src/supports_colors.rs
@crate_index__owo-colors-3.6.0//:src/tests.rs
Loading: 0 packages loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants