about summary refs log tree commit diff
path: root/pkgs/build-support/buildenv
AgeCommit message (Collapse)AuthorFilesLines
2021-10-15lib: make extendDerivation lighter on evalpennae1-1/+1
the fix to extendDerivation in #140051 unwittingly worsened eval performance by quite a bit. set elements alone needed over 1GB extra after the change, which seems disproportionate to how small it was. if we flip the logic used to determine which outputs to install around and keep a "this one exactly" flag in the specific outputs instead of a "all of them" in the root we can avoid most of that cost.
2021-08-20buildenv: fix regression introduced by #134215Peter Ferenczy1-1/+1
2021-08-17buildEnv: better warning and error messagesPeter Ferenczy1-3/+35
2021-03-18trivial-builders: merge passAsFile with env in runCommand'sternenseemann1-1/+1
Previously it was awkward to use the runCommand-variants with passAsFile as a double definition of passAsFile would potentially break runCommand: passAsFile would overwrite the previous definition, defeating the purpose of setting it in runCommand in the first place. This is now fixed by concatenating the [ "buildCommand" ] list with one the one from env, if present. Adjust buildEnv where passAsFile = null; was passed in some cases, breaking evaluation since it'd evaluate to [ "buildCommand" ] ++ null.
2021-03-02buildEnv: Support `nativeBuildInputs` tooJohn Ericson1-3/+5
Since #112276, we should always put `makeWrapper` in `nativeBuildInputs`. But `buildEnv` was saying put it in `buildInputs`. That's wrong! Fix the instructions, and make the right thing possible.
2020-06-10buildenv: paths to link resolving to the same absolute path is not a conflictJosé Romildo Malaquias1-0/+9
When building an environment if two paths conflict but one or both are symbolic links and they resolve to the same real path, the conflict is discarded because the contents of both paths are the same. One of them is chosen and there is no need to recur into them in order to build deeper symbolic links.
2019-09-18buildEnv: check pathsToLink before checking collisionsLinus Heckemann1-1/+15
Fixes #32683
2019-02-22Merge #55420: buildEnv, substituteAll: disable binary cacheVladimír Čunát1-0/+1
... into staging.
2019-02-21buildEnv: improve file check to avoid false-positivesMaximilian Bosch2-4/+19
The original change in #55372 was supposed to fix the case where a store path which is a file should be placed into `buildEnv` which broke with a fairly misleading Perl error. Unfortunately this introduced a regression, `findFiles` can have targets that are files if the file isn't a store path. Rather than adding more obscure checks with probably further regressions, I figured that it's better to replicate the behavior of `lib.isStorePath` and explicitly check if the store path is a file and break in this case only. This should also fix recent staging issues.
2019-02-19buildEnv: break with a proper error if one path is actually a fileMaximilian Bosch1-0/+4
I noticed by creating `buildEnv` where I accidentally put a derivation from `pkgs.writeText` into `paths` and got a broken build with the following misleading error message: ``` Use of uninitialized value $stat1 in numeric ne (!=) at /nix/store/9g4wc31j7a2xp22xpgwr0qssfxahxdzl-builder.pl line 74. Use of uninitialized value $stat1 in bitwise and (&) at /nix/store/9g4wc31j7a2xp22xpgwr0qssfxahxdzl-builder.pl line 75. different permissions in `' and `/nix/store/0vy5ss91laxvwkyvrbld5hv27i88qk5w-noise': 0000 <-> 0444 at /nix/store/9g4wc31j7a2xp22xpgwr0qssfxahxdzl-builder.pl line 75. ``` It can be reproduced with an expression like this: ``` nix { pkgs ? import <nixpkgs> { } }: let file = pkgs.writeText "test" '' content ''; in pkgs.buildEnv { name = "test-env"; paths = [ /* ... */ file ]; } ```
2019-02-07buildEnv: allowSubstitutes = falsevolth1-0/+1
trivial derivation
2017-09-14Merge pull request #27780 from tilpner/overridable-buildenvFrederik Rietdijk1-2/+3
Make buildEnv overridable
2017-08-02buildenv: Make buildEnv overridabletilpner1-2/+3
callPackage already calls makeOverridable, but that just makes the function that evaluates to buildEnv overridable, not buildEnv itself. If no overridable version of buildEnv is used during construction, users can't override e.g. `paths` at all
2017-07-16buildenv: read propagated-user-env-packages line-by-lineThomas Tuegel1-4/+3
Since 3cb745d5a69018829ac15f7d5a508135f6bda123, the format of propagated-user-env-packages has changed and propagated packages have not been included by buildenv, including in the system environment. The buildenv builder is modified to read propagated-user-env-packages line-by-line, instead of expecting all packages on one line.
2017-04-14buildEnv: use buildPackages.perl so crossDrv worksEric Litak1-2/+2
2016-07-13buildEnv: build the whole tree of directories to pathsToLinkAlexey Shmalko1-2/+16
This patch fixes #16614 and #16741. The first issue was caused by the fact that both `/share` and `/share/fish/vendor_completions.d` end in the `pathsToLink`. The `pkgs/build-support/buildenv/builder.pl` creates `/share`, then links `/share/fish` under `/share` and then tries to create the directory `/share/fish/vendor_completions.d` and fails because it already exists. The simplest way to reproduce the issue is to build the next Nix expression: ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.fish pkgs.vim ]; pathsToLink = [ "/share" "/share/fish/vendor_completions.d" ]; } ``` The second issue is more critical and was caused by the fact findFiles doesn't recurse deep enough. It stops at first unique directory for the package (e.g., "/share" or even "/") and later the scripts decides it shouldn't link it as it doesn't match pathsToLink (e.g., "/share/fish"), so the result is empty. The test: ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.fish pkgs.vim ]; pathsToLink = [ "/share/fish/functions" ]; } ``` or ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.vim ]; pathsToLink = [ "/share" ]; } ```
2016-04-17buildEnv: fix #14682 evaluation in some edge casesVladimír Čunát1-2/+5
I supplied meta.outputsToInstall automatically in all mkDerivation products, but some packages still don't use it. The reported case: jekyll -> bundlerEnv -> buildEnv -> runCommand.
2016-04-07treewide: rename extraOutputs{ToLink,ToInstall}Vladimír Čunát1-2/+2
This is to get more consistent with `meta.outputsToInstall`.
2016-04-07buildEnv: respect meta.outputsToInstallVladimír Čunát1-1/+6
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-03-14Merge branch 'closure-size' into p/default-outputsVladimír Čunát2-10/+39
2016-02-03Merge recent 'staging' into closure-sizeVladimír Čunát2-10/+39
Let's get rid of those merge conflicts.
2016-01-28buildEnv: Pass the right number of args to addPkgaszlig1-1/+1
Regression introduced by 4529ed12590d7f814e40223437c7df4fea492e2d. I've missed this in #5096, not because of a messed up rebase as I have guessed from a comment on #12635 but missed this in the first place. The testing I did while working on the pull request weren't exhaustive enough to cover this, because I haven't tested with packages that use the propagatedUserEnvPkgs attribute. In order to make the test a bit more exhaustive this time, let's test it using: nix-build -E 'with import ./. {}; buildEnv { name = "testenv"; paths = [ pkgs.hello pkgs.binutils pkgs.libsoup pkgs.gnome3.yelp pkgs.gnome3.totem ]; }' And with this commit the errors no longer show up and the environment is built correctly. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Fixes: #12635
2016-01-28nixos systemPackages: rework default outputsVladimír Čunát1-1/+8
- Now `pkg.outputUnspecified = true` but this attribute is missing in every output, so we can recognize whether the user chose or not. If (s)he didn't choose, we put `pkg.bin or pkg.out or pkg` into `systemPackages`. - `outputsToLink` is replaced by `extraOutputsToLink`. We add extra outputs *regardless* of whether the user chose anything. It's mainly meant for outputs with docs and debug symbols. - Note that as a result, some libraries will disappear from system path.
2016-01-18buildEnv: Skip content check on ignoreCollisions.aszlig1-3/+3
Checking file contents is redundant in this case, because we will go ahead anyway, regardless of whether the content is the same. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-01-18buildEnv: Check the content of colliding paths.aszlig2-10/+39
Originally wanted to include ignoreCollisions in cups-progs, but I think it's better if we use ignoreCollisions only if there are _real_ collisions between files with different contents. Of course, we also check whether the file permissions match, so you get a collision if contents are the same but the permissions are different. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-12-11Merge branch 'master' into closure-sizeLuca Bruno1-1/+2
2015-12-01Fix system-path with multioutLuca Bruno1-7/+1
2015-11-29buildEnv: Allow setting meta attributesTuomas Tynkkynen1-1/+2
2015-10-30Fix buildenvWilliam A. Kennington III1-1/+1
2015-10-30Merge branch 'master.upstream' into staging.upstreamWilliam A. Kennington III1-9/+15
2015-10-30Add option to link additional package outputs into system.pathEelco Dolstra1-2/+8
This is necessary to get stuff like separate manpages, info files, debug symbols, etc.
2015-10-22buildenv: support very long `paths`Nikolay Amiantov2-7/+19
2015-09-17buildEnv: add new parameters: extraPrefix and buildInputsVladimír Čunát2-3/+10
2015-08-25buildEnv: Fix handling of empty list of packagesEelco Dolstra1-2/+4
2015-08-25buildEnv: Support package priorities like nix-envEelco Dolstra2-32/+48
This gets rid of a bunch of collision warnings.
2014-07-10buildEnv to support passthruFlorian Friesdorf1-1/+3
2012-07-25buildEnv: don't warn about collisions in propagated packagesEelco Dolstra1-2/+2
This mimicks buildenv in Nix more closely.
2012-04-26* Set preferLocalBuild on a few more trivial builders.Eelco Dolstra1-1/+3
svn path=/nixpkgs/trunk/; revision=33935
2010-11-03* buildEnv: use $SHELL (i.e. bash) rather than /bin/sh. This allowsEelco Dolstra2-11/+7
NixOS VM tests to be built on Ubuntu, where /bin/sh is dash rather than bash. svn path=/nixpkgs/trunk/; revision=24592
2010-08-09* Make sure that if pathsToLink contains an element such asEelco Dolstra1-1/+4
"/share/info" that it doesn't match "/share/information.nix". svn path=/nixpkgs/trunk/; revision=23059
2010-08-07* Ignore non-existant directories.Eelco Dolstra1-1/+1
svn path=/nixpkgs/trunk/; revision=23026
2010-07-08* Remove the call to update-mime-database, which doesn't belong hereEelco Dolstra1-6/+0
but in the postBuild hook. svn path=/nixpkgs/trunk/; revision=22527
2010-07-08* First figure out what symlinks need to be created, then createEelco Dolstra1-91/+67
them. This prevents unnecessary unlink operations to resolve collisions between directories. svn path=/nixpkgs/trunk/; revision=22526
2010-04-14Build MIME database from all available packagesYury G. Kudryashov1-0/+6
svn path=/nixpkgs/trunk/; revision=21076
2010-04-14Ignore fake collisionsYury G. Kudryashov1-5/+14
svn path=/nixpkgs/trunk/; revision=21075
2010-04-10Remove tabsYury G. Kudryashov1-2/+2
svn path=/nixpkgs/trunk/; revision=21004
2009-06-30revrting my accident only keeping rubygem updates and ruby libsMarc Weber1-13/+0
This partially reverts commit -r 16100 svn path=/nixpkgs/trunk/; revision=16107
2009-06-30adding rubygems support to nix - implemented target libraries/apps: sup mail ↵Marc Weber1-0/+13
client svn path=/nixpkgs/trunk/; revision=16100
2009-02-20* Support a post-install hook.Eelco Dolstra2-3/+9
svn path=/nixpkgs/trunk/; revision=14142
2007-05-28nixpkgs dir: nvidia and libsrvgWouter den Breejen1-0/+1
svn path=/nixpkgs/trunk/; revision=8785