about summary refs log tree commit diff
path: root/pkgs/stdenv/generic
AgeCommit message (Collapse)AuthorFilesLines
2017-02-24nixpkgs: allow packages to be marked insecureGraham Christensen1-12/+60
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.
2017-02-23Revert "nixpkgs: allow packages to be marked insecure"Graham Christensen1-60/+12
2017-02-17nixpkgs: allow packages to be marked insecureGraham Christensen1-12/+60
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.
2017-02-01~/.nixpkgs -> ~/.config/nixpkgsEelco Dolstra1-1/+1
The former is still respected as a fallback for config.nix for backwards compatibility (but not for overlays because they're a new feature).
2017-01-29stdenv: make is64bit evaluate true on aarch64Tuomas Tynkkynen1-0/+1
This should fix the NSS build.
2017-01-25stdenv: Bringup aarch64 architecture supportTuomas Tynkkynen1-0/+2
2017-01-24top-level: Introduce `buildPackages` for resolving build-time depsJohn Ericson1-1/+13
[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
2017-01-13top-level: Modernize stdenv.overrides giving it self and superJohn Ericson1-1/+1
Document breaking change in 17.03 release notes
2016-11-16allowUnfree: mention the solution that works for nix-shell as wellDomen Kožar1-1/+1
2016-10-30Merge pull request #18660 from aneeshusa/add-override-attrsDomen Kožar1-0/+1
mkDerivation: add overrideAttrs function
2016-10-24Merge pull request #19769 from groxxda/licenseJoachim F1-1/+1
stdenv.hasLicense: ? supports nested lookup
2016-10-22stdenv: throwEvalHelp performance (#19779)Alexander Ried1-2/+1
2016-10-22stdenv.hasLicense: ? supports nested lookupAlexander Ried1-1/+1
this avoids one copy of the attrset
2016-10-12stdenv stripHash(): fixup after #19324Vladimír Čunát1-5/+5
2016-10-11stdenv/stripHash: print to stdout, not to variableProfpatsch1-1/+1
`stripHash` documentation states that it prints out the stripped name to the stdout, but the function stored the value in `strippedName` instead. Basically all usages did something like `$(stripHash $foo | echo $strippedName)` which is just braindamaged. Fixed the implementation and all invocations.
2016-10-02mkDerivation: add overrideAttrs functionAneesh Agrawal1-0/+1
This is similar to `overrideDerivation`, but overrides the arguments to `mkDerivation` instead of the underlying `derivation` call. Also update `makeOverridable` so that uses of `overrideAttrs` can be followed by `override` and `overrideDerivation`, i.e. they can be mix-and-matched.
2016-09-18stdenv.mkDerivation: add comments w/ manual links (#18707)Chris Martin1-2/+10
2016-09-01stdenv: leave SSL_CERT_FILE in shells (#15571)Nikolay Amiantov1-1/+2
2016-08-29stdenv.mkDerivation: Use chooseDevOutputsTuomas Tynkkynen1-9/+13
2016-08-29Merge remote-tracking branch 'upstream/master' into stagingRobin Gloster1-1/+4
2016-08-28stdenv: Add platformsTuomas Tynkkynen1-1/+4
2016-08-26Tweak error messageEelco Dolstra1-1/+1
2016-08-26stdenv substitute: fail on non-existant input fileRobin Gloster1-0/+5
fixes #9744
2016-06-10pkgs.runCommand: passAsFile (buildCommand can be very long)Domen Kožar1-0/+4
Close #15803. This avoids the error: while setting up the build environment: executing ‘/nix/store/7sb42axk5lrxqz45nldrb2pchlys14s1-bash-4.3-p42/bin/bash’: Argument list too long Note: I wanted to make it optional based on buildCommand length, but that seems pointless as I'm sure it's less performant. Amended by vcunat: https://github.com/NixOS/nixpkgs/pull/15803#issuecomment-224841225
2016-05-27stdenv: fix paxmarkJoachim Fasting1-5/+5
On Linux, paxctl's setup hook should overwrite the paxmark stub, but the stub is defined after the setup hooks are sourced, so the stub ends up overwriting the real function. The result is that paxmark fails to do anything. The fix is to define the stub before any setup hooks are sourced. Thanks to @vcunat for figuring this out. Closes #15492
2016-05-12stdenv setup.sh: revert most of changes around #14907Vladimír Čunát1-10/+7
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-08stdenv substituteAll: use yet another implementationVladimír Čunát1-4/+9
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-07stdenv substituteAll: use more robust codeVladimír Čunát1-8/+11
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-05Merge #14920: windows improvements, mainly mingwVladimír Čunát1-1/+7
2016-04-25Merge commit 'refs/pull/14907/head' of git://github.com/NixOS/nixpkgs into ↵Nikolay Amiantov1-1/+7
staging
2016-04-25stdenv: clarify how `outputsToInstall` is chosenNikolay Amiantov1-1/+1
See https://github.com/NixOS/nixpkgs/pull/14694/files#r60013871
2016-04-25add get* helper functions and mass-replace manual outputs search with themNikolay Amiantov1-1/+1
2016-04-23doc/stdenv.xml document substitution env variablesProfpatsch1-1/+1
The filtering of environment variables that start with an uppercase letter is documented in the manual.
2016-04-23setup.hs: substitute uses only valid bash namesProfpatsch1-0/+6
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-23stdenv for windows: auto-link dependency DLLsVladimír Čunát1-1/+7
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-07Merge #12653: rework default outputsVladimír Čunát1-6/+19
2016-04-07buildEnv: respect meta.outputsToInstallVladimír Čunát1-0/+3
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-07stdenv: set meta.outputsToInstall unless overriddenVladimír Čunát1-6/+16
2016-04-07Merge 'staging' into closure-sizeVladimír Čunát1-2/+2
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-02stdenv: don't complain about configure script not existingCharles Strahan1-2/+2
Close #14335. Since 89036ef76ab09a, 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-01Merge branch 'master' into closure-sizeVladimír Čunát1-12/+4
Beware that stdenv doesn't build. It seems something more will be needed than just resolution of merge conflicts.
2016-03-08Merge master into closure-sizeVladimír Čunát1-2/+20
The kde-5 stuff still didn't merge well. I hand-fixed what I saw, but there may be more problems.
2016-02-28stdenv-linux: Ensure binutils comes before bootstrapTools in $PATHEelco Dolstra1-12/+4
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-25stdenv: set SSL_CERT_FILE only if it isn't alreadyNikolay Amiantov1-1/+3
2016-02-18Don't try to apply patchelf to non-ELF binariesEelco Dolstra1-0/+11
2016-02-03stdenv: accept wider range of $configureScript optionsVladimír Čunát1-2/+2
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-03Merge recent 'staging' into closure-sizeVladimír Čunát1-3/+5
Let's get rid of those merge conflicts.
2016-02-03Move setting $SSL_CERT_FILE to stdenvEelco Dolstra1-0/+5
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-01-26defaultUnpack: Preserve timestamps when copying filesEelco Dolstra1-3/+5
Commit 6d928ab684327e0eeb1bf6cd889d57ca7127e8a7 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-19Merge branch 'staging' into closure-sizeVladimír Čunát2-17/+25