lib/systems/parse.nix: replicate cygwin/msvc parsing hack when unparsing#235229
Conversation
For almost a decade nixpkgs has parsed `*-*-{cygwin,msvc}` as being
ABIs for a common kernel (windows), rather than as kernels. It
isn't really reasonable to change nixpkgs' handling at this point,
so this commit replicates the special-case hack when unparsing, in
order to ensure that `(unparse . parse)==id`.
Ericson2314
left a comment
There was a problem hiding this comment.
As I wrote in the main PR (I missed this one before, whoops) I don't think we should do this.
windows-gnu I already fixed in GNU config, and with https://lists.gnu.org/archive/html/config-patches/2023-08/msg00011.html window-cygnus will be accepted too.
I would rather we keep on normalizing things in the way we do, and instead add these cases as tests where we explicitly choose to normalize in a different way (like x86_64-linux-gnu).
After a deprecation cycle, and fixing any downstream bugs in GCC etc., we can stop accepting ...-cygwin and ...-mingw32 if you like, so our deviation from GNU config is reduced.
Ericson2314
left a comment
There was a problem hiding this comment.
I'll also add that since I made GNU config support ...-windows-gnu, this PR in fact does not get our parser closer to GNU config:
- This PR normalizes
...-windows-gnuto...-mingw32 - GNU config does not, not normalizing either one to the other.
Description of changes
For about five years nixpkgs has parsed
*-*-{cygwin,msvc}as ifcygwinandmsvcwere ABIs for a common kernel (windows), rather than as kernels (which is howgnu-configrather counterintuitively treats them). This PR replicates the special-case parsing hack when unparsing, in order to ensure that(unparse . parse)==id.These windows triples are probably used much more often in Nix expressions downstream of nixpkgs than in nixpkgs itself -- so we have really poor visibility on what kind of breakage would be caused by changing this treatment. Because most of the uses of this behavior are by now long-established and out-of-tree where we can't see them, I think it would be a bad idea to try to change this, and we should just grandfather the hack as a special exception.
Part of:
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)