Commit Graph

1996 Commits

Author SHA1 Message Date
John Ericson
221ca6f2ff
Merge pull request #134463 from Ericson2314/stdenv-adapter-latebind
stdenv: Fix overriding + `overrideAttrs`
2021-08-18 19:01:54 -04:00
John Ericson
b4cc2a2479 pkgs/stdenv/make-derivation: Reindent
We previously make it just be the function, not a single-item attrset,
without deindenting to make a readable diff. No we deindent.
2021-08-18 17:22:52 +00:00
John Ericson
f110a182a6 stdenv: Fix overriding + overrideAttrs
The old stdenv adapters were subtly wrong in two ways:

 - `overrideAttrs` leaked the original, unoverridden `mkDerivation`.

 - `stdenv.override` would throw away any manually-set `mkDerivation`
   from a stdenv reverting to the original.

Now, `mkDerivation` is controlled (nearly directly) via an argument, and
always correctly closes over the final ("self") stdenv. This means the
adapters can work entirely via `.override` without any manual `stdenv //
...`, and both those issues are fixed.

Note hashes are changed, because stdenvs no previously overridden like
`stdenvNoCC` and `crossLibcStdenv` now are. I had to add some
`dontDisableStatic = true` accordingly. The flip side however is that
since the overrides compose, we no longer need to override anything but
the default `stdenv` from which all the others are created.
2021-08-18 17:22:50 +00:00
github-actions[bot]
1b4a28fed4
Merge master into staging-next 2021-08-07 12:01:25 +00:00
Artturin
40944bbab7 stdenv/check-meta: add maxSilent
Hydra supports it
https://github.com/NixOS/hydra/blob/master/src/hydra-eval-jobs/hydra-eval-jobs.cc#L172
2021-08-07 02:18:59 +03:00
Alyssa Ross
0901dfb214 stdenv/setup: force libtool to skip dep checks
When we "fix" libtool, we empty out its system library path to avoid
it discovering libraries in e.g. /usr when the sandbox is disabled.
But this also means that the checks libtool does to make sure it can
find the libraries its supposed to be linking to won't work.  On Linux
and Darwin, this isn't a problem, because libtool doesn't actually
perform any checks, but it is on at least NetBSD and Cygwin[1].

So, we force libtool not to do these checks on any platform, bringing
the more exotic platforms into line with the existing behaviour on
Linux and Darwin.

Without this change, lots of library packages produce warnings like
this in their build output on the platforms with checks by default:

    *** Warning: linker path does not have real file for library -lz.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libz but no candidates were found. (...for regex pattern test)
    *** The inter-library dependencies that have been dropped here will be
    *** automatically added whenever a program is linked with this library
    *** or is declared to -dlopen it.

And dependent packages break because libtool doesn't link their
transitive dependencies.  So making this change fixes _lots_ of
packages on those platforms.

[1]: https://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?id=544fc0e2c2a03129a540aebef41ad32bfb5c06b8#n3445
2021-07-27 20:42:31 +00:00
Jörg Thalheim
7bf8b97d68
Merge pull request #130601 from happysalada/stdenv_cosmetic
Stdenv cosmetic
2021-07-23 09:45:43 +01:00
happysalada
4fc50527f8 stdenv: typo 2021-07-19 14:49:47 +09:00
Vladimír Čunát
4bd38c330f
Revert #127736: stdenv changes towards an alternative shell
At least for now.  Such changes are risky (we have very many packages),
and apparently it needs more testing/review without blocking other
changes.

