Skip to content

release-lib: build packages without meta.platforms on all platforms - #351919

Merged
RossComputerGuy merged 8 commits into
NixOS:staging-nextfrom
emilazy:push-tkvvputlxlpm
Oct 30, 2024
Merged

RossComputerGuy merged 8 commits into
NixOS:staging-nextfrom
emilazy:push-tkvvputlxlpm

Conversation

@emilazy

@emilazy emilazy commented Oct 28, 2024 •

Copy link
Copy Markdown
Member

This was added in #19990 to ensure that packages that previously weren’t building at all would get at least one platform’s worth of coverage. However, since most runCommand calls don’t explicitly set any meta information, this meant that things like tests.makeWrapper were only being run for x86_64-linux. Since most trivial builder calls should work on all platforms, it doesn’t make much sense for them to be restricted in this way, and we shouldn’t unnecessarily penalize other platforms by treating an empty meta.platforms inconsistently with check-meta’s maximally‐permissive interpretation. Actual packages that only work on a subset of platforms should, of course, set meta.platforms explicitly.

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.11 Release Notes (or backporting 23.11 and 24.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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@nix-owners
nix-owners Bot requested a review from philiptaron October 28, 2024 15:40
@emilazy emilazy changed the title runCommandWith: support all platforms by default; tests.build-environment-info: add more information release-lib: build packages without meta.platforms on all platforms Oct 28, 2024
@emilazy

emilazy commented Oct 28, 2024

Copy link
Copy Markdown
Member Author

(For posterity: I talked myself into the more radical version of this after seeing that the [ "x86-64-linux" ] default was not, as I had assumed, “we’re expanding platform support but old derivations without anything set will assume they only run on the default platform” but instead “these things aren’t building on Hydra at all and we should fix that”.)

@philiptaron philiptaron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Heck yes.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 28, 2024
@github-actions github-actions Bot added the 6.topic: php PHP is a general-purpose scripting language geared towards web development. label Oct 29, 2024

@RossComputerGuy RossComputerGuy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i approb

@emilazy

emilazy commented Oct 29, 2024

Copy link
Copy Markdown
Member Author

Don’t get too excited, I’m still playing whack‐a‐mole with the evaluation failures. But hopefully we can get this in.

@ofborg ofborg Bot added the 8.has: package (new) This PR adds a new package label Oct 29, 2024
@ofborg
ofborg Bot requested a review from piotrkwiecinski October 29, 2024 06:20
@ofborg ofborg Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 29, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 29, 2024

@philiptaron philiptaron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Master is now questionable, but I leave it up to the author about whether to retarget the PR to staging.

@emilazy

emilazy commented Oct 29, 2024

Copy link
Copy Markdown
Member Author

Well, it’s complicated. It’s ~23k permanent new Hydra jobs, but those jobs largely consist of packages that are already getting built because of other jobs. For instance, we have no job for gnome-common.aarch64-linux, because it has no meta.platforms set, which seems absurd, but of course it’s getting built on other platforms anyway because other things that are already in the jobset bring it in as a dependency.

I would estimate that the total number of things that will actually be built that weren’t before would be in the hundreds – it should basically mostly be leaf packages without meta.platforms set. Nothing should be rebuilt from this change – it doesn’t throw anything out, just pile more on. Actually reasonably estimating the number of builds is going to require a little work to query the cache, and I’m not sure how to avoid counting failing builds there.

That said, master may be problematic as the merge into staging-next would cause a duplication of all the work relating to the new jobs, but I think that, if this is fine to merge at all, staging-next would seem reasonable, as it is not going to cause any existing builds to be thrown out. I will tentatively retarget to staging-next, but I am waiting to hear from people with more Hydra‐fu than me as to the correct approach here.

@github-actions github-actions Bot added the 6.topic: TeX Issues regarding texlive and TeX in general label Oct 29, 2024
@emilazy

emilazy commented Oct 29, 2024

Copy link
Copy Markdown
Member Author

The latest push should be a net addition of about ~5k Hydra jobs by setting hydraPlatforms for TeX Live constituent packages, after discussion in the Staging room on Matrix. Some ~2.5k of the remaining jobs are actual useful SBCL and PHP packages that aren’t getting built for aarch64-linux or Darwin right now, and there are other, smaller package sets that will be built on other platforms where they weren’t before. All of this is good stuff that we ought to be building on supported platforms (given our decision to recurseIntoAttrs them in the first place), and that probably was never intended to be restricted to x86_64-linux.

There will also be jobs that don’t generate new builds, as discussed above. I think it should be okay as it is now, based on the discussion, and we can set more meta.{platforms,hydraPlatforms} if anything turns up that looks particularly problematic. I’d prefer for someone else to merge this, after seeing ofborg results (which will inflate the count a bit by not including the reduction in texlivePackages.*).

Comment thread pkgs/top-level/php-packages.nix Resolved
Hydra can handle packages that `throw` but not attributes that
disappear depending on platform, and it seems okay for evaluation to
fail here for non‐Linux platforms.
This was added in <NixOS#19990> to
ensure that packages that previously weren’t building at all would
get at least one platform’s worth of coverage. However, since most
`runCommand` calls don’t explicitly set any `meta` information,
this meant that things like `tests.makeWrapper` were only being
run for `x86_64-linux`. Since most trivial builder calls should
work on all platforms, it doesn’t make much sense for them to be
restricted in this way, and we shouldn’t unnecessarily penalize
other platforms by treating an empty `meta.platforms` inconsistently
with `check-meta`’s maximally‐permissive interpretation. Actual
packages that only work on a subset of platforms should, of course,
set `meta.platforms` explicitly.
The user information would have helped diagnose the empty GECOS issue
we had with the Hydra Darwin builders recently and the OS information
seems generally nice to have.
@emilazy

emilazy commented Oct 29, 2024

Copy link
Copy Markdown
Member Author

Are we going to want to get this in before ZHF and before the merge?

I missed this comment. Yes, I think so, assuming we agree that it seems like a good idea to merge, although if it happens with the staging-next merge then it can also just target master since it makes no difference in terms of additional jobs.

@ofborg ofborg Bot added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 30, 2024
@emilazy

emilazy commented Oct 30, 2024 •

Copy link
Copy Markdown
Member Author

ofborg results now list 9982 jobs, so minus the ~4445 TeX Live jobs that this is removing, it should be a net increase of 5.5k jobs, as expected. Should be ready when anyone feels brave enough. (The ofborg build-environment-info failure is as designed.)

@RossComputerGuy

Copy link
Copy Markdown
Member

I missed this comment. Yes, I think so, assuming we agree that it seems like a good idea to merge, although if it happens with the staging-next merge then it can also just target master since it makes no difference in terms of additional jobs.

Sounds good, we probably should merge this in the next few hours or any time before 6PM PST to get the ball rolling. I hope to do the merge as listed in the 24.11 release schedule after work which would mean some time after 6PM PST.

@emilazy

emilazy commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

Sure, I guess it could be merged now and another staging-next eval kicked off. Or it could be merged directly before the merge into master. I don’t know really; I don’t understand Hydra bottlenecks well enough to say what’s best and it was enough of a pain to figure out what was going on here and come up with a safe‐seeming plan to address it, so I’ll let someone else do the scary merge.

@RossComputerGuy

Copy link
Copy Markdown
Member

Guess I'll merge it.

@RossComputerGuy
RossComputerGuy merged commit fb01d57 into NixOS:staging-next Oct 30, 2024
@emilazy
emilazy deleted the push-tkvvputlxlpm branch October 30, 2024 16:36
@emilazy

emilazy commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

Not sure whether to kick off a staging-next evaluation or not. There’s an installer test issue that is currently blocking the merge into master.

@RossComputerGuy

Copy link
Copy Markdown
Member

Not sure whether to kick off a staging-next evaluation or not.

Idk how to kick one off but sure, why not? Better get some of that work rolling.

There’s an installer test issue that is currently blocking the merge into master.

Is there an open issue? I'll look into that before merging staging-next.

@emilazy

emilazy commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

Well, because there’ll presumably be a new eval to test the installer fix anyway. See #348827 (comment). We cannot merge as it would block the channel.

configureFlags = [ "--with-snmp" ];
# net-snmp doesn't build on darwin.
enable = (!stdenv.hostPlatform.isDarwin);
meta.broken = (!stdenv.hostPlatform.isDarwin);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't this wrong now? Before it was enabled on linux and now it is marked broken on linux.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, oops. But it turns out it builds fine on Darwin now. #353479

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think pdo had the same mistake #353492

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

Labels

6.topic: php PHP is a general-purpose scripting language geared towards web development. 6.topic: TeX Issues regarding texlive and TeX in general 8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants