Skip to content

VxWorks needs a newer version of cc-rs #66232

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
BaoshanPang opened this issue Nov 8, 2019 · 2 comments · Fixed by #66255
Closed

VxWorks needs a newer version of cc-rs #66232

BaoshanPang opened this issue Nov 8, 2019 · 2 comments · Fixed by #66255

Comments

@BaoshanPang
Copy link
Contributor

Do we have plan to get rid of this restriction recently? A newer version of cc-rs is needed for VxWorks

cc = "=1.0.37"

@ehuss
Copy link
Contributor

ehuss commented Nov 9, 2019

cc can't currently be updated due to a build problem with riscv. More info at #65445 (comment). I think the issue is that rustbuild uses cc to discover cc toolchains, and cc-rs gained riscv support, and so now it thinks it should use a gcc toolchain that doesn't exist. The detection is in https://github.com/rust-lang/rust/blob/master/src/bootstrap/cc_detect.rs and Alex mentioned just setting a CC_* env var in the riscv container might be enough. It's been on my todo list for a while, but I haven't had a chance to look at it. I can maybe try to look at it this weekend.

@BaoshanPang
Copy link
Contributor Author

@ehuss
Thanks for working on this issue. Enjoy your weekend, it is not that urgent.

Centril added a commit to Centril/rust that referenced this issue Nov 15, 2019
Update cc, git2, num_cpus.

This updates the `cc` crate, bringing in better parallel building support. Also updates `git2` which enables the parallel feature. (Note: I don't expect it will have a significant impact on build time, but seems good to update anyways.)

The main thorn is that `cc` gained knowledge about RISC-V architectures (rust-lang/cc-rs#428, rust-lang/cc-rs#429, rust-lang/cc-rs#430), but the builders on CI do not have the riscv C compiler installed. This means that bootstraps' cc detection was finding a C compiler that isn't installed, and fails.

The solution here is to override the cc detection to `false`. The C compiler isn't actually used on riscv platforms. AFAIK, the only location would be compiler_builtins, and it currently forces C support off (https://github.com/rust-lang/compiler-builtins/blob/a533ae9c5aa325db209659679535fe1f186eae81/build.rs#L49-L55).

Other possible solutions:
- Add the override in cc_detect for riscv (or any "no-C" platform like wasm32 and nvptx)
- Install and use the appropriate c compiler. I tried this the `g++-riscv64-linux-gnu` package, but it failed missing some header file.

Closes rust-lang#66232
@bors bors closed this as completed in 9b0214d Nov 16, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants