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

rustc: support clang-based stdenv #257950

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

RaitoBezarius
Copy link
Member

@RaitoBezarius RaitoBezarius commented Sep 29, 2023

Description of changes

Previously, we were passing cc and c++ all the time to rustc bootstrap process.

This was wrong because cc-rs relies on the name of the compiler to detect whether this is Clang or a GNU GCC.

Related:

https://github.com/rust-lang/cc-rs/blob/df2f86ceafbe787698b890a3d6bde9f969d5fa88/src/lib.rs#L3334
https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Missing.20dynamic.20libraries.20when.20bootstrapping.20Rust/near/377914373

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Previously, we were passing `cc` and `c++` all the time to rustc bootstrap process.

This was wrong because `cc-rs` relies on the name of the compiler to detect whether this is Clang or a GNU GCC.

Related:

[1]: https://github.com/rust-lang/cc-rs/blob/df2f86ceafbe787698b890a3d6bde9f969d5fa88/src/lib.rs#L3334
[2]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Missing.20dynamic.20libraries.20when.20bootstrapping.20Rust/near/377914373
@RaitoBezarius
Copy link
Member Author

Hm, actually, this could go on master as no one is depending on clang stdenvs yet…

@figsoda
Copy link
Member

figsoda commented Sep 29, 2023

@ofborg eval

@ofborg ofborg bot requested review from globin, cstrahan and tjni September 29, 2023 18:47
@ofborg ofborg bot added 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Sep 29, 2023
@RaitoBezarius
Copy link
Member Author

Hah, it does trigger rebuilds.

@alyssais
Copy link
Member

alyssais commented Oct 3, 2023

This was wrong because cc-rs relies on the name of the compiler to detect whether this is Clang or a GNU GCC.

That's horrifying. Can it be fixed?

@RaitoBezarius
Copy link
Member Author

This was wrong because cc-rs relies on the name of the compiler to detect whether this is Clang or a GNU GCC.

That's horrifying. Can it be fixed?

I believe it is: rust-lang/cc-rs#709

@RaitoBezarius RaitoBezarius merged commit 5829a85 into NixOS:staging Oct 12, 2023
14 checks passed
@alyssais
Copy link
Member

@RaitoBezarius cc-rs 1.0.84 includes this change, so if we can get rust to update we can drop this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants