Commit graph

755 commits

Author SHA1 Message Date
Chuck 5d4821141b stdenv: Remove isArm (use isAarch32 instead)
isArm has been deprecated for three releases.  All references have been
removed.  Tree-wide substitution was performed in #37401 21 months ago.
2020-02-05 10:56:14 -08:00
Andreas Rammhold cb007e69a1 stdenv: make symlinks that refer to the same output relative
While looking at the graph of all the outputs in my personal binary
cache it became obvious that we have a lot of self references within the
package set. That isn't an isuse by itself. However it increases the
size of the binary cache for every (reproducible) build of a package
that carries references to itself. You can no longer deduplicate the
outputs since they are all unique. One of the ways to get rid of (a few)
references is to rewrite all the symlinks that are currently used to be
relative symlinks. Two build of something that didn't really change but
carries a self-reference can the be store as the same NAR file again.

I quickly hacked together this change to see if that would yield and
success. My bash scripting skills are probably not great but so far it
seem to somewhat work.
2020-01-15 09:26:40 +01:00
John Ericson cfd013813e
Merge pull request #74090 from obsidiansystems/ghcjs-cross-without-cc
stdenv, haskell: bonafied GHCJS cross compilation without stdenv.cc
2019-12-30 16:40:43 -08:00
Robert Scott e1e3df423a allowInsecureDefaultPredicate: fix to use getName
this allows correct operation with packages only having pname and version
specified, resolving issue #73737
2019-12-15 18:01:19 +00:00
John Ericson 6bc456c91c Merge remote-tracking branch 'upstream/master' into ghcjs-cross-without-cc 2019-11-25 00:23:07 +00:00
John Ericson 63bd851e95 stdenv: Introduce hasCC attribute
Before, we'd always use `cc = null`, and check for that. The problem is
this breaks for cross compilation to platforms that don't support a C
compiler.

It's a very subtle issue. One might think there is no problem because we
have `stdenvNoCC`, and presumably one would only build derivations that
use that. The problem is that one still wants to use tools at build-time
that are themselves built with a C compiler, and those are gotten via
"splicing". The runtime version of those deps will explode, but the
build time / `buildPackages` versions of those deps will be fine, and
splicing attempts to work this by using `builtins.tryEval` to filter out
any broken "higher priority" packages (runtime is the default and
highest priority) so that both `foo` and `foo.nativeDrv` works.

However, `tryEval` only catches certain evaluation failures (e.g.
exceptions), and not arbitrary failures (such as `cc.attr` when `cc` is
null). This means `tryEval` fails to let us use our build time deps, and
everything comes apart.

The right solution is, as usually, to get rid of splicing. Or, baring
that, to make it so `foo` never works and one has to explicitly do
`foo.*`. But that is a much larger change, and certaily one unsuitable
to be backported to stable.

Given that, we instead make an exception-throwing `cc` attribute, and
create a `hasCC` attribute for those derivations which wish to
condtionally use a C compiler: instead of doing `stdenv.cc or null ==
null` or something similar, one does `stdenv.hasCC`. This allows quering
without "tripping" the exception, while also allowing `tryEval` to work.

