Commit Graph

2041 Commits

Author SHA1 Message Date
Ryan Burns
bcd7b0dd5d darwin/make-bootstrap-tools: avoid brotli dependency
Needed as of e3d19670a0
2021-03-18 12:30:16 -07:00
Ryan Burns
68823d6d65 stdenv/bootstrap-tools: remove powerpc64 special case
Now that powerpc64 is always ELFv2, we can unconditionally use musl
tools here.
2021-03-15 19:27:41 -07:00
Vincenzo Mantova
6ba632c2a4
stdenv: ignore duplicates in addToSearchPath (#113800) 2021-03-13 13:58:21 -05:00
Andrew Childs
21e3a8abe7 stdenv/darwin: allow brotli reference from curl
Brotli is recently a default dependency of curl in nixpkgs.

See e3d19670a0 in #112947
2021-03-09 18:24:01 +09:00
Andrew Childs
d16a8753d9 stdenv: set CMAKE_OSX_ARCHITECTURES appropriately 2021-03-02 17:21:07 +09:00
Arthur Gautier
a961aeadae stdenv: provide a deterministically built gcc
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-03-01 05:06:39 +00:00
WORLDofPEACE
4b10920ed1
stdenv/check-meta: change to allowlist and blocklist (#114127)
* stdenv/check-meta: change to allowlist and blocklist

* Update pkgs/stdenv/generic/check-meta.nix

Co-authored-by: Graham Christensen <graham@grahamc.com>
2021-02-23 10:25:18 -05:00
github-actions[bot]
402b752521
Merge master into staging-next 2021-02-11 18:16:48 +00:00
Ben Siraphob
4da3c5ab1e stdenv/generic: recommend lib instead of pkgs.lib in place of stdenv.lib 2021-02-11 11:34:06 +07:00
github-actions[bot]
30dddce5e8
Merge master into staging-next 2021-02-09 06:16:02 +00:00
Bernardo Meurer
129ec8a4a5
stdenv: remove mention of flashplayer (in comments) 2021-02-08 09:38:43 -08:00
github-actions[bot]
2226996f6c
Merge master into staging-next 2021-02-07 18:16:08 +00:00
Ashish SHUKLA
1c39662e63
stdenv: Improve/fix FreeBSD support
Able to bootstrap stdenv on FreeBSD by compiling various dependencies
using built-in FreeBSD tools so mostly works now

Closes: https://github.com/NixOS/nixpkgs/pull/81459
2021-02-07 15:24:16 +00:00
github-actions[bot]
194e4e6f80
Merge master into staging-next 2021-02-07 06:16:10 +00:00
Cole Helbling
c7942b0f8b stdenv/generic: allowAliases should default to true if unset
Since the deprecation is fairly recent, we should warn by default.

Also fix the wording of the comment: stdenv.lib will be removed for the 21.11
release, not just deprecated (as it already is deprecated).
2021-02-06 21:30:34 -08:00
Cole Helbling
afbeed62bb stdenv/generic: allowAliases should default to false if unset
Mostly because config.allowAliases doesn't exist unless it's set.
2021-02-06 19:44:30 -08:00
Edmund Wu
5b278c2f48
stdenv/generic: allowAlises -> allowAliases 2021-02-06 22:15:00 -05:00
Ben Siraphob
66e92385b9 stdenv/generic: throw when using stdenv.lib and disallowing aliases 2021-01-31 18:40:19 +07:00
github-actions[bot]
f92395cf3c
Merge staging-next into staging 2021-01-31 06:19:43 +00:00
John Ericson
6717246373
Merge pull request #111284 from siraben/remove-new-stdenv-lib
stdenv: warn about use of inherited lib
2021-01-30 22:28:05 -05:00
Ben Siraphob
227693ed69
Update pkgs/stdenv/generic/default.nix
Co-authored-by: John Ericson <git@JohnEricson.me>
2021-01-31 03:03:11 +00:00
github-actions[bot]
81337921f5
Merge staging-next into staging 2021-01-31 00:46:33 +00:00
Matthew Bauer
048e0d3f87
Merge pull request #108518 from 4z3/env-vars
stdenv: mute errors when failing to write env-vars
2021-01-30 18:37:10 -06:00
John Ericson
5fc5e83808
Merge pull request #111345 from r-burns/ppc64-big-endian
Enable PPC64 (big-endian)
2021-01-30 16:26:06 -05:00
Ryan Burns
76fc6d2870 bootstrap-tools-cross: add powerpc64-linux
Also check for powerpc64-linux-elfv1, which does not support musl.
2021-01-30 12:34:30 -08:00
Ryan Burns
c17abf8111 stdenv: add powerpc64-linux 2021-01-30 12:34:30 -08:00
Guillaume Girol
a6840c55c2
Merge pull request #101606 from utsl42/master
Fix hardening default for pkgsMusl to reenable -pie
2021-01-30 15:19:12 +00:00
Ben Siraphob
32e8cec5d9 stdenv: warn about use of inherited lib 2021-01-30 18:42:48 +07:00
Sandro
2ee93d61ad
Merge pull request #110913 from siraben/other-stdenv-lib 2021-01-27 10:13:05 +01:00
Ben Siraphob
36c91cea1d treewide: stdenv.lib -> lib 2021-01-27 13:08:40 +07:00
Vladimír Čunát
a648a07c19
Merge #104742: linux bootstrap tools: fix tests on ppc64 2021-01-26 08:09:59 +01:00
Ben Siraphob
aa8868c7cc pkgs/build-support: stdenv.lib -> lib 2021-01-24 19:07:54 -08:00
John Ericson
fa204a97d8 stdenv: Remove stdenv.platform
This was not working after #110544 as caught by @r-burns in
https://github.com/NixOS/nixpkgs/pull/110544#issuecomment-766444647.
Thankfully it isn't used anymore and I believe wasn't documented either.
(I at least did not remember it existed.)
2021-01-24 22:51:12 +00:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
John Ericson
9c213398b3 lib: Clean up how linux and gcc config is specified
Second attempt of 8929989614589ee3acd070a6409b2b9700c92d65; see that
commit for details.

This reverts commit 0bc275e634.
2021-01-23 10:01:28 -05:00
Jonathan Ringer
0bc275e634
Revert "lib: Clean up how linux and gcc config is specified"
This is a stdenv-rebuild, and should not be merged
into master

This reverts commit 8929989614.
2021-01-22 14:07:06 -08:00
John Ericson
8929989614 lib: Clean up how linux and gcc config is specified
The `platform` field is pointless nesting: it's just stuff that happens
to be defined together, and that should be an implementation detail.

This instead makes `linux-kernel` and `gcc` top level fields in platform
configs. They join `rustc` there [all are optional], which was put there
and not in `platform` in anticipation of a change like this.

`linux-kernel.arch` in particular also becomes `linuxArch`, to match the
other `*Arch`es.

The next step after is this to combine the *specific* machines from
`lib.systems.platforms` with `lib.systems.examples`, keeping just the
"multiplatform" ones for defaulting.
2021-01-21 22:44:09 -05:00
Monson Shao
2467f5e4d2
darwin.apple-sdk: drop appleSdkVersion
In fact no one is using appleSdkVersion, and stdenv is decoupled with sdk.
2021-01-21 00:26:16 +08:00
Ben Siraphob
0e49ba1b64 make-bootstrap-tools: stdenv.lib -> lib 2021-01-15 14:24:03 +07:00
Emery Hemingway
843daa841d llvmPackages: select version by targetPlatform 2021-01-11 11:10:53 +01:00
tv
659da9b738 stdenv: mute errors when failing to write env-vars 2021-01-05 22:23:37 +01:00
Andrew Childs
34c8fae439 darwin/stdenv: tapi stub based bootstrap
Fixes bootstrapping on macOS Big Sur.
2020-12-22 11:43:54 +09:00
github-actions[bot]
58274c4f8d
Merge master into staging-next 2020-12-03 00:36:28 +00:00
Frederik Rietdijk
1649296354 makeBootstrapTools: set schedulingPriority
Increase schedulingPriority of the bootstrap tools to unblock the
nixpkgs-unstable channel.

The channel is repeatedly blocked by the makeBootstrapTools job for
aarch64. The cause is lack of resources.

By increasing the priority, it should become the first job Hydra would
build, allowing the channel to advance quicker. Of course, it does mean
that while the channel advances, nothing else has been built.

This should be a temporary solution until we have more capacity for
aarch64.
2020-12-02 20:32:38 +01:00
Frederik Rietdijk
0d8491cb2b Merge master into staging-next 2020-11-29 13:51:10 +01:00
John Ericson
73425f6c3b Merge remote-tracking branch 'upstream/master' into staging 2020-11-28 21:33:03 -05:00
Daiderd Jordan
788f61cf3e
Merge pull request #85545 from LnL7/meta-available-flags
meta: expose availability flags in derivation metadata
2020-11-28 18:57:47 +01:00
Robert Hensing
c8ae3d870c setup.sh: export XDG_DATA_DIRS for consistency
By exporting it, we always make the new directories available
to subprocesses, regardless of whether the environment
variable existed before `nix-shell` was invoked.
2020-11-25 08:44:04 -08:00
Robert Hensing
84c58abdc4 setup.sh: Only load XDG_DATA_DIRS for executable inputs
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.
2020-11-25 08:44:04 -08:00
Robert Hensing
0f13cccb95 setup.sh: Support XDG_DATA_DIRS
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`.
2020-11-25 08:44:04 -08:00
Ryan Burns
9682c1d0da linux bootstrap tools: fix tests on ppc64
The dynamic loader on powerpc64 is called ld64.so.2 rather than
ld-linux.so.*, and was not matched by the existing pattern.

We reuse the dynamicLinker name from binutils to match a wider set
of platforms and to avoid specifying this information in two places.
2020-11-24 18:32:12 -08:00
Andreas Rammhold
278b273d9a
Merge pull request #102251 from andir/random-seed
stdenv: introduce -frandom-seed
2020-11-19 01:07:28 +01:00
Arnout Engelen
05e0aa3040
gcc: update to isl 0.20.0 for bootstrapping and recent versions (#103311) 2020-11-17 21:20:48 +00:00
Daiderd Jordan
411f9e25d7
Merge pull request #98541 from thefloweringash/darwin-tapi-stdenv
darwin (Big Sur): tbd based stdenv
2020-11-13 00:14:25 +01:00
Andrew Childs
47c770e0e6 darwin/make-bootstrap-tools: remove references to old libSystem 2020-11-12 16:57:19 +09:00
Andrew Childs
8946ff8d71 darwin/darwin-stubs: init 2020-11-12 00:23:09 +09:00
Frederik Rietdijk
4076ffe580 Merge staging-next into staging 2020-11-11 16:00:34 +01:00
Arnout Engelen
f6650152bd
Promote allowUnfreePredicate in remediation message 2020-11-09 17:26:02 +01:00
Frederik Rietdijk
8aaf2e60e5 Merge staging-next into staging 2020-11-09 14:49:10 +01:00
Andrew Childs
fece3eb2e9 darwin/stdenv: refactoring
Build the llvm support libraries (libcxx, libcxxabi) from scratch
without using the existing llvm libraries. This is the same spirit and
similar implementation as the "useLLVM" bootstrap in llvm package
sets. Critically it avoids having libcxxabi provided by the cc-wrapper
when building libcxx, which otherwise results in two libcxxabi
instances.

$ otool -L /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib
/nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib:
        /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/gmpwk5fyp3iasppqrrdpswxvid6kcp8r-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/3hn7azynqgp2pm5gpdg45gpq0ia72skg-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/1nq94scbxs6bk7pimqhvz76q6cfmbv97-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

Additionally move some utilities (clang, binutils, coreutils, gnugrep)
to the stage layers so they can be replaced before the final
stdenv. This should cause most of stage4 to be built from the
toolchain assembled as of stage3 instead of the bootstrap toolchain.
2020-11-09 20:00:39 +09:00
Andrew Childs
86ee107a15 darwin/stdenv: assemble full clang toolchain
Adapted from main expression for clang 7.
2020-11-09 19:59:49 +09:00
Daiderd Jordan
7f1a82d476 stdenv/darwin: bump bootstrap tools
This new version has tapi support, which is needed to build the new
stubs based libSystem, etc. and Big Sur support.

You can verify the provenance of these yourself by checking Hydra here:
https://hydra.nixos.org/build/128192471
2020-11-09 19:59:49 +09:00
Joachim Breitner
d92a19b039 stdenv: Fix error message when checkPhase is missing 2020-11-07 10:37:37 -08:00
Kevin Cox
e371443a1e
Merge pull request #101833 from wamserma/allow-via-env
stdenv/check-meta: add hint to NIXPKGS_ALLOW_* for unfree/broken/…
2020-11-05 09:12:28 -05:00
Andreas Rammhold
83f0bccc89 stdenv: add -frandom-seed to NIX_CFLAGS_COMPILE for reproducibility
This adds -frandom-seed to each compiler invocation in stdenv. The
object here is to make the compierl invocations produce the same output
every time they are called (for the same derivation). When the
-frandom-seed option is not set the compiler will use a combination of
random numbers (in GCC's case from /dev/urandom) and the durrent time to
produce a "random" input per file. This can (among other things) lead to
different ordering of symbols in the produced object files.

For reason of reproducibility we prefer having the same derivation
produce the exact same outputs. This is not a silver bullet but one way
to tame the compiler.
2020-11-01 19:40:12 +01:00
Vladimír Čunát
dfd3ede68d
Merge branch 'master' into staging-next 2020-10-31 14:30:44 +01:00
Matthew Bauer
989b403c7f
Merge pull request #96318 from matthewbauer/provide-patchelf-in-native-stdenv
stdenv/native: provide patchelf on linux
2020-10-30 13:32:13 -05:00
Markus S. Wamser
4a26f177c9 stdenv/check-meta: add hint to NIXPKGS_ALLOW_* for unfree/broken/unsupported system 2020-10-27 10:01:32 +01:00
Vladimír Čunát
89023c38fc
Recover the complicated situation after my bad merge
I made a mistake merge.  Reverting it in c778945806 undid the state
on master, but now I realize it crippled the git merge mechanism.
As the merge contained a mix of commits from `master..staging-next`
and other commits from `staging-next..staging`, it got the
`staging-next` branch into a state that was difficult to recover.

I reconstructed the "desired" state of staging-next tree by:
 - checking out the last commit of the problematic range: 4effe769e2
 - `git rebase -i --preserve-merges a8a018ddc0` - dropping the mistaken
   merge commit and its revert from that range (while keeping
   reapplication from 4effe769e2)
 - merging the last unaffected staging-next commit (803ca85c20)
 - fortunately no other commits have been pushed to staging-next yet
 - applying a diff on staging-next to get it into that state
2020-10-26 09:01:04 +01:00
Nathan Hawkins
4e9dc46dea stdenv: Fix hardening default for pkgsMusl to reenable -pie
defaultHardeningFlags is set to enable pie for Musl, but is not
actually used because the default is never put into
NIX_HARDENING_ENABLE. That still works for cases other than Musl
only because NIX_HARDENING_ENABLE is defaulted in the binutils and
cc-wrapper setup-hook.sh scripts.
2020-10-25 12:33:58 +00:00
Vladimír Čunát
c778945806
Revert "Merge #101508: libraw: 0.20.0 -> 0.20.2"
I'm sorry; I didn't notice it contained staging commits.

This reverts commit 17f5305b6c, reversing
changes made to a8a018ddc0.
2020-10-25 09:41:51 +01:00
John Ericson
e54f6b1fde
Merge pull request #99401 from Ericson2314/cmake-optional-openssl
cmake: Tighten deps
2020-10-13 22:13:13 -04:00
John Ericson
e75f863bd4 darwin bootstrapping: Dedup code a bit 2020-10-13 19:26:13 -04:00
Frederik Rietdijk
692d219a93 Merge staging-next into staging 2020-10-06 10:25:58 +02:00
Daniël de Kok
f92809bcee
Merge pull request #97000 from danieldk/stdenv-darwin-unset-sdkroot
stdenv: unset SDKROOT on Darwin
2020-09-14 07:37:50 +02:00
Robert Helgesson
fbc5093649
hooks: add moveSystemdUserUnitsHook
This hook moves systemd user service file from `lib/systemd/user` to
`share/systemd/user`. This is to allow systemd to find the user
services when installed into a user profile. The `lib/systemd/user`
path does not work since `lib` is not in `XDG_DATA_DIRS`.
2020-09-12 18:29:46 +02:00
Matthew Bauer
61517de024
Merge pull request #93912 from thefloweringash/cctools-tapi
stdenv/darwin: enable tapi support in cctools
2020-09-10 23:23:52 -05:00
Silvan Mosberger
560bb92473
Merge pull request #76794 from dudebout/document-nix-env-multiple-output-install-bug
document nix-env bug relating to multiple output installation
2020-09-05 15:40:26 +02:00
Nicolas Dudebout
611258f063 document nix-env bug relating to multiple output installation 2020-09-05 05:31:54 -04:00
Daniël de Kok
b1700a7336 stdenv: unset SDKROOT on Darwin
The Rust `cc` crate started running `xcrun` when SDKROOT is defined:

a970b0ab0b

Consequently, building crates that use newer versions of the `cc`
crate fail, because xcrun is not available in pure build environments.
2020-09-03 09:46:21 +02:00
Silvan Mosberger
911497988f
Merge pull request #95536 from Infinisil/inputDerivation
mkDerivation: Introduce .inputDerivation for shell.nix build convenience
2020-08-31 15:46:41 +02:00
Matthew Bauer
54210573c1 stdenv/native: provide patchelf on linux
This provides consistency with the pure stdenv, which provides
patchelf this way. Native stdenv can always just manually install
patchelf on their system, but like xz, it’s unlikely to be provided in
/usr/bin/. In addition, it’s not even in the RHEL7 repos.
2020-08-25 17:54:27 -05:00
Andrew Childs
630f5d30df stdenv/darwin: enable tapi support in cctools 2020-08-21 01:09:42 +09:00
Matthew Bauer
a378ae61e2
Merge pull request #95129 from aaronjanse/aj-fix-llvm-for-redox
mkDerivation: use `Generic` as system name for Redox in cmakeFlags
2020-08-19 15:07:20 -05:00
Silvan Mosberger
3e1a40df75
mkDerivation: Introduce .inputDerivation for shell.nix build convenience
This introduces the .inputDerivation attribute on all derivations
created with mkDerivation. This is another derivation that can always
build successfully and whose runtime dependencies are the build time
dependencies of the original derivation.

This allows easy building and distributing of all derivations needed to
enter a nix-shell with

  nix-build shell.nix -A inputDerivation
2020-08-16 00:24:48 +02:00
Aaron Janse
eb970b6241 mkDerivation: handle Redox in cmakeFlags 2020-08-10 19:52:54 -07:00
Emery Hemingway
f5ef00a12f gnu-config: 2019-04-15 -> 2020-05-04
Update gnu-config (config.sub, config.guess) to suport the Genode
platform and apply the updateAutotoolsGnuConfigScriptsHook to Genode
cross-compilation.
2020-08-02 22:37:39 +02:00
Jörg Thalheim
f6a30fcac5
Merge pull request #89794 from Mic92/source-date-epoch 2020-08-01 10:08:18 +01:00
Aaron Janse
60fd049b65 redox: add as target 2020-07-21 13:11:36 -07:00
Vladimír Čunát
377324ca6d
Merge branch 'staging-next' (PR #91090) 2020-07-13 07:13:56 +02:00
Ben Wolsieffer
18c8866f77 stdenv: correctly make stdenv.system refer to the host platform
This was supposed to be done in 773233ca77, but was not due to a small
mistake.
2020-07-11 16:06:08 -04:00
John Ericson
f3f7612a40 C++ Compilers: Systematize handling of standard libraries 2020-06-22 04:24:44 +00:00
Silvan Mosberger
4aabac8d88
Merge pull request #86223 from pikajude/darwin-static-eval
pkgsStatic: use clang for C compiler on Darwin
2020-09-30 23:44:18 +02:00
zowoq
b78a0348d3 stdenv/check-meta: alignment/width 2020-06-11 12:35:11 +10:00
Vladimír Čunát
a5f5d020c6
Merge branch 'staging-next' 2020-06-10 16:13:48 +02:00
Geoffrey Huntley
ffa5137278
docs: increase awareness of NIXPKGS_ALLOW_INSECURE=1
496bc90c6c/doc/using/configuration.xml (L190)
2020-06-10 18:16:31 +10:00
Jörg Thalheim
bc4927a526
stdenv: set SOURCE_DATE_EPOCH to a value python supports
in nix-shell this value breaks the build because python's
packaging refuses to build timestamps that date before 1980.
2020-06-08 11:54:46 +01:00
John Ericson
cc1af0751f
Merge pull request #89036 from Ericson2314/fix-mesa-wayland-cross
mesa wayland: Fix/simplify cross
2020-05-27 16:45:05 -04:00
John Ericson
162c0c3e61 mkDerivation: Don't need to specify pkg-config for meson any more
Env var will work fine.
2020-05-27 16:07:58 +00:00
Matthew Bauer
fb35227b8c
Merge pull request #87583 from Gaelan/single-llvm
stdenv-darwin: now with 50% less LLVM!
2020-05-15 18:56:17 -05:00
Matthew Bauer
d38bad590e
Merge pull request #83180 from matthewbauer/only-add-ldflags-for-macos
bintools: only add macos flags when targeting macOS
2020-05-13 10:34:40 -05:00
John Ericson
1ac5398589 *-wrapper; Switch from infixSalt to suffixSalt
I hate the thing too even though I made it, and rather just get rid of
it. But we can't do that yet. In the meantime, this brings us more
inline with autoconf and will make it slightly easier for me to write a
pkg-config wrapper, which we need.
2020-05-12 00:44:44 -04:00
Gaelan Steele
23ce1eed34 stdenv: only build LLVM once on darwin 2020-05-11 10:28:31 -07:00
John Ericson
05d26adb0a mkDerivation mesonFlags: Fix arm cpu families
In my haste to unbreak eval, I screwed up and got the bit-widths,
backwards.
2020-04-28 22:56:20 -04:00
John Ericson
cf858e6d57 mkDerivation mesonFlags: Fix cross file logic to handle more cases
Otherwise eval breaks
2020-04-28 16:51:44 -04:00
Jude Taylor
0de6275003 pkgsStatic: fix eval on Darwin 2020-04-28 08:41:48 -07:00
John Ericson
8245230753 meson: Make target-agnostic
The cross file is added in the `mkDerivation`. It isn't nice putting
build tool-specific stuff here, but our current architecture gives us
little alternative.
2020-04-28 10:55:33 -04:00
Daiderd Jordan
950ac2bc8f
meta: expose availability flags in derivation metadata
Currently it's not possible to determine the reason why a package is
unavailable without evaluating nixpkgs multiple times with different
settings. eg.

    nix-repl> :p android-studio.meta
    { available = false; broken = false; unfree = true; unsupported = true; ... }

The following snippet is an example that uses this information to query
the availability information of all packages in nixpkgs, giving an
overview of all the packages currently marked as broken, etc.

    { pkgs }:

    with import <nixpkgs/lib>;

    let

      mapPkgs =
        let mapPkgs' = path: f: mapAttrs (n: v:
          let result = builtins.tryEval (v ? meta); in
          if !result.success then {} else
          if isDerivation v then f (path ++ [n]) v else
          if isAttrs v && v.recurseForDerivations or false then mapPkgs' (path ++ [n]) f v else
          {}
        );
        in mapPkgs' [];

      getMeta = path: drv:
        if drv.meta ? available then
          let meta = {
            pkg = concatStringsSep "." path;
            inherit (drv.meta) broken unfree unsupported insecure;
          };
          in builtins.trace meta.pkg meta
          else {};

      metaToList = attrs: flatten (map (v: if v ? pkg then v else metaToList v) (attrValues attrs));

    in metaToList (mapPkgs getMeta pkgs)
2020-04-19 12:53:04 +02:00
Jan Tojnar
b4a6714571
Merge branch 'staging-next' into staging 2020-04-13 18:54:59 +02:00
worldofpeace
5384d72885 setup.sh: add dontPatch
Fixes #85038
2020-04-12 07:04:35 -04:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Matthew Bauer
e0fb0df64f generic/setup.sh: allow clobbering env-vars file
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
2020-04-09 22:39:16 -04:00
Matthew Bauer
e45f16b9f5 stdenv/linux: remove powerpc64le bootstrap tools
These files never existed, so best to not leave the reference. If
someone want to step up to maintain this, that would be fine. I don’t
have the hardware to test these out. In addition, someone tried to use
the bootstrap-tools currently built by Hydra and found that they were
broken in some unclear way.
2020-03-31 15:03:26 -04:00
Matthew Bauer
b0b0a06788 bintools: only add macos flags when targeting macOS
We can’t set this for cross-compiling since we use the GNU linker.
Instead, set these flags only when targetPlatform is macOS.

Fixes #80754

Fixes #83141
2020-03-23 00:32:45 -04:00
Graham Christensen
6b361c3a31
armv{5tel,6l,7l}: bootstrap-files: quote URLs for rfc-45
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2020-03-16 19:04:39 -04:00
Graham Christensen
11b54adeac
armv{5tel,6l,7l}: update bootstrap tools after #80497 2020-03-16 18:11:59 -04:00
Frederik Rietdijk
0eb0ddc4db Merge staging-next into master 2020-03-08 08:11:01 +01:00
Ben Wolsieffer
05fc2a3524 unpack-bootstrap-tools: remove obsolete linker script patching
The linker scripts no longer contain store paths, so this does nothing. More
importantly, libpthread.so is not longer a linker script on ARM, so the patching
would corrupt it.
2020-03-06 06:58:20 +01:00
Ben Wolsieffer
ee39e49b68 stdenv: update ARM bootstrap tarballs
Fixes building glibc 2.30, which requires at least GCC 6.

Picked from the following cross-trunk evaluation:
https://hydra.nixos.org/eval/1568864 based on nixpkgs
commit ac241fb7a5.

armv5tel job: https://hydra.nixos.org/build/111556418
armv6l job: https://hydra.nixos.org/build/111556521
armv7l job: https://hydra.nixos.org/build/111556551
2020-03-06 06:58:20 +01:00
Ben Wolsieffer
4478766b64 make-bootstrap-tools: add libssp to allow stack protector to work 2020-02-18 22:40:30 -05:00
Vladimír Čunát
cc1ae9f21b
make-bootstrap-tools: fixup after glibc update
There's a generated header that got comment about the source header
from glibc.dev, which added unwanted runtime dependency.  Tested:
nix build -f pkgs/top-level/release.nix stdenvBootstrapTools.{aarch64,i686,x86_64}-linux.test
2020-02-10 17:31:35 +01:00
Frederik Rietdijk
03755ed59a Merge master into staging-next 2020-02-09 09:17:51 +01:00
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
Vladimír Čunát
cf242659fe
stdenv bootstrap tools: switch one file to official URL 2020-02-05 13:59:18 +01:00
Vladimír Čunát
48a997cd76
Merge #66528: glibc: 2.27 -> 2.30 (into staging)
Includes update of stdenv bootstap tools (for three main platforms)
and many package fixes with new glibc.
2020-02-05 13:41:09 +01:00
Vladimír Čunát
53349b9c27
stdenv bootstrap tools: regenerate "officialy"
From Hydra's binaries for c5aabb0 (19.09).
This time I re-tested full stdenv bootstrap on these three platforms.
https://github.com/NixOS/nixpkgs/pull/66528#issuecomment-582351637
2020-02-05 13:04:13 +01:00
Frederik Rietdijk
e4c28f78e7 Merge staging-next into staging 2020-02-02 15:33:13 +01:00
Maximilian Bosch
ea8ae88f04
Merge branch 'staging' into glibc230 2020-02-01 17:42:03 +01:00
Daiderd Jordan
68513e4071
cmake: move CMAKE_OSX_ARCHITECTURES out of the stdenv
This was initially introduced in 92188d9d17,
not clear how relevant this still is but i686 isn't supported anymore so
disable it explicitly.
2020-01-31 21:52:13 +01:00
Daiderd Jordan
6567823996
stdenv: introduce appleSdkVersion and macosVersionMin 2020-01-31 21:52:11 +01:00
Daiderd Jordan
a826b49c97
stdenv: make darwin builds reproducable
Fixes #21629

Passing these extra linker flags removes both the semi-random uuid
included in most binaries as well as making the sdk version consistent
instead of based on the current os version.

    Load command 8
         cmd LC_UUID
     cmdsize 24
        uuid 70FAF921-5DC8-371C-B814-4F121FADFDF4

    Load command 9
          cmd LC_VERSION_MIN_MACOSX
      cmdsize 16
      version 10.12
          sdk 10.13

The -macosx_version_min flag isn't strictly necessary since that's
already handled by MACOSX_DEPLOYMENT_TARGET.
2020-01-31 21:52:07 +01:00
Luka Blaskovic
c206bf12ab stdenv, darwin: fix setupHook location 2020-01-30 18:35:30 -05:00
Maximilian Bosch
eddfcc32b4
Merge branch 'staging' into glibc230 2020-01-23 11:31:13 +01: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
Frederik Rietdijk
bc18cc72dd
Merge pull request #77610 from LnL7/darwin-stdenv-python3
darwin-stdenv: bootstrap with python3
2020-01-15 09:24:57 +01:00
Maximilian Bosch
2d36eac780 stdenv: rebuild aarch64 bootstrap files with gcc8
The old bootstrapping files would break with glibc 2.30 as at least gcc6
is needed.
2020-01-14 08:52:25 +00:00
Vladimír Čunát
2aea16c4d6 glibc: depend on libidn2 (and libunistring, transitively)
It's a bit hacky, but ATM I can't see any better way for glibc >= 2.28.

Signed-off-by: Luka Blaskovic <lblasc@tvbeat.com>
2020-01-14 08:27:00 +00:00
Vladimír Čunát
0c75f51304 stdenv bootstrap: disable dejagnu tests
There's a failure - I don't know why.  The checks from "normal" dejagnu
still succeed, so I assume this commit is quite a safe work-around.
2020-01-14 08:27:00 +00:00
Luka Blaskovic
e80a85a057 bootstrap-files: bump WIP 2020-01-14 08:26:58 +00:00
Daiderd Jordan
6328518e98
stdenv: bootstrap darwin with python3
- Replaced python override from the final stdenv, instead we
  propagate our bootstrap python to stage4 and override both
  CF and xnu to use it.

- Removed CF argument from python interpreters, this is redundant
  since it's not overidden anymore.

- Inherit CF from stage4, making it the same as the stdenv.
2020-01-13 11:34:36 +01:00
Dmitry Kalinkin
d05ee9c8ff
pkgsStatic: set BUILD_SHARED_LIBS=OFF for cmake 2020-01-03 11:31:17 -05: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
John Ericson
c1fb358a78 Merge remote-tracking branch 'obsidian/ghcjs-cross-without-cc-common' into ghcjs-cross-without-cc 2019-12-30 18:16:22 -05:00
John Ericson
6078f094c6 pkgs/stdenv/booter.nix: Add comment explaining hasCC trickery 2019-12-30 18:09:45 -05: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
c4508df25d Merge remote-tracking branch 'obsidian/ghcjs-cross-without-cc-19.09' into ghcjs-cross-without-cc 2019-11-26 12:58:13 -05:00
John Ericson
8737963735 Fix lib tests
js-ghcjs didn't fit in an existing categor.
2019-11-26 12:57:16 -05: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
c739c420db Add support for cross compiling to js-ghcjs
This platform doesn't have a C compiler, and so relies and the changes
in the previous commit to work.
2019-11-25 00:12:38 +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
Matthew Bauer
a6a3958c26
Merge pull request #72070 from graham33/fix/license_list
Fix handling of lists in whitelistedLicenses and blacklistedLicenses
2019-11-03 12:08:41 -05:00
Will Dietz
43c721df4a make-bootstrap-tools: use 'extreme' option to reduce size but not cost
Apparently this option trades compression time for size,
and explicitly does so without increasing resources needed in decomp.

Doesn't make tarball creation unbearable, so add it to options!
2019-11-03 14:52:44 +01:00
Will Dietz
78d3cb1d16 binutils: offer "for bootstrap" variant that's less.. feature-complete 2019-11-03 14:52:44 +01:00
Will Dietz
5b46a7c240 gcc7: make building w/LTO support optional, don't use in bootstrap tools 2019-11-03 14:52:44 +01: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
John Ericson
2811b032d6 treewide: Make still dont* Variables are optional in most cases
Go beyond the obvious setup hooks now, with a bit of sed, with a skipped case:

 - cc-wrapper's `dontlink`, because it already is handled.

Also, in nix files escaping was manually added.

EMP
2019-11-01 14:44:44 -04: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
Matthew Bauer
d8b7b95ac6 Merge remote-tracking branch 'origin/master' into staging 2019-09-20 23:25:24 -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
Matthew Bauer
07d78691da stdenv/adapters.nix: remove static from makeStaticLibraries
This logic should be in the pkgs/top-level/static.nix. We don’t want
to pollute Nixpkgs with =if stdenv.static=. Also, "static" is not
descriptive. We have two types of static stdenvs, ‘makeStaticLibaries’
and ‘makeStaticBinaries’. We shouldn’t rely on a static boolean like
this.
2019-09-19 12:52:28 -04: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
Vladimír Čunát
f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
John Ericson
c33d80c071 Merge remote-tracking branch 'upstream/master' into feature/js-unknown-ghcjs 2019-09-02 01:31:31 -04:00
Moritz Angermann
446f8c851d Add support for js-unknown-ghcjs
This adds enough logic to nixpkgs to support the `js-unknown-ghcjs` triple.
2019-09-02 01:27:05 -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
Matthew Bauer
166905cb31
Merge pull request #65484 from arcnmx/pr-stdenv-cmake-cross
stdenv: correct cross CMAKE_SYSTEM_NAME
2019-08-14 10:17:12 -04:00
Frederik Rietdijk
55e4555b77 Merge master into staging-next 2019-08-01 09:42:54 +02: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
Tobias Mayer
bb71bb15ce pkgsStatic: propagate all buildInputs 2019-07-24 16:04:51 +02:00
Tobias Mayer
3c12ae1d35 Signal static build option in makeStaticLibraries
This flag can replace the extra static parameter to packages that
don't work automatically with this adapter.
2019-07-21 06:44:50 +02:00
Daiderd Jordan
f1070eec27
stdenv: MACOSX_DEPLOYMENT_TARGET 10.10 -> 10.12 2019-07-08 21:56:40 +02: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
b4ae841b23
Merge branch 'staging-next' into staging 2019-05-26 09:48:55 +02: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
Matthew Bauer
5ba633970b
Merge pull request #61169 from matthewbauer/meson-static
static: set default_library flag for meson in makeStaticLibrary
2019-05-18 15:02:33 -05:00
Robin Gloster
6cf583cf2f
Merge pull request #60406 from JohnAZoidberg/remove-isnull
treewide: Remove usage of isNull
2019-05-18 09:36:24 +00: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