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

cargo-raze generates duplicated aliases for [email protected] #552

Open
k1nkreet opened this issue May 4, 2023 · 3 comments
Open

cargo-raze generates duplicated aliases for [email protected] #552

k1nkreet opened this issue May 4, 2023 · 3 comments

Comments

@k1nkreet
Copy link

k1nkreet commented May 4, 2023

with [email protected] cargo-raze creates rust_library with duplicated value in aliases field which fails to compile:

aliases = {
    "@raze__errno__0_3_1//:errno": "libc_errno",
    "@raze__errno__0_3_1//:errno": "libc_errno",
},

I've created a repository to reproduce: https://github.com/k1nkreet/cargo-raze-duplicated-alias

@dayfine
Copy link

dayfine commented Jul 30, 2023

Seeing this too. My Cargo.toml looks like:

[package]
edition = "2021"
name = "compile_with_bazel"
version = "0.0.0"

[lib]
path = "fake_lib.rs"

[dependencies]
approx = "0.5.1"
chrono = "0.4.26"
clap = {version = "=4.3.12", features = ["derive"]}
exitfailure = "0.5.1"
rayon = "1.7.0"
reqwest = {version = "0.11.0", features = ["blocking", "json"]}
serde = "1.0.119"
serde_derive = "1.0.119"
serde_json = "1.0.61"
structopt = "0.3.21"
tokio = {version = "1.0.2", features = ["full"]}

[package.metadata.raze]
genmode = "Remote"
package_aliases_dir = "."
rust_rules_workspace_name = "rules_rust"
workspace_path = "//cargo"

[package.metadata.raze.crates.clap.'4.3.12']
data_attr = '[":README.md", ":examples/demo.md"]'

[package.metadata.raze.crates.clap_builder.'4.3.12']
data_attr = '[":README.md"]'

[package.metadata.raze.crates.clap_derive.'4.3.12']
data_attr = '[":README.md"]'

The rustix version is 0.38.4

@dayfine
Copy link

dayfine commented Jul 30, 2023

Looking at this template:

{%- for k, alias in crate.default_deps.aliased_dependencies %}
"{{alias.target}}": "{{alias.alias}}",
{%- endfor %}
{%- for dep in crate.targeted_deps %}
{%- for k, alias in dep.deps.aliased_dependencies %}
"{{alias.target}}": "{{alias.alias}}",
{%- endfor %}
{%- endfor %}

There doesn't seem to be any check that crate.default_deps.aliased_dependencies and crate.targeted_deps[].deps.aliased_dependencies does not contain duplicate.

@hxndg
Copy link

hxndg commented Sep 7, 2023

I just remove the duplicated line in generate build file to force compile proceed...,

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

3 participants