about summary refs log tree commit diff
path: root/pkgs/stdenv/generic
Commit message (Collapse)AuthorAge
* stdenv: shorten evaluation errors when in HydraGraham Christensen2018-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hydra's page showing evaluation errors is about a mile long, showing buckets of user-friendly errors, like this: in job ‘seyren.aarch64-linux’: Package ‘oraclejre-8u191’ in /nix/store/fa9zzkbljkvdavwzirkrr5irg25ymbjl-source/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix:71 has an unfree license (‘unfree’), refusing to evaluate. a) For `nixos-rebuild` you can set { nixpkgs.config.allowUnfree = true; } in configuration.nix to override this. b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add { allowUnfree = true; } to ~/.config/nixpkgs/config.nix. in job ‘jetbrains.webstorm.x86_64-linux’: Package ‘webstorm-2018.3.1’ in /nix/store/fa9zzkbljkvdavwzirkrr5irg25ymbjl-source/pkgs/applications/editors/jetbrains/default.nix:230 has an unfree license (‘unfree’), refusing to evaluate. a) For `nixos-rebuild` you can set { nixpkgs.config.allowUnfree = true; } in configuration.nix to override this. b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add { allowUnfree = true; } to ~/.config/nixpkgs/config.nix. This makes it extremely hard to find actual issues in the output. This patch set makes the output much more condensed in Hydra: Failed to evaluate nifticlib-2.0.0: «unsupported»: is not supported on ‘x86_64-apple-darwin’ Failed to evaluate dmd-2.081.2: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’ Failed to evaluate dmdBuild-2.081.2: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’ Failed to evaluate ldc-1.11.0: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’ Failed to evaluate ldcBuild-1.11.0: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’ Failed to evaluate ldc-0.17.5: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’ Failed to evaluate ldcBuild-0.17.5: «unsupported»: is not supported on ‘aarch64-unknown-linux-gnu’
* Merge remote-tracking branch 'upstream/master' into stagingJan Tojnar2018-11-30
|\
| * make-derivation: remove selfConsistent checkMatthew Bauer2018-11-30
| | | | | | | | | | | | version is set in lots of places but might not need to be in a name. Alternative to #50364.
| * Merge master into staging-nextFrederik Rietdijk2018-11-30
| |\
| | * pkgs/stdenv/generic/make-derivation.nix: s/targetPlatform/hostPlatform/Vaibhav Sagar2018-11-29
| | |
* | | Merge pull request #51183 from matthewbauer/make-derivation-no-assertionsMatthew Bauer2018-11-29
|\ \ \ | |/ / |/| | Fix breaking changes to make-derivation
| * | make-derivation: don’t add host suffix if there is no c compilerMatthew Bauer2018-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some trivial builders use the name attr to choose the exec name produced. For example nixos-install, nixos-install = makeProg { name = "nixos-install"; src = ./nixos-install.sh; nix = config.nix.package.out; path = makeBinPath [ nixos-enter ]; }; When cross compiling, this puts the prog in, /bin/nixos-install-powerpc64le-unknown-linux-gnu
| * | make-derivation: don’t assert on separateDebugInfoMatthew Bauer2018-11-28
| | | | | | | | | | | | | | | | | | When separateDebugInfo = true & !stdenv.hostPlatform.isLinux, we always gave an error. There is no reason to do this. Instead, just don’t add separate debug info when we aren’t on Linux.
| * | make-derivation: remove selfConsistent checkMatthew Bauer2018-11-28
| | | | | | | | | | | | | | | | | | version is set in lots of places but might not need to be in a name. Alternative to #50364.
* | | Merge branch 'master' into staging-nextVladimír Čunát2018-11-26
|\ \ \ | |/ / |/| / | |/
| * Revert "make-derivation: add disallowedReferences in strictDeps"Matthew Bauer2018-11-25
| | | | | | | | | | | | | | This reverts commit 8dbfb61e4617050917ce6bb7c5f4efc902c2a36c. Also reverts commit fc99c337edd29d9596379667063bc3a8f3cea5b3. Fixes #50915
* | Merge master into staging-nextFrederik Rietdijk2018-11-22
|\|
| * make-derivation: don’t disallow propagated native inputsMatthew Bauer2018-11-21
| | | | | | | | | | | | | | | | propagateNativeBuildInputs will end up going in the output derivation. This case is allowed to end up in references because of that. Sorry for the disruption! Fixes #50865
* | Revert "patch-shebangs: use --build for auto patch shebangs"Daiderd Jordan2018-11-14
| | | | | | | | | | | | | | Completely breaks darwin. Every package in the stdenv that has shebangs in the output will end up with references to bootstrap-tools. This reverts commit eb7c50a993833ecdb94cc3affb55ac4c560edf50.
* | Merge pull request #35304 from volth/patch-97Matthew Bauer2018-11-12
|\ \ | | | | | | [staging] substitute() print warning if does nothing
| * | substituteStream(): print warning if nothing donevolth2018-07-10
| | |
* | | Merge staging-next into stagingFrederik Rietdijk2018-11-12
|\ \ \ | | |/ | |/|
| * | Merge master into staging-nextFrederik Rietdijk2018-11-12
| |\ \
| | * | meta.tests: rename into passthru.testsLéo Gaspard2018-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Nix currently rejects derivations in `meta` values. This works around that limitation by using `passthru` instead. Closes https://github.com/NixOS/nixpkgs/issues/50230
| | * | meta.tests: drop `meta.needsVMSupport`Léo Gaspard2018-11-11
| | | | | | | | | | | | | | | | Its job is already handled by `requiredSystemFeatures`
| | * | tests: split into a separate `all-tests.nix` fileLéo Gaspard2018-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make the list much easier to re-use, eg. for `nixosTests` The drawback is that this approaches makes the ``` nix-build release.nix -A tests.opensmtpd.x86_64-linux ``` command about twice as slow (3s to 6s): it now has to evaluate `nixpkgs` once for each architecture, instead of just having the hardcoded list of tests that allowed to say “ok just evaluate for x86_64-linux”. On the other hand, complete evaluation of `release.nix` should be much faster because we no longer import `nixpkgs` for each test: testing with the following command went from 30s to 18s, and that's just for a few tests. ``` time nix-instantiate --eval --strict nixos/release.nix -A tests.nat ``` I initially wanted to test on the whole `release.nix`, but there are too many broken tests and it takes too long to eval them all, especially compared to the fact that the current implementation breaks some setup. Given developers can just `nix-build nixos/tests/my-test.nix`, it sounds like an overall win.
* | | | Merge staging-next into stagingFrederik Rietdijk2018-11-11
|\| | |
| * | | Merge master into staging-nextFrederik Rietdijk2018-11-10
| |\| |
| | * | make-derivation: enable pie hardening with muslMatthew Bauer2018-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #49071 On ld.gold, we produce broken executables when linking with the Musl libc. This appears to be a known bug when using ld.gold and Musl. This thread describes the workaround as enabling PIE when using ld.gold and Musl: https://www.openwall.com/lists/musl/2015/05/01/5 By default we don’t enable PIE to avoid breaking things. But in the Musl case we are breaking things by not enabling PIE. So this adds a special case for defaultHardeningFlags which keeps the pie hardening for everything. Any packages that break with PIE can add the pie flag to disableHardeningFlags array (a no-op for now on anything but Musl).
| | * | dovecot, opensmtpd: add link to test in `meta.tests`Léo Gaspard2018-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale --------- Currently, tests are hard to discover. For instance, someone updating `dovecot` might not notice that the interaction of `dovecot` with `opensmtpd` is handled in the `opensmtpd.nix` test. And even for someone updating `opensmtpd`, it requires manual work to go check in `nixos/tests` whether there is actually a test, especially given not so many packages in `nixpkgs` have tests and this is thus most of the time useless. Finally, for the reviewer, it is much easier to check that the “Tested via one or more NixOS test(s)” has been checked if the file modified already includes the list of relevant tests. Implementation -------------- Currently, this commit only adds the metadata in the package. Each element of the `meta.tests` attribute is a derivation that, when it builds successfully, means the test has passed (ie. following the same convention as NixOS tests). Future Work ----------- In the future, the tools could be made aware of this `meta.tests` attribute, and for instance a `--with-tests` could be added to `nix-build` so that it also builds all the tests. Or a `--without-tests` to build without all the tests. @Profpatsch described in his NixCon talk such systems. Another thing that would help in the future would be the possibility to reasonably easily have cross-derivation nix tests without the whole NixOS VM stack. @7c6f434c already proposed such a system. This RFC currently handles none of these concerns. Only the addition of `meta.tests` as metadata to be used by maintainers to remember to run relevant tests.
* | | | Merge pull request #49608 from matthewbauer/cross-patch-shebangs-2Matthew Bauer2018-11-07
|\ \ \ \ | | | | | | | | | | Restore cross-patch-shebangs branch
| * | | | patch-shebangs: use --build for auto patch shebangsMatthew Bauer2018-11-02
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | In strictDeps=false, autoPatchshebangs should use --build (corresponding to PATH) to lookup commands. This restores the previous behavior of patchshebangs so that we don’t break stuff that isn’t careful in the buildInputs vs. nativeBuildInputs distinction. Unfortunately this won’t work under cross compilation.
* | | | make-derivation: use pname-version as default name if both are presentPatrick Hilhorst2018-11-06
| |/ / |/| |
* | | Merge master into staging-nextFrederik Rietdijk2018-11-04
|\ \ \
| * | | Revert "Merge pull request #49398 from Synthetica9/implement-rfc0035" to fix ↵Frederik Rietdijk2018-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eval This reverts commit 3fc7d5eb83804e10ae55b1ae9b102f88b1ea2b08, reversing changes made to 1fddf2b68996b56804a24b67191e4d883943057d. The idea is good, however, before enforcing, make sure all occurences are fixed.
* | | | Merge master into staging-nextFrederik Rietdijk2018-11-04
|\| | |
| * | | make-derivation: use a more descriptive assert messagePatrick Hilhorst2018-10-30
| | | | | | | | | | | | | | | | As suggested by @Profpatsch
| * | | make-derivation: use `lib.assertMsg`Patrick Hilhorst2018-10-29
| | | | | | | | | | | | | | | | As suggested by @Profpatsch
| * | | make-derivation: use `?` instead of `builtins.hasAttr`Patrick Hilhorst2018-10-29
| | | | | | | | | | | | | | | | As suggested by @edolstra
| * | | make-derivation: add check that the name is consistent with pname and versionPatrick Hilhorst2018-10-29
| | | |
| * | | make-derivation: get position info from versionPatrick Hilhorst2018-10-29
| | | |
| * | | make-derivation: use pname-version as default name if both are presentPatrick Hilhorst2018-10-29
| |/ /
* / / make-derivation: add disallowedReferences in strictDepsMatthew Bauer2018-11-02
|/ / | | | | | | | | | | | | | | When strictDeps = true, we don’t want native build inputs to end up in the output. For instance gcc is a builtin native build input and should only show up in an output if it is also listed in buildInputs. /cc @ericson2314
* | make-derivation: set CMAKE_SYSTEM_* when cross compilingMatthew Bauer2018-10-16
| | | | | | | | | | | | | | | | | | | | | | Uses uname data to find what to set these variables: - CMAKE_SYSTEM_NAME - CMAKE_SYSTEM_PROCESSOR - CMAKE_SYSTEM_VERSION - CMAKE_HOST_SYSTEM_NAME - CMAKE_HOST_SYSTEM_PROCESSOR - CMAKE_HOST_SYSTEM_VERSION
* | Merge pull request #47230 from bhipple/fix/licensesMatthew Bauer2018-10-05
|\ \ | | | | | | Remove dead code from stdenv check-meta license logic
| * | Remove dead code from stdenv check-meta license logicBenjamin Hipple2018-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `unfree` and `unfreeRedistributable` licenses both have `free = false`, which will trigger the first portion of logic. This removes dead code to simplify the logic. As a follow-up, I plan to add an attribute `redistributable = [true|false]`, which can be used by Hydra to determine whether a given package with a given license can be included in the channel.
* | | stdenv: Improve ELF detection for isELFaszlig2018-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isELF function only checks whether ELF is contained within the first 4 bytes of the file, which is a bit fuzzy and will also return successful if it's a text file starting with ELF, for example: ELF headers ----------- Some text here about ELF headers... So instead, we're now doing a precise match on \x7fELF. Signed-off-by: aszlig <aszlig@nix.build> Acked-by: @Ericson2314 Closes: https://github.com/NixOS/nixpkgs/pull/47244
* | | Merge remote-tracking branch 'upstream/master' into stagingJohn Ericson2018-09-18
|\| |
| * | Merge pull request #46857 from obsidiansystems/darwin-to-linux-prepJohn Ericson2018-09-18
| |\ \ | | | | | | | | misc pkgs: various cross fixes in preparation for darwin->linux
| | * | mkDerivation: Make `separateDebugInfo` assertion lazier to match other ↵John Ericson2018-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | assertions This is needed to access attributes of derivations on platforms where they cannot be built.
| * | | stdenv: Validate meta.outputsToInstallGraham Christensen2018-09-18
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If meta.outputsToInstall is set to include absent outputs, various tools break including channel updates and nix-env. grahamc@Morbo> nix-env -i -f . -A elf-header-real installing 'elf-header' error: this derivation has bad 'meta.outputsToInstall' This patch verifies each value in meta.outputsToInstall is a valid output. It validates this condition only if checkMeta is true. grahamc@Morbo> nix-build . -A elf-header-real error: Package ‘elf-header’ in /home/grahamc/projects/nixpkgs/pkgs/development/libraries/elf-header/default.nix:36 has invalid meta.outputsToInstall, refusing to evaluate. The package elf-header has set meta.outputsToInstall to: bin however elf-header only has the outputs: out and is missing the following ouputs: - bin (use '--show-trace' to show detailed location information) Note, now the nix-env experience is decidedly worse for users who have checkMeta set to true: grahamc@Morbo> nix-env -i -f . -A elf-header-real; echo $? 0 though since this is already an issue for unfree, broken, unsupported, and insecure validity problems I'm not sure we should do something different here.
* | | stdenv: fix HOST_PATH changeMatthew Bauer2018-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a4630c65caf was incorrect in assuming $SHELL would be a path to the bash derivation. In fact $SHELL will be a path to the bash executable. Unfortunately this did not fix the original issue. So instead, we just have to reuse initialPath can be added like PATH is. Sorry for the inconvenience! I hadn’t thought through the effects of the last commit. /cc @copumpkin @ericson2314
* | | stdenv: add shell to HOST_PATH for backwards compatibilityMatthew Bauer2018-09-16
| | | | | | | | | | | | | | | | | | | | | | | | To avoid breaking things, we need to make sure SHELL goes into HOST_PATH. This reflects my changes to patch-shebangs to make it cross compilation ready. When a script is patched from the Nix store it now looks to HOST_PATH to get the targeted machine’s executables. Unfortunately, this only works in native builds.
* | | Merge branch 'master' into stagingJan Malakhovski2018-09-08
|\| |
| * | top-level, stdenv: Make `system` and `stdenv.system` describe the hostPlatform.John Ericson2018-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intuitively, one cares mainly about the host platform: Platforms differ in meaningful ways but compilation is morally a pure process and probably doesn't care, or those difference are already abstracted away. @Dezgeg also empirically confirmed that > 95% of checks are indeed of the host platform. Yet these attributes in the old cross infrastructure were defined to be the build platform, for expediency. And this was never before changed. (For native builds build and host coincide, so it isn't clear what the intention was.) Fixing this doesn't affect native builds, since again they coincide. It also doesn't affect cross builds of anything in Nixpkgs, as these are no longer used. It could affect external cross builds, but I deem that unlikely as anyone thinking about cross would use more explicit attributes for clarity, all the more so because the rarity of inspecting the build platform.