Commit graph

452 commits

Author SHA1 Message Date
Vladimír Čunát 81df035429 stdenv setup.sh: revert most of changes around #14907
I'm giving this up. Feel free to find some reasonable variant that works
at least on Linux and Darwin. Problems encountered:
- During bootstrap of Darwin stdenv `env -0` and some bash features
  don't work.
- Without `env -0` the contents of some multi-line phases is taken as
  variable declarations, which wouldn't typically matter, but the PR
  wanted to refuse bash-invalid names which would be occasionally
  triggered. This commit dowgrades that to a warning with explanation.
2016-05-12 04:53:37 +02:00
Vladimír Čunát 62fc8859c1 stdenv substituteAll: use yet another implementation
It turned out that process substitution fed into a while-cycle
isn't recognized during darwin bootstrap:
http://hydra.nixos.org/build/35382446/nixlog/1/raw

Also fix broken NIX_DEBUG output, noticed by abbradar.
2016-05-08 19:41:50 +02:00
Vladimír Čunát 9e0d0423fe stdenv substituteAll: use more robust code
The set/env fix in #14907 wasn't very good, so let's use a null-delimited
approach. Suggested by Aszlig.
In particular, this should fix a mass-breakage on Darwin, though I was
unable to test that.
2016-05-07 11:23:30 +02:00
Vladimír Čunát 1dc36904d8 Merge #14920: windows improvements, mainly mingw 2016-05-05 08:30:19 +02:00
Nikolay Amiantov 62616ec5e2 Merge commit 'refs/pull/14907/head' of git://github.com/NixOS/nixpkgs into staging 2016-04-25 18:02:47 +03:00
Nikolay Amiantov d4794c3630 stdenv: clarify how outputsToInstall is chosen
See https://github.com/NixOS/nixpkgs/pull/14694/files#r60013871
2016-04-25 13:24:39 +03:00
Nikolay Amiantov 5ff40ddedf add get* helper functions and mass-replace manual outputs search with them 2016-04-25 13:24:39 +03:00
Profpatsch a2d38bc7fc doc/stdenv.xml document substitution env variables
The filtering of environment variables that start with an uppercase
letter is documented in the manual.
2016-04-23 21:41:35 +02:00
Profpatsch 77fa336849 setup.hs: substitute uses only valid bash names
bash variable names may only contain alphanumeric ASCII-symbols and _,
and must not start with a number. Nix expression attribute names however
might contain nearly every character (in particular spaces and dashes).

Previously, a substitution that was not a valid bash name would be
expanded to an empty string. This commit introduce a check that throws
a (hopefully) helpful error when a wrong name is used in a substitution.
2016-04-23 17:54:32 +02:00
Vladimír Čunát 6e7787e666 stdenv for windows: auto-link dependency DLLs
For every *.{exe,dll} in $output/bin/ we try to find all (potential)
transitive dependencies and symlink those DLLs into $output/bin
so they are found on invocation.
(DLLs are first searched in the directory of the running exe file.)

The links are relative, so relocating whole /nix/store won't break them.
The hook is activated on cygwin and when cross-compiling to mingw.
2016-04-23 10:52:00 +02:00
Vladimír Čunát 710573ce6d Merge #12653: rework default outputs 2016-04-07 16:00:09 +02:00
Vladimír Čunát 2995439003 buildEnv: respect meta.outputsToInstall
As a result `systemPackages` now also respect it.
Only nix-env remains and that has a PR filed:
    https://github.com/NixOS/nix/pull/815
2016-04-07 15:59:44 +02:00
Vladimír Čunát 3342f717da stdenv: set meta.outputsToInstall unless overridden 2016-04-07 15:59:43 +02:00
Vladimír Čunát d1df28f8e5 Merge 'staging' into closure-size
This is mainly to get the update of bootstrap tools.
Otherwise there were mysterious segfaults:
https://github.com/NixOS/nixpkgs/pull/7701#issuecomment-203389817
2016-04-07 14:40:51 +02:00
Charles Strahan bde82098b8 stdenv: don't complain about configure script not existing
Close #14335.
Since 89036ef76a, when a package doesn't include a configure script,
the build complains with:

    grep: : No such file or directory
    grep: : No such file or directory

This prevents that.
2016-04-02 20:52:19 +02:00
Vladimír Čunát ab15a62c68 Merge branch 'master' into closure-size
Beware that stdenv doesn't build. It seems something more will be needed
than just resolution of merge conflicts.
2016-04-01 10:06:01 +02:00
Vladimír Čunát 09af15654f Merge master into closure-size
The kde-5 stuff still didn't merge well.
I hand-fixed what I saw, but there may be more problems.
2016-03-08 09:58:19 +01:00
Eelco Dolstra 2040a9ac57 stdenv-linux: Ensure binutils comes before bootstrapTools in $PATH
Otherwise, when building glibc and other packages, the "strip" from
bootstrapTools is used, which doesn't recognise some tags produced by
the newer "ld" from binutils.
2016-02-28 01:13:15 +01:00
Nikolay Amiantov 39609a0c94 stdenv: set SSL_CERT_FILE only if it isn't already 2016-02-25 13:53:29 +03:00
Eelco Dolstra d71a4851e8 Don't try to apply patchelf to non-ELF binaries 2016-02-18 22:54:11 +01:00
Vladimír Čunát 89036ef76a stdenv: accept wider range of $configureScript options
Fixes #12632.

