about summary refs log tree commit diff
path: root/pkgs/stdenv/generic
Commit message (Collapse)AuthorAge
* stdenv-setup and misc hooks: Work with bash-3.4 for MacOS nix-shellJohn Ericson2017-07-26
| | | | This is a temporary measure until this impurity is removed from Nix.
* stdenv-setup and misc pkgs: Revert to space-deliminated propagated-* filesJohn Ericson2017-07-26
| | | | | We cannot switch to line-delimited yet, because certain Nix commands do not read in the entire file, but just the first line.
* stdenv-setup: Add quotes that don't do anything for consistency.John Ericson2017-07-25
| | | | | | | | | | @vcunat and others rightly point out that it's easier to quote always, than learn Bash's idiosyncrasies enough to know when it doesn't make a difference. This reverts commit 2743078f664ae07c4bed06a96182c6a86bd7fa32, which removes quotes that don't do anything, and then goes further adding even more quotes.
* stdenv: Remove log nestingEelco Dolstra2017-07-24
| | | | | Nix/Hydra no longer support pretty printing of logs, so this is no longer useful.
* mkDerivation: Fix errors from #27365John Ericson2017-07-15
| | | | | | | | | | | `nix-build pkgs/top-level/release.nix -A tarball` now succeeds. `configureFlags = null` lead to a type error, and one overrideDrv needed to be converted to to append a configureFlags list instead of string due to the normalization. Thanks @vcunat for alerting me to the issues---sorry I did not catch them before merging my own PR.
* stdenv: Move some logic from cross adapter to stdenv properJohn Ericson2017-07-13
| | | | | | | | | | | | Eventually the adapter will be removed. Moved is - Name suffix from hostPlatform - configurePlatforms To not cause more breakage, the default is currently [], but eventually it will be [ "build" "host" ], as the cross adapter makes it today.
* stdenv-setup: Pull out and explain 3-part printing of commandsJohn Ericson2017-07-13
| | | | | @Dezgeg made the good point that the reasons for doing this were not at all intuitive.
* stdenv-setup: Remove useless quotesJohn Ericson2017-07-13
| | | | | foo=$1 surprisingly doesn't need quotes in Bash. Word splits are only syntactic in string variable (not array var!) assignments.
* stdenv-setup: Combine [[ .. ]] && [[ .. ]] into one [[ .. && .. ]]John Ericson2017-07-13
| | | | Also remove useless quotes on same line
* stdenv-setup: Clean up 'substitute()' for style and error handlingJohn Ericson2017-07-12
| | | | | It now blows up on null byte in file (rather than silently truncating), and invalid arguments (rather than silently skipping).
* stdenv-setup: Misc improvements as directed by ShellCheckJohn Ericson2017-07-12
| | | | | | | | I took some liberties with the flags-echoing code to make it more concise and correct. Also, a few warnings in findInputs and friends I skipped because I am going to rewrite those anyways. Thanks @grahamc for telling me about this great linter!
* stdenv-setup: Make the package accumulators associative arrays instead of ↵John Ericson2017-07-12
| | | | | | | | strings This is generally cleaner: less eval, less worrying about separators, and probably also faster. I got the idea from that python wrapper script.
* stdenv: Store one package per line in nix-support/propagated-*John Ericson2017-07-10
| | | | | | | | | | | | | | | | | This makes those files a bit easier to read. Also, for what it's worth, it brings us one baby step closer to handling spaces in store paths. Also, I optimized handling of many transitive deps with read. Probably, not very beneficial, but nice to enforce the pkg-per-line structure. Doing so let me find much dubious code and fix it. Two misc notes: - `propagated-user-env-packages` also needed to be adjusted as sometimes it is copied to/from the propagated input files. - `local fd` should ensure that file descriptors aren't clobbered during recursion.
* stdenv: Stop reversing the list of sandbox stuffJohn Ericson2017-07-10
| | | | We're breaking hashes anyways
* stdenv: Make separate-debug-info.sh a `nativeBuildInput`John Ericson2017-07-10
|
* Merge branch 'master' into stagingVladimír Čunát2017-07-09
|\ | | | | | | | | Mass rebuilds incoming. The mass-rebuild situation got really messy this weekend.
| * top-level: {build,host,target}Platform are defined in the stdenv insteadJohn Ericson2017-07-07
| | | | | | | | See #27069 for a discussion of this
| * stdenv: Have mkDerivation pull the "extra" arguments from stdenv insteadJohn Ericson2017-07-07
| | | | | | | | Something more elaborate is needed for the "*Platform" arguments.
| * stdenv: Conservatively move `mkDerivation` into it's own fileJohn Ericson2017-07-07
| |
| * stdenv: separate all meta-checking code (~200 lines)Vladimír Čunát2017-07-07
| | | | | | | | | | | | | | | | | | | | | | Only cosmetic changes are done otherwise. Real refactoring is left for later. There's a small slow-down on my machine: $ time nix-env -qa -P >/dev/null gets from ~2.8 to ~3.5 seconds (negligible change in RAM). That's most likely caused by sharing less computation between different mkDerivation calls, and I plan to improve that soon.
| * lib.lists.mutuallyExclusive: add functionVladimír Čunát2017-07-07
| |
| * stdenv: simple refactor to get rid of pos'Vladimír Čunát2017-07-07
| | | | | | | | Suggested by Ericson2314.
| * stdenv: refactor (no change in semantics)Vladimír Čunát2017-07-07
| | | | | | | | This just moves some expressions around in preparation to further changes.
* | stdenv, swift: Use `local fd` in is* bash functions for hygieneJohn Ericson2017-07-07
| |
* | stdenv: Harden hook runnersJohn Ericson2017-07-07
|/ | | | | | Instead of eval, use a "nameref" to get the name of the array and iterate with that. Also, make the for-loop parameter a local variable, too.
* stdenv: Simplify dependency codeJohn Ericson2017-06-29
| | | | | | This is a bit simpler now, but more importantly it scales better when I double the number of sorts of dependencies as part of my cross compilation work.
* Merge branch 'master' into stagingVladimír Čunát2017-05-24
|\
| * stdenv: Rename `isGNU` to `isHurd` as GNU is a userlandJohn Ericson2017-05-22
| | | | | | | | | | Elsewhere, things called GNU indeed includes GNU/Linux or GNU/Hurd, but this predicate was defined excluding Linux regardless of userland.
| * stdenv: define is* predicates with hostPlatform.is*John Ericson2017-05-22
| | | | | | | | This is a saner default until stdenv's are removed altogether
| * lib: Infer `libc` field of platform if not specifiedJohn Ericson2017-05-22
| | | | | | | | | | | | | | | | This is especially useful when not cross compiling. It means we can remove the `stdenv.isGlibc` predicate too. Additionally, use this to simplify the logic to choose the appropriate libiconv derivation.
* | stdenv: disable audit-tmpdir on non-Linux for nowVladimír Čunát2017-05-06
| | | | | | | | Without changing any hashes.
* | Add a setup hook for detecting $TMPDIR references in RPATHs and wrapper scriptsEelco Dolstra2017-05-04
|/
* Merge pull request #25427 from aneeshusa/fix-meta-priority-typesDomen Kožar2017-05-02
|\ | | | | Fix meta priority types
| * stdenv: More useful error message on bad meta attrsAneesh Agrawal2017-05-02
| | | | | | | | | | | | This helps in debugging meta attribute type errors, which are now enforced as of commit 90b9719f4fc95e54400a66bffcc8044c568cfa4b.
* | stdenv: disable checkMeta by default until issues resolvedDan Peebles2017-05-01
|/ | | https://github.com/NixOS/nixpkgs/pull/25304#issuecomment-298385426
* stdenv-generic: add meta attributes checksEric Sagnes2017-04-29
|
* treewide: fix the remaining issues with meta attributesDan Peebles2017-04-29
|
* treewide: fix assorted issues revealed by the meta checkerDan Peebles2017-04-28
| | | Turns out a couple of the licenses were wrong, as well as being strings.
* stdenv-generic: add meta attribute checkingDan Peebles2017-04-28
| | | | This is turned off by default but I think we should fix all packages to respect it and then turn it on by default
* mkDerivation: Don't pass buildInputs to stdenv builder in nativeBuildInputsTuomas Tynkkynen2017-03-02
| | | | | | | | | | | | | | | | | | When not cross compiling, nativeBuildInputs and buildInputs have identical behaviour. Currently that is implemented by having mkDerivation do a concatenation of those variables in Nix code and pass that to the builder via the nativeBuildInputs attribute. However, that has some annoying side effects, like `foo.buildInputs` evaluating to `[ ]` even if buildInputs were specified in the nix expression for foo. Instead, pass buildInputs and nativeBuildInputs in separate variables as usual, and move the logic of cross compilation vs. native compilation to the stdenv builder script. This is probably a tiny bit uglier but fixes the previous problem. Issue #4855.
* nixpkgs: allow packages to be marked insecureGraham Christensen2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a package's meta has `knownVulnerabilities`, like so: stdenv.mkDerivation { name = "foobar-1.2.3"; ... meta.knownVulnerabilities = [ "CVE-0000-00000: remote code execution" "CVE-0000-00001: local privilege escalation" ]; } and a user attempts to install the package, they will be greeted with a warning indicating that maybe they don't want to install it: error: Package ‘foobar-1.2.3’ in ‘...default.nix:20’ is marked as insecure, refusing to evaluate. Known issues: - CVE-0000-00000: remote code execution - CVE-0000-00001: local privilege escalation You can install it anyway by whitelisting this package, using the following methods: a) for `nixos-rebuild` you can add ‘foobar-1.2.3’ to `nixpkgs.config.permittedInsecurePackages` in the configuration.nix, like so: { nixpkgs.config.permittedInsecurePackages = [ "foobar-1.2.3" ]; } b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add ‘foobar-1.2.3’ to `permittedInsecurePackages` in ~/.config/nixpkgs/config.nix, like so: { permittedInsecurePackages = [ "foobar-1.2.3" ]; } Adding either of these configurations will permit this specific version to be installed. A third option also exists: NIXPKGS_ALLOW_INSECURE=1 nix-build ... though I specifically avoided having a global file-based toggle to disable this check. This way, users don't disable it once in order to get a single package, and then don't realize future packages are insecure.
* Revert "nixpkgs: allow packages to be marked insecure"Graham Christensen2017-02-23
|
* nixpkgs: allow packages to be marked insecureGraham Christensen2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a package's meta has `knownVulnerabilities`, like so: stdenv.mkDerivation { name = "foobar-1.2.3"; ... meta.knownVulnerabilities = [ "CVE-0000-00000: remote code execution" "CVE-0000-00001: local privilege escalation" ]; } and a user attempts to install the package, they will be greeted with a warning indicating that maybe they don't want to install it: error: Package ‘foobar-1.2.3’ in ‘...default.nix:20’ is marked as insecure, refusing to evaluate. Known issues: - CVE-0000-00000: remote code execution - CVE-0000-00001: local privilege escalation You can install it anyway by whitelisting this package, using the following methods: a) for `nixos-rebuild` you can add ‘foobar-1.2.3’ to `nixpkgs.config.permittedInsecurePackages` in the configuration.nix, like so: { nixpkgs.config.permittedInsecurePackages = [ "foobar-1.2.3" ]; } b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add ‘foobar-1.2.3’ to `permittedInsecurePackages` in ~/.config/nixpkgs/config.nix, like so: { permittedInsecurePackages = [ "foobar-1.2.3" ]; } Adding either of these configurations will permit this specific version to be installed. A third option also exists: NIXPKGS_ALLOW_INSECURE=1 nix-build ... though I specifically avoided having a global file-based toggle to disable this check. This way, users don't disable it once in order to get a single package, and then don't realize future packages are insecure.
* ~/.nixpkgs -> ~/.config/nixpkgsEelco Dolstra2017-02-01
| | | | | | The former is still respected as a fallback for config.nix for backwards compatibility (but not for overlays because they're a new feature).
* stdenv: make is64bit evaluate true on aarch64Tuomas Tynkkynen2017-01-29
| | | | This should fix the NSS build.
* stdenv: Bringup aarch64 architecture supportTuomas Tynkkynen2017-01-25
|
* top-level: Introduce `buildPackages` for resolving build-time depsJohn Ericson2017-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [N.B., this package also applies to the commits that follow it in the same PR.] In most cases, buildPackages = pkgs so things work just as before. For cross compiling, however, buildPackages is resolved as the previous bootstrapping stage. This allows us to avoid the mkDerivation hacks cross compiling currently uses today. To avoid a massive refactor, callPackage will splice together both package sets. Again to avoid churn, it uses the old `nativeDrv` vs `crossDrv` to do so. So now, whether cross compiling or not, packages with get a `nativeDrv` and `crossDrv`---in the non-cross-compiling case they are simply the same derivation. This is good because it reduces the divergence between the cross and non-cross dataflow. See `pkgs/top-level/splice.nix` for a comment along the lines of the preceding paragraph, and the code that does this splicing. Also, `forceNativeDrv` is replaced with `forceNativePackages`. The latter resolves `pkgs` unless the host platform is different from the build platform, in which case it resolves to `buildPackages`. Note that the target platform is not important here---it will not prevent `forcedNativePackages` from resolving to `pkgs`. -------- Temporarily, we make preserve some dubious decisions in the name of preserving hashes: Most importantly, we don't distinguish between "host" and "target" in the autoconf sense. This leads to the proliferation of *Cross derivations currently used. What we ought to is resolve native deps of the cross "build packages" (build = host != target) package set against the "vanilla packages" (build = host = target) package set. Instead, "build packages" uses itself, with (informally) target != build in all cases. This is wrong because it violates the "sliding window" principle of bootstrapping stages that shifting the platform triple of one stage to the left coincides with the next stage's platform triple. Only because we don't explicitly distinguish between "host" and "target" does it appear that the "sliding window" principle is preserved--indeed it is over the reductionary "platform double" of just "build" and "host/target". Additionally, we build libc, libgcc, etc in the same stage as the compilers themselves, which is wrong because they are used at runtime, not build time. Fixing this is somewhat subtle, and the solution and problem will be better explained in the commit that does fix it. Commits after this will solve both these issues, at the expense of breaking cross hashes. Native hashes won't be broken, thankfully. -------- Did the temporary ugliness pan out? Of the packages that currently build in `release-cross.nix`, the only ones that have their hash changed are `*.gcc.crossDrv` and `bootstrapTools.*.coreutilsMinimal`. In both cases I think it doesn't matter. 1. GCC when doing a `build = host = target = foreign` build (maximally cross), still defines environment variables like `CPATH`[1] with packages. This seems assuredly wrong because whether gcc dynamically links those, or the programs built by gcc dynamically link those---I have no idea which case is reality---they should be foreign. Therefore, in all likelihood, I just made the gcc less broken. 2. Coreutils (ab)used the old cross-compiling infrastructure to depend on a native version of itself. When coreutils was overwritten to be built with fewer features, the native version it used would also be overwritten because the binding was tight. Now it uses the much looser `BuildPackages.coreutils` which is just fine as a richer build dep doesn't cause any problems and avoids a rebuild. So, in conclusion I'd say the conservatism payed off. Onward to actually raking the muck in the next PR! [1]: https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
* top-level: Modernize stdenv.overrides giving it self and superJohn Ericson2017-01-13
| | | | Document breaking change in 17.03 release notes
* allowUnfree: mention the solution that works for nix-shell as wellDomen Kožar2016-11-16
|
* Merge pull request #18660 from aneeshusa/add-override-attrsDomen Kožar2016-10-30
|\ | | | | mkDerivation: add overrideAttrs function