This reverts the whole range 4d0e3984918^..8752c327377,
except for one commit that got reverted in 6f239d7309 already.
(that MR didn't even get its merge commit)
2021-07-17 20:39:47 +02:00
Vladimír Čunát
88a6ee04bf
Merge #129854: stdenv/darwin: finalize URLs (into staging-next) 2021-07-16 17:41:02 +02:00
Vladimír Čunát
2a44031d56
stdenv/make-bootstrap-tools: nuke yet another header
This is needed after glibc bump from PR #111616.
2021-07-16 16:15:32 +02:00
Vladimír Čunát
f47ee76a6a
stdenv/darwin: switch to the official bootstrap URLs 2021-07-16 10:44:04 +02:00
Vladimír Čunát
3b437b95df
Merge #129854: stdenv/darwin: update bootstrap tools
... for x86_64-darwin (into staging-next)
It wouldn't bootstrap otherwise.

Unfortunately we still haven't managed to get the tarballs
on the proper URLs, but GitHub should be reliable enough
and surely almost noone will bootstrap themselves anyway.
2021-07-16 10:26:10 +02:00
Vladimír Čunát
6f239d7309
Revert "setup.sh: fatal: This word should yield a string, but it contains an array"
This reverts commit bf99a819a1.
It caused regressions in some packages; see:
https://github.com/NixOS/nixpkgs/commit/bf99a819a160
2021-07-16 10:00:29 +02:00
Vladimír Čunát
d6a51653d7
stdenv/darwin: update bootstrap tools for x86_64-darwin
Updated python3 will block bootstrapping otherwise.

Verification instructions:
$ xdg-open https://hydra.nixos.org/build/144118577#tabs-details
$ nix build /nix/store/sh9cd0rarr8a2db1zdr4fzl4qsmvz5jp-stdenv-bootstrap-tools
$ cat /nix/store/sh9cd0rarr8a2db1zdr4fzl4qsmvz5jp-stdenv-bootstrap-tools/nix-support/hydra-build-products
$ nix hash-path /nix/store/9h4d7s313wv3gkfwi493yr1wvdsz9lf2-stdenv-bootstrap-tools/on-server/{sh,bzip2,mkdir,cpio}
sha256-igMAVEfumFv/LUNTGfNi2nSehgTNIP4Sg+f3L7u6SMA=
sha256-K3rhkJZipudT1Jgh+l41Y/fNsMkrPtiAsNRDha/lpZI=
sha256-VddFELwLDJGNADKB1fWwWPBtIAlEUgJv2hXRmC4NEeM=
sha256-SWkwvLaFyV44kLKL2nx720SvcL4ej/p2V/bX3uqAGO0=
$ nix hash-file /nix/store/9h4d7s313wv3gkfwi493yr1wvdsz9lf2-stdenv-bootstrap-tools/on-server/bootstrap-tools.cpio.bz2
sha256-b65dXbIm6o6s6U8tAiGpR6SMfvfn/VFcZgTHBetJZis=
2021-07-10 17:03:40 +02:00
Vladimír Čunát
7c25c1fd88
Merge branch 'glibc-2.33' into staging 2021-07-06 16:17:13 +02:00
Vladimír Čunát
5a71fa8447
stdenv bootstrap: hack around glibc version mismatch
With this we shouldn't need other workarounds for the LTO problems.
2021-07-06 16:02:11 +02:00
Raphael Megzari
cf5882f27c Update pkgs/stdenv/generic/setup.sh:use [[ instead of [
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
Raphael Megzari
2c3b847d29 Update pkgs/stdenv/generic/setup.sh: use [[ instead of [
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
Raphael Megzari
80c9096d9c Update pkgs/stdenv/generic/setup.sh: group var declaration
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
Raphael Megzari
bcdfbfa19f Update pkgs/stdenv/generic/setup.sh: group var declaration
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
happysalada
06688b73ca setup.sh: separate command from combined conditional 2021-07-06 09:27:18 +09:00
Raphael Megzari
caeb3c915f Update pkgs/stdenv/generic/setup.sh
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
happysalada
5f8b5465e1 setup.sh: remove bash empty array old hack 2021-07-06 09:27:18 +09:00
happysalada
fc5438bfcf setup.sh: use [[ for combined conditionals 2021-07-06 09:27:18 +09:00
happysalada
5617feb330 setup.sh: remove extraneous cat cmd 2021-07-06 09:27:18 +09:00
happysalada
1f255cbe5c setup.sh: arithmetic conditional style
used "recommended" arithmetic conditional style
2021-07-06 09:27:18 +09:00
happysalada
9f156d0adc setup.sh: fatal: Undefined variable
define hook arrays before assigning to them
2021-07-06 09:27:18 +09:00
happysalada
bf99a819a1 setup.sh: fatal: This word should yield a string, but it contains an array
remove implicit array comparison in case
2021-07-06 09:27:18 +09:00
happysalada
1a71a5fb08 setup.sh: shellcheck disable=SC1091
https://github.com/koalaman/shellcheck/wiki/SC1091
2021-07-06 09:27:18 +09:00
happysalada
b1c5a9f008 setup.sh: shellcheck disable=SC2034
https://github.com/koalaman/shellcheck/wiki/SC2034
2021-07-06 09:27:18 +09:00
happysalada
740582739c setup.sh: missing white space 2021-07-06 09:27:18 +09:00
happysalada
faca9440fb setup.sh: add quotes where semantically valid 2021-07-06 09:27:18 +09:00
happysalada
5f01543070 setup.sh: fatal: Invalid integer constant 'relHostOffset'
dereference variables passed to mapOffset
2021-07-06 09:27:18 +09:00
happysalada
958c180d1f setup.sh: shellcheck disable=SC2123
https://github.com/koalaman/shellcheck/wiki/SC2123
2021-07-06 09:27:18 +09:00
happysalada
8dbbd8fbe3 setup.sh: shellcheck disable=SC1090
https://github.com/koalaman/shellcheck/wiki/SC1090
2021-07-06 09:27:18 +09:00
happysalada
796f1cdbea shellcheck disable=SC2148
https://github.com/koalaman/shellcheck/wiki/SC2148
2021-07-06 09:27:18 +09:00
happysalada
422579f718 shellcheck disable=SC2154
https://github.com/koalaman/shellcheck/wiki/SC2154
2021-07-06 09:27:18 +09:00
happysalada
b49f22fd3e setup.sh: replace type -p with test -e
type -p will exit 1 on failure.
Test makes the intent clearer here.
2021-07-06 09:27:18 +09:00
happysalada
ac27528177 setup.sh: arithmetic fixes
this one is a little more controversial
see https://github.com/oilshell/oil/issues/864
for more information
2021-07-06 09:27:18 +09:00
happysalada
c335a18ea5 setup.sh: shellcheck 2206 + 2207
https://github.com/koalaman/shellcheck/wiki/SC2206
https://github.com/koalaman/shellcheck/wiki/SC2207

admittedly this one is a lot less pretty
2021-07-06 09:27:18 +09:00
happysalada
430fdb7e0d setup.sh: shellcheck 2086
https://github.com/koalaman/shellcheck/wiki/SC2086
2021-07-06 09:27:18 +09:00
happysalada
40ad05b4cb builder.sh: check if variable is non null
This is not the "correct" way to check if a variable is non null in
bash. There is already an instance of the "right" way to do it in
setup.sh. Bash is "generous" enough to accept the original input though.
I couldn't find the relevant shellcheck.
2021-07-06 09:27:18 +09:00
happysalada
e39ee04d97 builder.sh: shellcheck 2129
https://github.com/koalaman/shellcheck/wiki/SC2129
2021-07-06 09:27:18 +09:00
happysalada
4d0e398491 builder.sh: shellcheck 2086
https://github.com/koalaman/shellcheck/wiki/SC2086
2021-07-06 09:27:18 +09:00
Niklas Hambüchen
3ac484ef83
Merge pull request #129328 from nh2/manual-fix-hardening-flags-sections
manual: hardening: Fix disabled flags prose being in previous section
2021-07-05 23:11:22 +02:00
Niklas Hambüchen
ac36a0f9eb manual: hardening: Fix disabled flags prose being in previous section
This confused the hell out of me, as I didn't spot the

> The following flags are disabled by default ...

when reading about `pie`, because that sentence was hidden in the
previous hardening flag's section.

Also explain that `pie` hardening is on by default on musl.
2021-07-05 16:32:55 +02:00
Sandro
d871186cdf
Merge pull request #108102 from matthewbauer/bash-version-check
stdenv/setup.sh: Add version check to setup script
2021-06-24 13:06:46 +02:00
Matthew Bauer
8fa084dc0f stdenv/setup.sh: Add version check to setup script
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
2021-06-23 01:32:58 -05:00
Jan Tojnar
e3dfa79441
Merge branch 'staging-next' into staging
Regenerated pkgs/servers/x11/xorg/default.nix to resolve the conflict.
2021-06-16 19:59:05 +02:00