GCC compilation fails with "undefined Symbols"

Aperta
#2,637 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
build-system, cli

Direzione di ricerca

Start by examining the package installation path in internal/devpkg/package.go and the Nix build invocation in internal/nix/build.go; the logs show devbox add gcc reaches a failing GCC 15 build on Apple Silicon. Reproduce with the reported devbox and Nix versions, then inspect the full derivation log with nix log to understand the undefined symbols. Done means GCC installs successfully on macOS Apple Silicon without breaking other package installations.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug triage
What happened?

I tried to add gcc to devbox, but devbox add gcc failed

Steps to reproduce
  1. devbox init
  2. devbox add gcc
Command

add

devbox.json
{
    "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.2/.schema/devbox.schema.json",
    "packages": [],
    "shell": {
      "init_hook": [
        "echo 'Welcome to devbox!' > /dev/null"
      ],
      "scripts": {
        "test": [
          "echo \"Error: no test specified\" && exit 1"
        ]
      }
    }
  }
}
Devbox version

0.14.2

Nix version

nix (Nix) 2.23.3

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

~/tmp/rust_compile % DEVBOX_DEBUG=1 devbox add gcc
time=2025-06-29T21:07:23.024+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-06-29T21:07:23.024+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-06-29T21:07:23.024+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/add_gcc/devbox.json dur=203.083µs
time=2025-06-29T21:07:23.025+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-06-29T21:07:23.025+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-06-29T21:07:23.025+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/add_gcc/devbox.json dur=52.542µs
time=2025-06-29T21:07:23.042+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug"
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/nix/nix.go:143 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.pid=23877 cmd.code=0 cmd.dur=42.127458ms
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/add_gcc/devbox.json dur=111.25µs
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=gcc mode=auto
time=2025-06-29T21:07:23.084+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=gcc mode=auto
time=2025-06-29T21:07:23.361+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/store.go:145 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store info --store daemon --json"
time=2025-06-29T21:07:23.440+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/store.go:145 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store info --store daemon --json" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.pid=23879 cmd.code=0 cmd.dur=79.555042ms
time=2025-06-29T21:07:23.440+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devbox/providers/nixcache/setup.go:86 msg="nixcache: running setup: first time setup"
Info: Adding package "gcc@latest" to devbox.json
time=2025-06-29T21:07:23.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=gcc mode=auto
time=2025-06-29T21:07:23.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=gcc mode=auto
time=2025-06-29T21:07:23.990+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/store.go:61 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/8r1ihidd9z6l6lzvryvg409vscr259ms-gcc-wrapper-15.1.0 /nix/store/ybihi6w1b23zm4674amci4a3h811sh95-gcc-wrapper-15.1.0-man"
time=2025-06-29T21:07:24.079+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/store.go:61 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/8r1ihidd9z6l6lzvryvg409vscr259ms-gcc-wrapper-15.1.0 /nix/store/ybihi6w1b23zm4674amci4a3h811sh95-gcc-wrapper-15.1.0-man" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.pid=23882 cmd.code=0 cmd.dur=88.671292ms
Info: Installing the following packages to the nix store: gcc@latest
time=2025-06-29T21:07:24.079+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/build.go:50 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15' 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15'"
error: builder for '/nix/store/hz8mv9d8hvkjsazd5yh63a2dbj55jn16-gcc-15.1.0.drv' failed with exit code 2;
last 25 log lines:
> done
> Undefined symbols for architecture arm64:
> "___deregister_frame_info", referenced from:
> -reexported_symbols_list command line option
> "___deregister_frame_info_bases", referenced from:
> -reexported_symbols_list command line option
> "___register_frame_info", referenced from:
> -reexported_symbols_list command line option
> "___register_frame_info_bases", referenced from:
> -reexported_symbols_list command line option
> "___register_frame_info_table", referenced from:
> -reexported_symbols_list command line option
> "___register_frame_info_table_bases", referenced from:
> -reexported_symbols_list command line option
> "___register_frame_table", referenced from:
> -reexported_symbols_list command line option
> ld: symbol(s) not found for architecture arm64
> collect2: error: ld returned 1 exit status
> make[3]: *** [../../../gcc-15.1.0/libgcc/config/t-slibgcc-darwin:143: libgcc_s.1.dylib] Error 1
> make[3]: Leaving directory '/private/tmp/nix-build-gcc-15.1.0.drv-2/build/arm64-apple-darwin/libgcc'
> make[2]: *** [Makefile:17913: all-stage1-target-libgcc] Error 2
> make[2]: Leaving directory '/private/tmp/nix-build-gcc-15.1.0.drv-2/build'
> make[1]: *** [Makefile:23151: stage1-bubble] Error 2
> make[1]: Leaving directory '/private/tmp/nix-build-gcc-15.1.0.drv-2/build'
> make: *** [Makefile:23456: bootstrap] Error 2
For full logs, run 'nix log /nix/store/hz8mv9d8hvkjsazd5yh63a2dbj55jn16-gcc-15.1.0.drv'.
error: 1 dependencies of derivation '/nix/store/q5bdw4inzxr9pnb78b41rd8kr7gri12z-gcc-wrapper-15.1.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q5bdw4inzxr9pnb78b41rd8kr7gri12z-gcc-wrapper-15.1.0.drv' failed to build
error: build of '/nix/store/q5bdw4inzxr9pnb78b41rd8kr7gri12z-gcc-wrapper-15.1.0.drv^man,out' failed
time=2025-06-29T21:12:33.882+02:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/build.go:50 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15' 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15'" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.pid=23888 cmd.code=1 cmd.dur=5m9.803110833s

Error: There was an error installing nix packages
source: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' build --impure --no-link 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15' 'github:NixOS/nixpkgs/076e8c6678d8c54204abcb4b1b14c366835a58bb#gcc15': exit code 1

time=2025-06-29T21:12:33.883+02:00 level=ERROR source=go.jetify.com/devbox/internal/boxcli/midcobra/debug.go:68 msg="command error" stderr="" execid=8ca2453be92844138f7e34c8cc2e4592 stack=
time=2025-06-29T21:12:33.884+02:00 level=ERROR source=go.jetify.com/devbox/internal/boxcli/midcobra/debug.go:70 msg="command error" execid=8ca2453be92844138f7e34c8cc2e4592 stack=
time=2025-06-29T21:12:33.884+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:126 msg="searching for config file (including parent directories)" path=.
time=2025-06-29T21:12:33.884+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:147 msg="trying config file" path=devbox.json
time=2025-06-29T21:12:33.885+02:00 level=DEBUG source=go.jetify.com/devbox/internal/devconfig/config.go:134 msg="config file found" path=/Users/add_gcc/devbox.json dur=886.292µs

Lingua principale
Go
Stelle
12.4k
Fork
358
Merge medio
17h 12m
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jetify-com/devbox

Tutte le issue di jetify-com/devbox

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.