I think it's better to quote this variable in general, because it is
common and even documented to pass space-separated commands in there.
The greps should just fail in that case and `if` won't proceed
which seems fine for such cases, and it's certainly better than
passing additional unintended parameters to grep
(which was happening all the time before).
2016-02-03 17:15:11 +01:00
Vladimír Čunát ae74c356d9 Merge recent 'staging' into closure-size
Let's get rid of those merge conflicts.
2016-02-03 16:57:19 +01:00
Eelco Dolstra 917ca8920d Move setting $SSL_CERT_FILE to stdenv
Doing it in an openssl setup hook only works if packages have openssl
as a build input - it doesn't work if they're using a program linked
against openssl.
2016-02-03 13:59:10 +01:00
Eelco Dolstra f4553d7219 defaultUnpack: Preserve timestamps when copying files
Commit 6d928ab684 changed this to not
preserve timestamps. However, that results in non-determinism; in
particular, it gives us a broken $SOURCE_DATE_EPOCH (especially for
everything using fetchFromGitHub). Builds affected by timestamps <
1980 should be fixed in some other way (e.g. changing the timestamp to
some fixed date > 1980).
2016-01-26 16:24:32 +01:00
Vladimír Čunát 716aac2519 Merge branch 'staging' into closure-size 2016-01-19 09:55:31 +01:00
Eelco Dolstra 81e530a749 Set SOURCE_DATE_EPOCH to latest source file
This provides a timestamp that's more useful than 1970-01-01 yet still
deterministic.
2016-01-05 17:21:48 +01:00
Eelco Dolstra f31fbadac3 Set a fallback default value for SOURCE_DATE_EPOCH
This is used by some build tools to provide reproducible builds. See

  https://reproducible-builds.org/specs/source-date-epoch/

for more info.

Later, we'll want to set this to a more intelligent value (such as the
most recent mtime of any source file).
2016-01-05 17:21:48 +01:00
Vladimír Čunát 1ebff73b88 stdenv/setup.sh: don't skip post-hooks (close #12032)
So far if no configure script is found or no makefile,
the rest of the phase is skipped, *including* post-hooks.
I find that behavior unexpected/unintuitive.

Earlier version of this patch had problems due to me assuming
that $configureScript is always a simple path, but that turned out
to be false in many cases, e.g. perl.
2016-01-05 09:34:02 +01:00
Luca Bruno 5b0352a6a4 Merge branch 'master' into closure-size 2015-12-11 18:31:00 +01:00
Domen Kožar 781b9eab61 allow{reason}: a bit more explicit error message 2015-12-09 17:01:46 +01:00
Vladimír Čunát 263fd55d4b Merge recent staging built on Hydra
http://hydra.nixos.org/eval/1231884
Only Darwin jobs seem to be queued now,
but we can't afford to wait for that single build slave.
2015-12-05 11:11:51 +01:00
Luca Bruno 920b1d3591 Merge branch 'master' into closure-size 2015-11-29 16:50:26 +01:00
Profpatsch ee07543ccd stdenv: licenseAllowed -> checkValidity
Rename and make it a true function (that can be re-used and could be
moved to the library).
2015-11-27 21:56:28 +01:00
Jude Taylor f5609a4d2a reintroduce impure host deps to all derivations 2015-11-21 15:51:48 -08:00
Jude Taylor 69e7f3bb74 switch to zero underscores for sandbox profiles; remove generateFrameworkProfile 2015-11-21 12:10:33 -08:00
Jude Taylor a63346e33c use single underscore for sandboxProfile 2015-11-21 11:17:30 -08:00
Vladimír Čunát 333d69a5f0 Merge staging into closure-size
The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
2015-11-20 14:32:58 +01:00
Jude Taylor df80090d09 use per-derivation sandbox profiles 2015-11-19 11:31:06 -08:00
Jude Taylor 914e9baefe start on sandbox stuff 2015-11-19 11:31:06 -08:00
Wout Mertens 774f74b875 Don't fail if env-vars cannot be written to
env-vars is a debugging aid, see
3e5dbb2433
for a rationale for this change.
2015-11-04 16:32:59 +01:00
Vladimír Čunát 5227fb1dd5 Merge commit staging+systemd into closure-size
Many non-conflict problems weren't (fully) resolved in this commit yet.
2015-10-03 13:33:37 +02:00
Eelco Dolstra 2a28bc6691 separateDebugInfo: Assert Linux
Also remove some unintended setting of separateDebugInfo.
2015-09-22 20:21:10 +02:00
Eelco Dolstra ec5b66eb4a Enable separate debug info
You can now pass

  separateDebugInfo = true;

to mkDerivation. This causes debug info to be separated from ELF
binaries and stored in the "debug" output. The advantage is that it
enables installing lean binaries, while still having the ability to
make sense of core dumps, etc.
2015-09-17 15:56:33 +02:00
Eelco Dolstra f15270833a Don't barf JSON at users in error messages 2015-08-27 15:32:45 +02:00
William A. Kennington III 4f22eadf2c Merge branch 'master.upstream' into staging.upstream 2015-08-19 20:52:17 -07:00
Peter Simons 81ce9be104 Revert "Move licenseAllowed check into the builder attribute (fixes #7541)"
This reverts commit 4d6452ba. The change affects Hydra in a way we didn't
expect: https://github.com/NixOS/nixpkgs/pull/9305#issuecomment-132791730.
2015-08-19 23:37:45 +02:00
William A. Kennington III 901482ad99 Merge branch 'master.upstream' into staging.upstream 2015-08-19 13:54:48 -07:00
Mathnerd314 4d6452bab9 Move licenseAllowed check into the builder attribute (fixes #7541) 2015-08-17 10:54:38 -06:00
Eelco Dolstra 32caa604e3 Force Nixpkgs rebuild
Gratuitous change to force Hydra to rebuild Nixpkgs after some
derivations had their references corrupted by a Hydra bug
(ff3f5eb4d8).
2015-08-03 20:03:11 +02:00
Jude Taylor cb3e282cda unique host deps, otherwise we get 600000 char derivations 2015-07-08 14:15:03 -07:00