Skip to content

Conversation

@alyssais
Copy link
Member

Description of changes

Hopefully we'll be able to revert this soon!

@sternenseemann, 2022-04-22

I started working on getting aarch64-unknown-linux-musl into shape in April 2022. At that time, the stdenv didn't even build, and it hadn't built for years, due to woefully outdated bootstrap binaries. To get newer bootstrap binaries, we needed to get far enough with the old bootstrap binaries to be able to build new ones, getting Hydra to build them, and then getting those new binaries uploaded to tarballs.nixos.org. Getting that far with the old bootstrap binaries adding some hacks (like downgrading patchelf). Getting Hydra to build them required a complicated refactoring, as the previous scheme was designed around system doubles so there was no way to express a alternative choice of libc. This refactoring took several attempts.

But now, as of #283492, my two-year-long journey has finally reached its end. We have up-to-date bootstrap binaries, and we can revert the hacks we needed along the way to bring us to this point. So, as was always intended, this is a revert of #169764, as well as one extra hack added in #258564.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This reverts commit 45584b3.

These work fine now that we have an up-to-date bootstrap tarball for
this platform.
This reverts commit 661dfd8.

This problem has gone away now that aarch64-unknown-linux-musl has an
up-to-date bootstrap.
This reverts commit e22d0b4.

No longer needed now that we have an up-to-date
aarch64-unknown-linux-musl bootstrap.

Since the original commit, patchelf_0_14 was renamed to
patchelfStable.  There's no longer any need for it to have a name
other than "patchelf", but I've kept "patchelfStable" around as an
alias in case anybody's using it.
This reverts commit 3838a0a.

This was previously used on aarch64-unknown-linux-musl, but now that
that platform has an up-to-date bootstrap and can build current
patchelf, there's no longer any need to keep this around.
@alyssais alyssais added the 6.topic: musl Running or building packages with musl libc label Jan 25, 2024
Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

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

Good to see that this happened and the hacks can go again ✨

@ofborg ofborg bot added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jan 25, 2024
@alyssais alyssais merged commit f67b36b into NixOS:master Jan 25, 2024
@alyssais alyssais deleted the aarch64-musl-hacks branch January 25, 2024 20:29
Comment on lines -19747 to -19749
patchelf_0_13 = callPackage ../development/tools/misc/patchelf/0.13.nix {
patchelf = patchelfStable;
};
Copy link
Member

Choose a reason for hiding this comment

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

Attribute is being removed without a throwing alias

Copy link
Member Author

Choose a reason for hiding this comment

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

Is that really mandatory? Isn't it pretty obvious what's happened if a versioned attribute you were using disappears? (To the extent it's likely that anybody was explicitly using this version introduced just to be the default on aarch64-musl in the first place…)

Copy link
Member

Choose a reason for hiding this comment

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

While the API surface of Nixpkgs isn't explicitly declared somewhere yet, it's pretty much accepted that top-level attributes are effectively part of that. It's also not declared explicitly what stability guarantees Nixpkgs gives about such an API, but I think it's also fairly accepted that attributes should continue existing, that's why we have aliases.

Ideally I'd favor a deprecation message for one release, but in the absence of that we should at least have throwing aliases. Just removing attributes entirely is a bit too much.

And we should assume that any part of the API ends up getting used. Even if we don't hear from them, there likely is some user (or more) out there getting annoyed over attributes randomly disappearing. We can improve those users experience by being more diligent with aliases, I think we should go for that :)

Copy link
Member

Choose a reason for hiding this comment

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

Don't bother with this if you don't want to (though I'd merge your PR if you did). But just for the future I think it would be good to have aliases for all removed attributes.

Copy link
Member Author

Choose a reason for hiding this comment

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

And we should assume that any part of the API ends up getting used. Even if we don't hear from them, there likely is some user (or more) out there getting annoyed over attributes randomly disappearing.

We change little-used APIs all the time. There's no way it's possible to maintain our ability to iterate if we have to keep every reachable attribute working and unchanging for a two-cycle deprecation period.

Copy link
Member

Choose a reason for hiding this comment

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

if we have to keep every reachable attribute working and unchanging for a two-cycle deprecation period

Yeah, but that's not the case for a throwing alias, which costs effectively nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: musl Running or building packages with musl libc 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants