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

Log 0.4.8 and 0.3.9 generation issue --cfg=atomic_cas #110

Open
ghost opened this issue Sep 19, 2019 · 1 comment
Open

Log 0.4.8 and 0.3.9 generation issue --cfg=atomic_cas #110

ghost opened this issue Sep 19, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 19, 2019

hey @acmcarther, not sure if that is problem of cargo raze or rules_rust but the recent dependency on log 0.3.9 fails to build. Example that indirectly depends on that log version is slogger or grpc-0.6.1 crates from crates.io.

The problem seems to lay that log-0.3.9 imports log-0.4.8 which core method set_logger depends on atomic operations that are flipped via atomic_cas cfg flag. That one doesn't seem to be passed on many platforms correctly during compilation time. (Tested on Ubuntu 18.04 and Arch Linux) .

Workaround is to force cfg flag with cargo raze.

[raze.crates.log.'0.4.8']
additional_flags = [
    "--cfg=atomic_cas"
]

Not sure if you or rules_rust are aware of this issue. That's why I am creating this post. Also for any other person dealing with similar problem as me.

@acmcarther
Copy link
Member

acmcarther commented Sep 23, 2019

Thanks for filing this.

Looks like Cargo sets this cfg on most platforms in their build.rs. This is something that's hard for me replicate in cargo-raze even with current build.rs support, because we lack the ability to plumb from build.rs stdout to attrs for the dependent crate('s BUILD rule).

#97 contains an info dump about how build script execution currently works wit cargo-raze. TL;DR: Not well.

I'll keep this open so that folks can find it.

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