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: Fix #30902 on 18.03 #37337

Merged
merged 22 commits into from
Apr 6, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Mar 18, 2018

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 and master 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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

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.
@Ericson2314 Ericson2314 changed the title Meta check 18.03 #34444 for 18.03 Mar 18, 2018
@Ericson2314 Ericson2314 changed the title #34444 for 18.03 lib: Fix #30902 on 18.03 Mar 18, 2018
@GrahamcOfBorg
Copy link

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)

these paths will be fetched (1.33 MiB download, 3.83 MiB unpacked):
  /nix/store/3yy6nwdm130491ns086ivz7nd1k62c0d-less-530
  /nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0
copying path '/nix/store/3yy6nwdm130491ns086ivz7nd1k62c0d-less-530' from 'https://cache.nixos.org'...
copying path '/nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0' from 'https://cache.nixos.org'...
/nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0
/nix/store/0igxxngigjgfkgg3cw547n92b8bpg6b1-stdenv-darwin

@GrahamcOfBorg
Copy link

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)

 static Agraph_t *G;  /* Current graph */
                  ^
  CCLD     graphml2gv
false -Tps -man ./gc.1 | false - - >gc.1.pdf
building of '/nix/store/px90qwn2x193y5lbhwq8czv123ddi704-graphviz-2.40.1.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/g50jmrf6bgl2y6c3lmwa80vqrbvcyvy9-vala-0.38.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vm3m663racqvpkvs8q6zap43qgg5knh2-dconf-0.26.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vj6g7lnyplz09g59vp70ifp7yhq9a5np-hook.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/mrp84wcscdys85r2l9c3a4l5m6pc02j1-pond-20150830-bce6e0d.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/gkybydx8n4686p5lz56yq7wf5bfcpjim-ceph-12.2.2.drv', '/nix/store/mrp84wcscdys85r2l9c3a4l5m6pc02j1-pond-20150830-bce6e0d.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ceph, dvdisaster, nethack, pharo, pond, robo3t, stdenv

Partial log (click to expand)

no configure script, doing nothing
building
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ir1ldfznzf6q54py3p8c2bqbfbfzzcdp-pharo
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/ir1ldfznzf6q54py3p8c2bqbfbfzzcdp-pharo/bin
patching script interpreter paths in /nix/store/ir1ldfznzf6q54py3p8c2bqbfbfzzcdp-pharo
/nix/store/ir1ldfznzf6q54py3p8c2bqbfbfzzcdp-pharo/bin/pharo: interpreter directive changed from "/bin/sh" to "/nix/store/q1g0rl8zfmz7r371fp5p42p4acmv297d-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/ir1ldfznzf6q54py3p8c2bqbfbfzzcdp-pharo...

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.
@GrahamcOfBorg GrahamcOfBorg added 6.topic: haskell and removed 6.topic: vim 6.topic: xfce The Xfce Desktop Environment 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 23, 2018
@GrahamcOfBorg GrahamcOfBorg removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 23, 2018
@GrahamcOfBorg
Copy link

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)



these paths will be fetched (1.30 MiB download, 4.27 MiB unpacked):
  /nix/store/lkr75zqx0yjmaskmf1pxfmc4g84fy02q-libatomic_ops-7.6.2
  /nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0
copying path '/nix/store/lkr75zqx0yjmaskmf1pxfmc4g84fy02q-libatomic_ops-7.6.2' from 'https://cache.nixos.org'...
copying path '/nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0' from 'https://cache.nixos.org'...
/nix/store/lkr75zqx0yjmaskmf1pxfmc4g84fy02q-libatomic_ops-7.6.2
/nix/store/z1v51i8zviwij91nfgrn86103nbs8ik2-nethack-3.6.0
/nix/store/0igxxngigjgfkgg3cw547n92b8bpg6b1-stdenv-darwin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ceph, dvdisaster, libatomic_ops, nethack, pharo, pond, robo3t, stdenv

Partial log (click to expand)

-
-

1
3
4
2
k


@GrahamcOfBorg
Copy link

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)

   Compiling backtrace v0.3.4
   Compiling rustc_const_math v0.0.0 (file:///build/rustc-1.24.0-src/src/librustc_const_math)
   Compiling proc_macro v0.0.0 (file:///build/rustc-1.24.0-src/src/libproc_macro)
   Compiling syntax_ext v0.0.0 (file:///build/rustc-1.24.0-src/src/libsyntax_ext)
building of '/nix/store/5yigr43p3jm8vafrdn36gzhlkf1gn2l2-rustc-1.24.0.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/scl65cigwb900awwbg3sm34vdwldzcr3-cargo-0.24.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s1b9jd53gvc7l9vlrkrpwafapj2xdh7i-librsvg-2.42.2.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/n03h18pkl4x1rsjr7sh96arwbaiyglkx-hook.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/p31i978kjiwlzpybykh6m2pfds9v2c8a-pond-20150830-bce6e0d.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/p31i978kjiwlzpybykh6m2pfds9v2c8a-pond-20150830-bce6e0d.drv', '/nix/store/x3hygd84c9fcdv2vxm1956yh4ia45vg2-ceph-12.2.2.drv' failed

Ericson2314 and others added 6 commits April 4, 2018 15:27
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)
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)
@Ericson2314
Copy link
Member Author

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 set -x).

