We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
To reproduce:
cc
gcc
CC=gcc cargo build
error: linker `cc` not found | = note: No such file or directory (os error 2) error: could not compile `libc` (build script) due to 1 previous error
Correct behaviour should be that the build.rs script should honor the CC environment variable and use that to link.
build.rs
CC
This is explicitly a problem when trying to get reproducible builds in systems like GUIX or (I presume, NIX).
; working-developer-shell.scm (use-modules (gnu) (gnu packages commencement) (guix) (guix packages) (guix build-system trivial) (guix licenses) ) (define base-manifest (specifications->manifest '( "rust@1.73.0" "rust-cargo@0.74" "gcc-toolchain" "coreutils" ))) (define-public custom-cc (package (name "custom-cc") (version "1.0") (source #f) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((out (assoc-ref %outputs "out")) (bin (string-append out "/bin")) ;; Adjust the path to the gcc binary as necessary. (gcc-path (string-append (assoc-ref %build-inputs "gcc-toolchain") "/bin/gcc"))) (mkdir-p bin) (symlink gcc-path (string-append bin "/cc")))))) (inputs `(("gcc-toolchain", gcc-toolchain))) (synopsis "Custom package providing a cc symlink to gcc") (description "This package installs a symlink named 'cc' in its bin output, which points to the gcc binary in the gcc-toolchain package.") (home-page "https://example.com") (license gpl3))) (define custom-cc-manifest (manifest (list (package->manifest-entry custom-cc)))) (concatenate-manifests (list base-manifest custom-cc-manifest))
; broken-developer-shell.scm (use-modules (gnu) (gnu packages commencement) (guix) (guix packages) (guix build-system trivial) (guix licenses) ) (define base-manifest (specifications->manifest '( "rust@1.73.0" "rust-cargo@0.74" "gcc-toolchain" "coreutils" ))) base-manifest
git clone https://github.com/rust-lang/libc.git cd libc guix environment -m ../broken-developer-shell.scm --pure CC=gcc cargo build
In this example, we add a symlink named cc in our PATH that points to gcc.
git clone https://github.com/rust-lang/libc.git cd libc guix environment -m ../working-developer-shell.scm --pure cargo build
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To reproduce:
cc
binary, but does have eg.gcc
installedCC=gcc cargo build
Correct behaviour should be that the
build.rs
script should honor theCC
environment variableand use that to link.
This is explicitly a problem when trying to get reproducible builds in systems like GUIX or (I presume, NIX).
Guix example
Broken example using guix
Working example using guix
In this example, we add a symlink named
cc
in our PATH that points togcc
.The text was updated successfully, but these errors were encountered: