-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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: Fix #30902 on 18.03 #37337
lib: Fix #30902 on 18.03 #37337
Conversation
Now works with cross and old and new meta checks alike.
The old way depended on old list-of-strings `meta.platforms`, and was not good for cross.
Negative reasoning like `allBut` is a bad idea with an open world of platforms. Concretely, if we add a new, quite different sort of platform, existing packages with `allBut` will claim they work on it even though they probably won't.
… world First, we need check against the host platform, not the build platform. That's simple enough. Second, we move away from exahustive finite case analysis (i.e. exhaustively listing all platforms the package builds on). That only work in a closed-world setting, where we know all platforms we might build one. But with cross compilation, we may be building for arbitrary platforms, So we need fancier filters. This is the closed world to open world change. The solution is instead of having a list of systems (strings in the form "foo-bar"), we have a list of of systems or "patterns", i.e. attributes that partially match the output of the parsers in `lib.systems.parse`. The "check meta" logic treats the systems strings as an exact whitelist just as before, but treats the patterns as a fuzzy whitelist, intersecting the actual `hostPlatform` with the pattern and then checking for equality. (This is done using `matchAttrs`). The default convenience lists for `meta.platforms` are now changed to be lists of patterns (usually a single pattern) in `lib/systems/for-meta.nix` for maximum flexibility under this new system. Fixes NixOS#30902
`packagePlatforms` now filters `supportedSystems` with the new-style `meta.platforms`, rather than just plopping it in as is.
Success on x86_64-darwin (full log) Attempted: nethack, stdenv The following builds were skipped because they don't evaluate on x86_64-darwin: ceph, dvdisaster, pharo, pond, robo3t Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: ceph, dvdisaster, nethack, pond, stdenv The following builds were skipped because they don't evaluate on aarch64-linux: pharo, robo3t Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: ceph, dvdisaster, nethack, pharo, pond, robo3t, stdenv Partial log (click to expand)
|
I need it in stdenv and release-lib, so that seems motivation enough.
…erns Instead of intersecting system strings, we filter with the sort of patterns used in `meta.platforms`. Indicating this change `forTheseSystems` has been renamed to `forMatchingSystems`, since the given list is now patterns to match, and not the systems themselves. [Just as with `meta.platforms`, systems strings are also supported for backwards compatibility.] This is more flexible, and makes the `forMatchingSystems` and packagePlatforms` cases more analogous.
fc8e67d
to
23ffdfd
Compare
Success on x86_64-darwin (full log) Attempted: libatomic_ops, nethack, stdenv The following builds were skipped because they don't evaluate on x86_64-darwin: ceph, dvdisaster, pharo, pond, robo3t Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: ceph, dvdisaster, libatomic_ops, nethack, pharo, pond, robo3t, stdenv Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: ceph, dvdisaster, libatomic_ops, nethack, pond, stdenv The following builds were skipped because they don't evaluate on aarch64-linux: pharo, robo3t Partial log (click to expand)
|
Otherwise obscure cross-compilations are hampered. `all` breaks all but the initial derivation (which we can't even write yet) in an open world setting however, so we really shouldn't have it. (cherry picked from commit 3c8ae01)
(cherry picked from commit d9a1800)
(cherry picked from commit e49c14c)
Since GHC is a cross compiler, it's perfectly possible to make haskell binaries on platforms without GHCs. `windows ++ unix` seems good enough for now. Also don't default `hydraPlatforms` to `platforms`. The former must be a list of systems (strings), but the latter is a list of systems or patterns. (cherry picked from commit 65e24f2)
(cherry picked from commit abf2760)
23ffdfd
to
ac3d9c3
Compare
This should be good. Please merge not rebase or squash as I carefully put many commits on the master and release-1803 last common commit so that they could be merged twice (the rest are cherry-picked with |
Success on x86_64-darwin (full log) Attempted: libatomic_ops, nethack, stdenv The following builds were skipped because they don't evaluate on x86_64-darwin: ceph, dvdisaster, pharo, pond, robo3t Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: ceph, dvdisaster, libatomic_ops, nethack, pharo, pond, robo3t, stdenv Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: ceph, dvdisaster, libatomic_ops, nethack, pond, stdenv The following builds were skipped because they don't evaluate on aarch64-linux: pharo, robo3t Partial log (click to expand)
|
#34645 (comment) this might be actually needed on 18.03 (as opposed to just nice) in order to disable some MUSL-only builds on hydra. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
It's basically no rebuild and so easy to revert. So I'll just go off @zimbatm's review for now? It's my understanding that post-release things are a bit more relaxed; hope I'm not wrong about that. |
Motivation for this change
@vcunat this is a version of #34444 and all dependent and fix-up PRs for 18.03. I based that chain off the common ancestor of
release-18.03
andmaster
so these are in fact the same commits (!), but we could of course do cherry-picks too per usual.There is 1 more commit needed to work around a uboot thing. That wasn't needed on
master
because @lopsided98 kindly including the proper solution in #36232 on staging, which was then recently merged back to master.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)