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

cc-wrapper: wrap TOOL and ${targetPrefix}-TOOL if both exist #1

Conversation

Programmerino
Copy link
Owner

In NixOS#87909 ("stdenv: always
pass --build, --host to configure") we noticed that stdenv.cc
exposes c++ as a wrapped bianry and x86_64-unknown-linux-gnu-c++
as unsrapped binary.

As a result x86_64-unknown-linux-gnu-c++ was not able to create
basic bianries. This makes seepingly no-op --host=x86_64-unknown-linux-gnu
option for ./configure a breaking change.

This change adds wrappers to prefixed binaries for cross and
native cases where such an inconsistency exists. New validation
change will catch new possible inconsistencies. It already caught
existing inconsistencies in: gcc, gfortran, gcj, gccgo, gdc,
clang.

At least radare2 build is fixed by consistent wrappers. It used to fail
before as:

radare2> ERROR: x86_64-unknown-linux-gnu-gcc cannot create executables

Issue: NixOS#178802

Description of changes
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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

In NixOS#87909 ("stdenv: always
pass --build, --host to configure") we noticed that stdenv.cc
exposes `c++` as a wrapped bianry and `x86_64-unknown-linux-gnu-c++`
as unsrapped binary.

As a result `x86_64-unknown-linux-gnu-c++` was not able to create
basic bianries. This makes seepingly no-op `--host=x86_64-unknown-linux-gnu`
option for `./configure` a breaking change.

This change adds wrappers to prefixed binaries for cross and
native cases where such an inconsistency exists. New validation
change will catch new possible inconsistencies. It already caught
existing inconsistencies in: `gcc`, `gfortran`, `gcj`, `gccgo`, `gdc`,
`clang`.

At least `radare2` build is fixed by consistent wrappers. It used to fail
before as:

    radare2> ERROR: x86_64-unknown-linux-gnu-gcc cannot create executables

Issue: NixOS#178802
@trofi
Copy link

trofi commented Feb 20, 2023

Does it fix the problem with original PR? clang was not wrapped correctly (NixOS#181724 (comment)) and was failing build failures like pkgsLLVM.xorg.xorgproto.

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 this pull request may close these issues.

2 participants