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

BUG: flate2 (1.0.20) deps are incorrectly generated #389

Closed
palfrey opened this issue Feb 27, 2021 · 2 comments · Fixed by #437
Closed

BUG: flate2 (1.0.20) deps are incorrectly generated #389

palfrey opened this issue Feb 27, 2021 · 2 comments · Fixed by #437

Comments

@palfrey
Copy link

palfrey commented Feb 27, 2021

Deps are generated as

    deps = [
        "@raze__cfg_if__1_0_0//:cfg_if",
        "@raze__crc32fast__1_2_1//:crc32fast",
        "@raze__libc__0_2_86//:libc",
        "@raze__miniz_oxide__0_4_4//:miniz_oxide",
    ] + selects.with_or({
        # cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))
        (
            "@rules_rust//rust/platform:wasm32-unknown-unknown",
            "@rules_rust//rust/platform:wasm32-wasi",
        ): [
            "@raze__miniz_oxide__0_4_4//:miniz_oxide",
        ],
        "//conditions:default": [],
    }),

And you get
ERROR: /home/palfrey/.cache/bazel/_bazel_palfrey/1e69055091f05c565038b6edab4c56d2/external/raze__flate2__1_0_20/BUILD.bazel:77:13: Label '@raze__miniz_oxide__0_4_4//:miniz_oxide' is duplicated in the 'deps' attribute of rule 'flate2'

This is because in the Cargo.toml miniz_oxide is optional by default, except for in the wasm32 target when it's non-optional.

@warriorstar-orion
Copy link

For what it's worth, if you aren't targeting wasm, adding explicit target toolchains will cause raze to elide the select here, e.g.:

[workspace.metadata.raze]
targets = [
    "x86_64-apple-darwin",
    "x86_64-pc-windows-msvc",
    "x86_64-unknown-linux-gnu",
]

@palfrey
Copy link
Author

palfrey commented Aug 22, 2021

Confirmed that 8443486 fixes my original issue

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

Successfully merging a pull request may close this issue.

2 participants