lib/systems/parse.nix: add removeAbiSuffix, use it#262838
lib/systems/parse.nix: add removeAbiSuffix, use it#262838Ericson2314 merged 1 commit intomasterfrom unknown repository
Conversation
gnu-config will ignore the portion of a triple matching the regex `e?abi.*$` when determining the validity of a triple. In other words, `i386-linuxabichickenlips` is a valid triple. This commit updates our parsing routines to match gnu-config. I was recently surprised to discover that it is in fact possible to shoehorn ABI flavors into nix doubles in a way which preserves their property of being a (non-canonical) subset of the valid gnu-config triples. This commit is required in order to exploit that discovery to add automatic detection of ILP32 platforms (64-bit void*, 32-bit int, like the Apple Watch and MIPS n32) to Nix.
I thought GNU config was handling those in a different (also weird) way? |
|
Ah right, I am thinking of
which are...not exactly less nuts! |
|
If curious, the hack is: Since |
|
This is so totally frustrating.
So when LLVM decides to add support in 2022 do they use the same triple? Noooo, they have to do their own thing apparently. So they call it |
Description of changes
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)gnu-configignores the portion of a triple matching the regexe?abi.*$In other words,
i386-linuxabichickenlipsis a valid triple.This commit updates our parsing routines to match gnu-config.
I was recently surprised to discover that it is in fact possible to shoehorn ABI flavors into nix doubles in a way which preserves their property of being a (non-canonical) subset of the valid gnu-config triples. This commit is required in order to exploit that discovery to add automatic detection of ILP32 platforms (64-bit void*, 32-bit int, like the Apple Watch and MIPS n32) to Nix.