No platform without a C compiler is yet wired up by default. That will
be done in a following commit.
2019-11-25 00:12:38 +00:00
Lily Ballard d45d6205de setup.sh: rewrite stripHash
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.
2019-11-12 14:38:41 +01:00
John Ericson 5b6da99ea0 stdenv: Don't unset propagated*DepFiles before main phases
A bunch of stdenv-internal variables were deleted in
1601a7fcce, 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
2019-11-05 16:32:22 -05:00
Matthew Bauer 9ffedfef81
Merge pull request #69603 from matthewbauer/unset-unused-setup-var
Unset unused variables in setup.sh
2019-11-05 14:43:11 -05:00
Frederik Rietdijk c4e30cf98c Merge staging-next into staging 2019-11-05 14:18:08 +01:00
Dmitry Kalinkin cf8a2d0225
Revert "stdenv/check-meta: getEnv if the attribute is unset (#72376)" (#72752)
This reverts commit 71184f8e15.
2019-11-03 20:38:35 -05:00
zimbatm 71184f8e15
stdenv/check-meta: getEnv if the attribute is unset (#72376)
There were two issues:

* builtins.getEnv was called deep into the nixpkgs tree making it hard
  to discover. This is solved by moving the call into
  pkgs/top-level/impure.nix
* when the config was explicitly set by the user to false, it would
  still try and load the environment variable. This meant that it was
  not possible to guarantee the same outcome on two different systems.
2019-11-03 17:40:43 +00:00
John Ericson 9df7efe0c6 stdenv: Don't stop set -u-ing
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.
2019-11-01 22:03:47 +00:00
Graham Bennett b12605563f Fix handling of lists in whitelistedLicenses and blacklistedLicenses
A package's meta.license can either be a single license or a list.  The
code to check config.whitelistedLicenses and config.blackListedLicenses
wasn't handling this, nor was the showLicense function.
2019-10-27 10:23:53 +00:00
Matthew Bauer 1601a7fcce generic/setup.sh: Unset locally defined variables
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.
2019-09-26 18:47:38 -04:00
Matthew Bauer 8e9b98a183
Merge pull request #69028 from matthewbauer/remove-iselfexec-iselfdyn
Revert "setup.sh introduce isELFExec, isELFDyn"
2019-09-20 23:26:48 -04:00
Albert Safin 42482a1d60 setup.sh: avoid subshells: iterating a file 2019-09-20 02:45:53 +00:00
Albert Safin cf4e4820f6 setup.sh: avoid subshells: type -t in _callImplicitHook 2019-09-20 02:45:52 +00:00
Albert Safin d53920a5be setup.sh: avoid subshells: mapOffset 2019-09-20 02:45:52 +00:00
Albert Safin 6f024f6e65 setup.sh: avoid subshells: type -t 2019-09-20 02:45:52 +00:00
Albert Safin 463463b395 setup.sh: avoid subshells: shopt -po nounset 2019-09-19 09:54:29 +00:00
Matthew Bauer 24c6aef75a Revert "setup.sh introduce isELFExec, isELFDyn"
This reverts commit e1b80a5a99.

This is broken in PIE (#68513). Best to not keep it in until something
else starts using it.
2019-09-18 11:28:27 -04:00
volth 08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
Frederik Rietdijk 5061fe0c2c Merge staging-next into staging 2019-08-28 08:26:42 +02:00
volth 35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Danylo Hlynskyi 2ca09a94be
Merge pull request #66657 from danbst/pgpackages-fixes
Postgresql plugins fixes
2019-08-18 17:30:56 +03:00
Florian Klink dbd7ea5f29
Merge pull request #66725 from flokli/wrapqtappshook-exec
stdenv: add isELFExec, isELFDyn, fix wrappers
2019-08-18 13:58:10 +02:00
Florian Klink e1b80a5a99 setup.sh introduce isELFExec, isELFDyn
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.
2019-08-17 16:45:52 +02:00
danbst cd5b8620bb stdenv/check-meta: construct name from pname and version if name unavailable 2019-08-15 02:25:56 +03:00
arcnmx 8cedc7fc6c stdenv: correct cross CMAKE_SYSTEM_NAME
As described in cmake cross instructions, CMAKE_SYSTEM_NAME should be
set to "Generic" if there is no applicable OS:

https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling#setting-up-the-system-and-toolchain
2019-07-27 15:23:31 -07:00
worldofpeace 4a88f4ebfc setup.sh: add dontUnpack 2019-07-01 04:23:51 -04:00
worldofpeace 0197c05786 setup.sh: add dontConfigure
There's already 21 occurences of this and I've
expected this to exist without knowing it had no affect for a while.
2019-07-01 01:52:54 -04:00
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Vladimír Čunát 576af17187
Merge branch 'master' into staging-next
Hydra nixpkgs: ?compare=1523575
2019-06-05 11:06:44 +02:00
Matthew Bauer 760c9995b0
Merge pull request #60349 from matthewbauer/fix-60345
check-meta: use system tuple in platforms
2019-06-04 11:29:48 -04:00
Vladimír Čunát 96a604320a
Merge #61179: stdenv, cacert: $NIX_SSL_CERT_FILE changes
... into staging
2019-05-19 10:56:11 +02:00
Michael Raskin 76e2a96475
Changelog meta entry (#60371)
meta.changelog: enable, document, add for GNU Hello
2019-05-10 16:55:29 +00:00
Vladimír Čunát b27cc37671
stdenv: also override cert files in pure nix-shell
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
2019-05-09 09:49:42 +02:00
Vladimír Čunát 79bd4ad579
stdenv, cacert: consider $NIX_SSL_CERT_FILE in hooks
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_*.
2019-05-09 08:46:22 +02:00
Matthew Bauer a52e317200 check-meta: use system tuple in platforms
Fixes #60345
2019-04-30 12:59:03 -04:00
Matthew Bauer 87944c3125
Merge pull request #56744 from matthewbauer/macos-10-12
Update macOS to 10.12
2019-04-26 22:20:03 -04:00
Matthew Bauer ec7d72a57d setup.sh: make sure initialPath goes at end of HOST_PATH
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.
2019-04-26 21:54:49 -04:00
Matthew Bauer 7488a367af
Merge pull request #56555 from matthewbauer/wasm
Initial WebAssembly/WASI cross-compilation support
2019-04-23 22:44:33 -04:00
John Ericson 1a7a96a093 stdenv, compiler-rt: Compress WASI conditionals 2019-04-23 21:48:58 -04:00
Matthew Bauer 9abff4af4f wasm: init cross target
Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs
with a WebAssembly toolchain.

stdenv/cross: use static overlay on isWasm

isWasm doesn’t make sense dynamically linked.
2019-04-23 21:48:57 -04:00
Matthew Bauer 7f23d9fc5f
Merge pull request #59755 from matthewbauer/patches-in-make-derivation
make-derivation: put patches in all derivations
2019-04-23 18:33:04 -04:00
volth b0193379e5
make-derivation.nix: minor
it seems to change nothing (.platform is always there), just to be consisted with the style of other checks
2019-04-21 20:05:13 +00:00
volth b1c3581b46
make-derivation.nix: @matthewbauer's review 2019-04-21 19:16:28 +00:00
volth 5d87bc2650 fix bootstrap when platform.gcc.arch=="skylake" 2019-04-21 16:37:49 +00:00
Matthew Bauer c7ccb9f197 make-derivation: put patches in all derivations
This puts patches in all derivations even if it unspecified by the
derivation. By default it will be an empty list. This simplifies
overrides, as we can now assume that patches is a valid name so that
this works:

self: super: {
  mypkg = super.pkg.overrideAttrs (o: {
    patches = o.patches ++ [ ./my-very-own.patch ];
  });
}

That is, you don’t need to provide a default "or []", make-derivation
provides one for you.

Unfortunately, this is a mass rebuild.
2019-04-16 22:51:26 -04:00