Message ID | 20220502111715.13500-1-othacehe@gnu.org |
---|---|
Headers | show |
Series | Add --list-systems and --list-targets options. | expand |
Hello! Mathieu Othacehe <othacehe@gnu.org> skribis: > Most build commands support --system and --target options. Those options > suffer from multiple issues: they are never listed and never checked. > > For --system, this is a real issue as aside from reading the (gnu packages > bootstrap) module content the user cannot know what are the supported > arguments. Providing a wrong system also fails badly: > > mathieu@meije ~$ guix build hello --system=arm-linux > Backtrace: > In guix/memoization.scm: > 101:0 19 (_ #<hash-table 7f1d5d82a340 0/31> #<package tar@1.34 …> …) > > ... > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > dynamic linker name not known for this system "arm-linux" > > For --target, any GNU supported triplet can possibly work but providing a > wrong triplet will also fail badly: > > mathieu@meije ~$ guix build hello --target=arm-linux > Backtrace: > In guix/store.scm: > 1385:9 19 (map/accumulate-builds #<store-connection 256.99 7f5bd…> …) > > > ... > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > dynamic linker name not known for this system "arm-linux" > > This patchset adds two new options: --list-systems and --list-targets that > list the supported systems and targets. The arguments passed to --system and > --target options are also checked: > > mathieu@meije ~/guix [env]$ ./pre-inst-env guix build hello --system=arm-linux > guix build: error: 'arm-linux' is not a supported system. Nice. > mathieu@meije ~/guix [env]$ ./pre-inst-env guix build hello --target=arm-linux > guix build: error: 'arm-linux' is not a supported target. Nice… but it’s a valid triplet (for freestanding binaries on 32-bit ARM, I believe). The ‘--target’ issue is tricky IMO because it’s mostly free-form. In (gnu packages …), there are calls like: (cross-gcc "avr" …) (cross-gcc "arm-none-eabi" …) (cross-gcc "propeller-elf" …) These are unusual but valid triplets. (I’m going to look more closely at the rest to get a more informed opinion…) Thanks for looking into this loooongstanding issue! Ludo’.