summary refs log tree commit diff
path: root/pkgs/stdenv/generic/setup.sh
Commit message (Collapse)AuthorAge
* Merge pull request #108102 from matthewbauer/bash-version-checkSandro2021-06-24
|\ | | | | stdenv/setup.sh: Add version check to setup script
| * stdenv/setup.sh: Add version check to setup scriptMatthew Bauer2021-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only bash 4+ works in setup.sh. To make sure this is obvious, we can check BASH_VERSINFO to get the major version number of Bash. While Bash 3 is pretty rare, it still comes stock in macOS. We *could* provide a warning here for non-Bash shells, but it’s not always clear whether they will work or not. Zsh should have no trouble while busybox sh, fish, or any others. There’s no great way to detect what feature set the shell supports. Fixes #71625
* | stdenv: ignore duplicates in addToSearchPath (#113800)Vincenzo Mantova2021-03-13
| |
* | stdenv: mute errors when failing to write env-varstv2021-01-05
|/
* setup.sh: export XDG_DATA_DIRS for consistencyRobert Hensing2020-11-25
| | | | | | By exporting it, we always make the new directories available to subprocesses, regardless of whether the environment variable existed before `nix-shell` was invoked.
* setup.sh: Only load XDG_DATA_DIRS for executable inputsRobert Hensing2020-11-25
| | | | | | | | | | This avoids the scenario where strictDeps is off and cross-compiled XDG_DATA_DIRS content is brought into the environment. While probably harmless for data like manpages and completion scripts, this would cause issues when XDG_DATA_DIRS is used to find executables or plugins. The Qt framework is known to behave like this and might have run into incompatibilities.
* setup.sh: Support XDG_DATA_DIRSRobert Hensing2020-11-25
| | | | | | | | | | | | | XDG_DATA_DIRS is to /share as PATH is to /bin. It was defined as part of the XDG basedir specification. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html While it originated from the X Desktop Group, it is not limited to the X11 ecosystem, as evidenced by its use in bash-completion. The removal of ` && -d "$pkg/bin"` is ok, because this optimization is already performed by `addToSearchPath`.
* stdenv: Fix error message when checkPhase is missingJoachim Breitner2020-11-07
|
* stdenv: set SOURCE_DATE_EPOCH to a value python supportsJörg Thalheim2020-06-08
| | | | | in nix-shell this value breaks the build because python's packaging refuses to build timestamps that date before 1980.
* setup.sh: add dontPatchworldofpeace2020-04-12
| | | | Fixes #85038
* generic/setup.sh: allow clobbering env-vars fileMatthew Bauer2020-04-09
| | | | | | | | | | If the option ‘noclobber’ is set in Bash, we get an error when we clobber an already existing env-vars. This is an okay error to ignore, so just >| instead. Note that >| is NOT a Bashism[[1]]. Fixes #79651 [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_02
* setup.sh: rewrite stripHashLily Ballard2019-11-12
| | | | | | | | Rewrite the `stripHash` helper function with 2 differences: * Paths starting with `--` will no longer produce an error. * Use Bash string manipulation instead of shelling out to `grep` and `cut`. This should be faster.
* stdenv: Don't unset propagated*DepFiles before main phasesJohn Ericson2019-11-05
| | | | | | | | | A bunch of stdenv-internal variables were deleted in 1601a7fcce389ae3f1b1b36676fd5545035566af, but these are needed in the fixup phase, whereas the rest are just needed for the initial work (findInputs, etc) before the user phases. CC @matthewbauer
* Merge pull request #69603 from matthewbauer/unset-unused-setup-varMatthew Bauer2019-11-05
|\ | | | | Unset unused variables in setup.sh
| * generic/setup.sh: Unset locally defined variablesMatthew Bauer2019-09-26
| | | | | | | | | | | | setup.sh adds a bunch of variables that only it needs. To avoid polluting environments, we should unset these as soon as we are done with them.
* | stdenv: Don't stop `set -u`-ingJohn Ericson2019-11-01
| | | | | | | | | | | | Before, we very carefully unapplied and reapplied `set -u` so the rest of Nixpkgs could continue to not fail on undefined variables. Let's rip off the band-aid.
* | Merge pull request #69028 from matthewbauer/remove-iselfexec-iselfdynMatthew Bauer2019-09-20
|\ \ | | | | | | Revert "setup.sh introduce isELFExec, isELFDyn"
| * | Revert "setup.sh introduce isELFExec, isELFDyn"Matthew Bauer2019-09-18
| |/ | | | | | | | | | | | | This reverts commit e1b80a5a99a3013c6556ec2e2e73ef6ca8e8b80b. This is broken in PIE (#68513). Best to not keep it in until something else starts using it.
* | setup.sh: avoid subshells: iterating a fileAlbert Safin2019-09-20
| |
* | setup.sh: avoid subshells: type -t in _callImplicitHookAlbert Safin2019-09-20
| |
* | setup.sh: avoid subshells: mapOffsetAlbert Safin2019-09-20
| |
* | setup.sh: avoid subshells: type -tAlbert Safin2019-09-20
| |
* | setup.sh: avoid subshells: shopt -po nounsetAlbert Safin2019-09-19
|/
* setup.sh introduce isELFExec, isELFDynFlorian Klink2019-08-17
| | | | | | | | These can be used to determine whether a ELF file with ELF header is an executable or shared library. We can't implement it in pure bash, as bash has problems with null bytes.
* setup.sh: add dontUnpackworldofpeace2019-07-01
|
* setup.sh: add dontConfigureworldofpeace2019-07-01
| | | | | There's already 21 occurences of this and I've expected this to exist without knowing it had no affect for a while.
* stdenv: also override cert files in pure nix-shellVladimír Čunát2019-05-09
| | | | | | | | That's very much consistent with the spirit of nix-shell --pure BTW, nix 1.x shells will be always treated as pure; in that version detection isn't possible. https://github.com/NixOS/nix/commit/1bffd83e1a9c
* stdenv, cacert: consider $NIX_SSL_CERT_FILE in hooksVladimír Čunát2019-05-09
| | | | | | Some SSL libs don't react to $SSL_CERT_FILE. That actually makes sense to me, as we add this behavior as nixpkgs-specific, so it seems "safer" to use $NIX_*.
* setup.sh: make sure initialPath goes at end of HOST_PATHMatthew Bauer2019-04-26
| | | | | | | We want initialPath to have lowest precedence. In addition, unset _PATH and _HOST_PATH as they shouldn’t be needed after final PATH and HOST_PATH are set.
* Merge pull request #49552 from matthewbauer/setup-dedupeMatthew Bauer2019-01-27
|\ | | | | setup.sh: avoid running the same hook twice
| * setup.sh: avoid running the same hook twiceMatthew Bauer2019-01-27
| | | | | | | | | | | | | | In strictDeps=false, we don’t want the same package hook to be run twice, otherwise we get duplicates in some flags. Fixes #41340
* | setup.sh: put SHELL in flagsArrayMatthew Bauer2019-01-26
| | | | | | | | | | | | | | We don’t want to modify makeFlags, that is given to us by our environment. Adding to it could lead to duplicates after repeated use. Fixes #27533
* | treewide: remove paxutils from stdenvJörg Thalheim2018-12-22
| | | | | | | | | | | | | | More then one year ago we removed grsecurity kernels from nixpkgs: https://github.com/NixOS/nixpkgs/pull/25277 This removes now also paxutils from stdenv.
* | 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
| | |
* | | 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.
* | 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
* | 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.
* | stdenv: implement enableParallelChecking optionJan Malakhovski2018-09-05
| | | | | | | | | | | | Works similarly to `enableParallelBuilding`, but is set by default when `enableParallelBuilding` is set. In my experience most packages that build fine in parallel also check fine in parallel.
* | stdenv/build-support: support .tbz and .txz tarballsJames Deikun2018-07-30
| |
* | setup.sh: add HOST_PATHMatthew Bauer2018-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HOST_PATH contains the path of the host package. This will include the packages listed in buildInputs & depsHostHost. Use this to find runtime commands that the host needs. For instance to find the runtime version of perl, $ PATH="$HOST_PATH" command -v perl /nix/store/...-perl-5.28.0-aarch64-unknown-linux-android/bin/perl This path should not be executed directly (it will break for cross compilation). Only use it to find the location of executables that will be run by your host system. Your build tools will, as always, be available on the default PATH.
* | Merge pull request #43224 from volth/patch-179Matthew Bauer2018-07-21
|\ \ | |/ |/| [staging] substitute(): --subst-var was silently coercing to "" if the variable does not exist.
| * substitute(): --subst-var was silently coercing to "" if the variable does ↵volth2018-07-08
| | | | | | | | not exist.
* | stdenv-setup: Remove superfluous check for /bin/shaszlig2018-07-09
|/ | | | | | | | | | | | | | | | | | The line was essentially checking whether /bin/sh exists and is executable and if that's the case, the isScript function returns successfully. When asking the author of this line on IRC it seems that even they can't remember or imagine what this was supposed to be. In summary: Whenever /bin/sh doesn't exist during a build, *any* file given to isScript is reported as being a script even if it isn't. This is kinda counter-intuitive and not something what somebody would expect from a function called "isScript". Signed-off-by: aszlig <aszlig@nix.build> Cc: @edolstra
* Merge remote-tracking branch 'upstream/staging' into strictDepsJohn Ericson2018-05-14
|\
| * Merge pull request #40139 from obsidiansystems/modular-setup-hooksJohn Ericson2018-05-07
| |\ | | | | | | treewide: Modular setup hooks
| | * stdenv: Support concatenating setup hooks from multiple parts.John Ericson2018-05-07
| | |
| * | stdenv: implement `checkTarget` and `installCheckTarget` autodetectionJan Malakhovski2018-04-25
| | |