@GrahamcOfBorg
Copy link

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)

copying path '/nix/store/phyxz4bwwfvwm2pcbsz0f3zqslskpc3b-nethack-3.6.0' from 'https://cache.nixos.org'...
copying path '/nix/store/qzbvvjrkbcqczzdqdr2d7ljzk07cmd9f-cctools-binutils-darwin' from 'https://cache.nixos.org'...
copying path '/nix/store/wxylzk7s2wk0ggldclcsp4b7dm018lj9-cctools-binutils-darwin-wrapper' from 'https://cache.nixos.org'...
copying path '/nix/store/37kz84yvl7mc4hi7ys7wfcsd2brrdhg1-llvm-5.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/2vk76kbkb0n1fqwwnppml0qb98j13h1k-clang-5.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/hdbr6240s17l7slgljd5n0ylpl0kjb4s-clang-wrapper-5.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/7fnmwp4j7w47hyc1is140mfpminkpdql-stdenv-darwin' from 'https://cache.nixos.org'...
/nix/store/877d5gk4mzgw8q22nzwx40g502f5ri5b-libatomic_ops-7.6.2
/nix/store/phyxz4bwwfvwm2pcbsz0f3zqslskpc3b-nethack-3.6.0
/nix/store/7fnmwp4j7w47hyc1is140mfpminkpdql-stdenv-darwin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ceph, dvdisaster, libatomic_ops, nethack, pharo, pond, robo3t, stdenv

Partial log (click to expand)

no configure script, doing nothing
building
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/rylfpzclfzs6kc4nbyngq12fhbb565v3-pharo
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/rylfpzclfzs6kc4nbyngq12fhbb565v3-pharo/bin
patching script interpreter paths in /nix/store/rylfpzclfzs6kc4nbyngq12fhbb565v3-pharo
/nix/store/rylfpzclfzs6kc4nbyngq12fhbb565v3-pharo/bin/pharo: interpreter directive changed from "/bin/sh" to "/nix/store/zqh3l3lyw32q1ayb15bnvg9f24j5v2p0-bash-4.4-p12/bin/sh"
checking for references to /tmp/nix-build-pharo.drv-0 in /nix/store/rylfpzclfzs6kc4nbyngq12fhbb565v3-pharo...

@GrahamcOfBorg
Copy link

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)

SKIP [1] cherrypy/test/test_static.py:192: Windows only
SKIP [1] /build/CherryPy-14.0.0/cherrypy/test/helper.py:330: memcached not reachable
SKIP [1] /build/CherryPy-14.0.0/cherrypy/test/test_static.py:31: File system encoding (ANSI_X3.4-1968) cannot support unicode filenames
SKIP [1] /build/CherryPy-14.0.0/cherrypy/test/helper.py:330: skipped (not running HTTPS)...
SKIP [2] /build/CherryPy-14.0.0/cherrypy/test/helper.py:330: skipped (Python 3 only)
======== 285 passed, 6 skipped, 1 xfailed, 4 xpassed in 173.50 seconds =========
building '/nix/store/s0hjivjcmi5g2mr2q8j4yh9y57fsry2r-python-2.7.14-env.drv'...
created 906 symlinks in user environment
cannot build derivation '/nix/store/a2yjl5n01jdp1zk5q6k0gbn04syzkv7d-ceph-12.2.2.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/a2yjl5n01jdp1zk5q6k0gbn04syzkv7d-ceph-12.2.2.drv', '/nix/store/xjvg06kri5zwxsijs4zi4ncbk5k4dfa6-pond-20150830-bce6e0d.drv' failed

@Ericson2314
Copy link
Member Author

#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.

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

nice work!

@peti peti removed their request for review April 6, 2018 16:40
@Ericson2314
Copy link
Member Author

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.

@Ericson2314 Ericson2314 merged commit 7060c52 into NixOS:release-18.03 Apr 6, 2018
@Ericson2314 Ericson2314 deleted the meta-check-18.03 branch April 6, 2018 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: haskell 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: qt/kde 8.has: clean-up 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants