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

lib.systems.examples: canonicalize MIPS triples #180022

Merged
merged 1 commit into from
Jul 3, 2022

Conversation

alyssais
Copy link
Member

@alyssais alyssais commented Jul 3, 2022

Description of changes

In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple. I noticed that non-canonical values were being used here,
because the pkgsCross.mips64el-linux-gnu triples did not contain the
vendor field, but the pkgsCross.mips64el-linux-gnu.pkgsStatic did.

Here, I've run all the MIPS triples in lib.systems.examples through
config.sub to canonicalize them. I think this will avoid nasty
surprises in future.

Tested by building Nix and the bootstrap files for
pkgsCross.mips64el-linux-gnu.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

cc @amjoseph-nixpkgs

@alyssais alyssais added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jul 3, 2022
In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple.  I noticed that non-canonical values were being used here,
because the pkgsCross.mips64el-linux-gnu triples did not contain the
vendor field, but the pkgsCross.mips64el-linux-gnu.pkgsStatic did.

Here, I've run all the MIPS triples in lib.systems.examples through
config.sub to canonicalize them.  I think this will avoid nasty
surprises in future.

Tested by building Nix and the bootstrap files for
pkgsCross.mips64el-linux-gnu.
@alyssais alyssais changed the title lib.systems.examples: canonicalize triples lib.systems.examples: canonicalize MIPS triples Jul 3, 2022
@symphorien
Copy link
Member

In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple

is this documented somewhere ?

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jul 3, 2022
@alyssais
Copy link
Member Author

alyssais commented Jul 3, 2022

In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple

is this documented somewhere ?

No, in fact the documentation claims otherwise. But I don't think we're using LLVM triples in practice. Perhaps @sternenseemann or @Ericson2314 can weigh in here?

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm re-running the mips64el bootstrap with this change. It'll take a day or so to finish, but I doubt there will be any problems.

@ghost
Copy link

ghost commented Jul 3, 2022

But I don't think we're using LLVM triples in practice.

I don't think so either. What we're using are either autoconf tuples or multiarch tuples. They are exactly the same thing except in two cases involving older 32-bit architectures.

In Nixpkgs, we assume that the "config" field is a canonicalized GNU triple

is this documented somewhere ?

Suggested documentation: #180030

@sternenseemann
Copy link
Member

But I don't think we're using LLVM triples in practice.

It's a bit more complicated than that. We generally follow autoconf (since Nix is using that), but deviate from it in practical behavior (#165836) as well as nomenclature/semantics. Additionally in practice we assume that the canonicalized nixpkgs config attribute is interpreted in the same way by autoconf as well as LLVM, as it ends up being passed to clang via -target for example.

@alyssais alyssais merged commit e8d7d52 into NixOS:master Jul 3, 2022
@alyssais alyssais deleted the mips-triples branch July 3, 2022 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants