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

gambit: Fails to build since deterministically built gcc PR merge #123685

Closed
eraserhd opened this issue May 19, 2021 · 8 comments
Closed

gambit: Fails to build since deterministically built gcc PR merge #123685

eraserhd opened this issue May 19, 2021 · 8 comments

Comments

@eraserhd
Copy link
Contributor

Describe the bug

gambit fails to build since commit 48c952c ( PR #112928 - stdenv: make a deterministically built gcc ). Found by git bisect.

This is on Darwin.

To Reproduce

nix-build . -A gambit

Expected behavior

It builds.

Screenshots

this derivation will be built:
  /nix/store/dp954vrzrq27fgnh0dsi9b874vv1msyn-gambit-4.9.3.drv
building '/nix/store/dp954vrzrq27fgnh0dsi9b874vv1msyn-gambit-4.9.3.drv'...
unpacking sources
unpacking source archive /nix/store/argbv6rzp25h5qyspav4knmj8zgf0zdm-gambit-v4_9_3.tgz
source root is gambit-v4_9_3
setting SOURCE_DATE_EPOCH to timestamp 1549376765 of file gambit-v4_9_3/doc/gambit.txt
patching sources
configuring
configure: WARNING: unrecognized options: --enable-targets
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking target system type... x86_64-apple-darwin19.4.0
checking for gcc... /nix/store/4akw6n9a2f1cxwcwihzf1diblbyzhkkc-clang-wrapper-7.1.0/bin/gcc
checking whether the C compiler works... no
configure: error: in `/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3':
configure: error: C compiler cannot create executables
See `config.log' for more details
error: builder for '/nix/store/dp954vrzrq27fgnh0dsi9b874vv1msyn-gambit-4.9.3.drv' failed with exit code 77;
       last 10 log lines:
       > configuring
       > configure: WARNING: unrecognized options: --enable-targets
       > checking build system type... x86_64-apple-darwin19.4.0
       > checking host system type... x86_64-apple-darwin19.4.0
       > checking target system type... x86_64-apple-darwin19.4.0
       > checking for gcc... /nix/store/4akw6n9a2f1cxwcwihzf1diblbyzhkkc-clang-wrapper-7.1.0/bin/gcc
       > checking whether the C compiler works... no
       > configure: error: in `/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3':
       > configure: error: C compiler cannot create executables
       > See `config.log' for more details
       For full logs, run 'nix log /nix/store/dp954vrzrq27fgnh0dsi9b874vv1msyn-gambit-4.9.3.drv'.

Notify maintainers

Gambit: @thoughtpolice @raskin @fare
gcc stdenv: @baloo

Metadata

  • system: "x86_64-darwin"
  • host os: Darwin 19.4.0, macOS 10.15.4
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.4pre20210326_dd77f71
  • channels(root): "nixpkgs-20.09pre240394.ca3fa9c32a4"
  • nixpkgs: /nix/store/6dwr7zpzbhhfwna0wr7i8073gz1vnarc-source

Maintainer information:

attribute:
- gambit
- gcc
@eraserhd eraserhd changed the title gambit: Fails to build since reproducible gcc PR merge gambit: Fails to build since deterministically built gcc PR merge May 19, 2021
@fare
Copy link
Contributor

fare commented May 19, 2021

It's working in my repo/branch https://github.com/MuKnIO/nixpkgs/tree/alpha but #114449 is blocked because I can't get #116275 is blocked by RFC0091 NixOS/rfcs#91 having no support.

@baloo
Copy link
Member

baloo commented May 20, 2021

I don't have access to a darwin setup easily :/ Not sure i'll be able to help too much here :(

@eraserhd
Copy link
Contributor Author

eraserhd commented May 20, 2021

The attribute gccStdenv.cc no longer contains a gcc-based compiler on Darwin, but the clang wrapper.

The breaking change is deleting this one line here: 48c952c#diff-ab5748dc9567516fefba8344056b51ec1866adeace380f46e58a7af3d619ea22L10285

Reverting that one line makes gambit build again.

@baloo I don't understand what deleting that cc = gcc; line is about. It seems wrong, but I'm not sure reverting is now right. Thoughts?

@eraserhd
Copy link
Contributor Author

eraserhd commented May 20, 2021

Build fails with "Illegal instruction: 4" with cc = gcc; restored.

Will investigate more later, but possibilities:

  • The deterministic wrapper is not compatible with Mac ABI somehow?
  • The deterministic wrapper is not applied (or not applied correctly) here?

Doesn't this mean that plain old gcc won't work on Darwin now? A simple Hello, world does work.

DYLD_LIBRARY_PATH=..: ../gsc-boot -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c  -prelude "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")" _io.scm
DYLD_LIBRARY_PATH=..: ../gsc-boot -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c  -prelude "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")" _num.scm
DYLD_LIBRARY_PATH=..: ../gsc-boot -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c  -prelude "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")" _std.scm
DYLD_LIBRARY_PATH=..: ../gsc-boot -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c  -prelude "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")" _repl.scm
make[2]: *** [makefile:168: _std.c] Illegal instruction: 4
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [makefile:168: _repl.c] Illegal instruction: 4
make[2]: *** [makefile:168: _num.c] Illegal instruction: 4
make[2]: *** [makefile:168: _io.c] Illegal instruction: 4
make[2]: Leaving directory '/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3/lib'
make[1]: *** [makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3'
make: *** [makefile:114: from-scratch] Error 2
error: builder for '/nix/store/38nfp84g07psjircpnwnrilmg911x2k9-gambit-4.9.3.drv' failed with exit code 2;
       last 10 log lines:
       > DYLD_LIBRARY_PATH=..: ../gsc-boot -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c  -prelude "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")" _repl.scm
       > make[2]: *** [makefile:168: _std.c] Illegal instruction: 4
       > make[2]: *** Waiting for unfinished jobs....
       > make[2]: *** [makefile:168: _repl.c] Illegal instruction: 4
       > make[2]: *** [makefile:168: _num.c] Illegal instruction: 4
       > make[2]: *** [makefile:168: _io.c] Illegal instruction: 4
       > make[2]: Leaving directory '/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3/lib'
       > make[1]: *** [makefile:466: all-recursive] Error 1
       > make[1]: Leaving directory '/private/tmp/nix-build-gambit-4.9.3.drv-0/gambit-v4_9_3'
       > make: *** [makefile:114: from-scratch] Error 2
       For full logs, run 'nix log /nix/store/38nfp84g07psjircpnwnrilmg911x2k9-gambit-4.9.3.drv'.

@baloo
Copy link
Member

baloo commented May 20, 2021

@baloo I don't understand what deleting that cc = gcc; line is about. It seems wrong, but I'm not sure reverting is now right. Thoughts?

that ... was not on purpose. This is definitely a mistake, there is no reason to do that.

@baloo
Copy link
Member

baloo commented May 20, 2021

looks like it was fixed in b863a7c (available in current master. see #123421)

@eraserhd
Copy link
Contributor Author

Nice! It gets as far as the illegal instruction on master now.

@baloo Any thoughts on how that PR could make gambit fail with "Illegal instruction: 4"? Is the deterministic gcc somehow pinned to an architecture or does it make weird executables?

@baloo
Copy link
Member

baloo commented May 21, 2021

gcc used not to be profiled on darwin:

-        # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
-        profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));

so nothing should have changed in this regard (except for my dumb mistake)

@wegank wegank closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants