Commit Graph

533278 Commits

Author SHA1 Message Date
Maximilian Bosch
c8f5c30c37
pkgs/build-support: refactor drvs using __structuredAttrs = true
Derivations affected by this patch set `__structuredAttrs = true;` and
provide their own `builder`, i.e. it's necessary to `source .attrs.sh`.

Rather than adding even more `if`-`source` monstrums, I decided to
modify all of those derivations to use `buildCommand` or `runCommand`,
without `builder` being set.

Then, `$stdenv/setup` is sourced already and as a result it's safe to
assume that `NIX_ATTRS_JSON_FILE`/`NIX_ATTRS_SH_FILE` point to a usable
location both in a build and a shell session.
2023-10-04 18:37:00 +02:00
Maximilian Bosch
8bc5104a6e
treewide: refactor .attrs.sh detection
When specifying the `builder` attribute in `stdenv.mkDerivation`, this
will be effectively transformed into

    builtins.derivation {
      builder = stdenv.shell;
      args = [ "-e" builder ];
    }

This also means that `default-builder.sh` is never sourced and as a
result it's not guaranteed that `$NIX_ATTRS_SH_FILE` is set to a correct
location[1].

Also, we need to source `.attrs.sh` to source `$stdenv`. So, the
following is done now:

* If `$NIX_ATTRS_SH_FILE` points to a correct location, then use it.
  Directly using `.attrs.sh` is problematic for `nix-shell(1)` usage
  (see previous commit for more context), so prefer the environment
  variable if possible.

* Otherwise, if `.attrs.sh` exists, then use it. See [1] for when this
  can happen.

* If neither applies, it can be assumed that `__structuredAttrs` is
  turned off and thus nothing needs to be done.

[1] It's possible that it doesn't exist at all - in case of Nix 2.3 or
    it can point to a wrong location on older Nix versions with a bug in
    `__structuredAttrs`.
2023-10-04 18:36:57 +02:00
Maximilian Bosch
53c5f08415
stdenv: refactor .attrs.sh detection
Relying on `.attrs.sh` to exist in `$NIX_BUILD_TOP` is problematic
because that's not compatible with how `nix-shell(1)` behaves. It places
`.attrs.{json,sh}` into a temporary directory and makes them accessible via
`$NIX_ATTRS_{SH,JSON}_FILE` in the environment[1]. The sole reason that
`nix-shell(1)` still works with structured-attrs enabled derivations
is that the contents of `.attrs.sh` are sourced into the
shell before sourcing `$stdenv/setup` (if `$stdenv` exists) by `nix-shell`.

However, the assumption that two files called `.attrs.sh` and
`.attrs.json` exist in `$NIX_BUILD_TOP` is wrong in an interactive shell
session and thus an inconsistency between shell debug session and actual
builds which can lead to unexpected problems.

To be precise, we currently have the following problem: an expression
like

  with import ./. {};
  runCommand "foo" { __structuredAttrs = true; foo.bar = [ 1 2 3 ]; }
    ''
      echo "''${__structuredAttrs@Q}"
      touch $out
    ''

prints `1` in its build-log. However when building interactively in a
`nix-shell`, it doesn't.

Because of that, I'm considering to propose a full deprecation of
`$NIX_BUILD_TOP/.attrs.{json,sh}`. A first step is to only mention the
environment variables, but not the actual paths anymore in Nix's
manual[2]. The second step - this patch - is to fix nixpkgs' stdenv
accordingly.

Please note that we cannot check for `-e "$NIX_ATTRS_JSON_FILE"` because
certain outdated Nix minors (that are still in the range of supported
Nix versions in `nixpkgs`) have a bug where `NIX_ATTRS_JSON_FILE` points
to the wrong file while building[3].

Also, for compatibility with Nix 2.3 which doesn't provide these
environment variables at all we still need to check for the existence of
.attrs.json/.attrs.sh here. As soon as we bump nixpkgs' minver to 2.4,
this can be dropped.

Finally, dropped the check for ATTRS_SH_FILE because that was never
relevant. In nix#4770 the ATTRS_SH_FILE variable was introduced[4] and
in a review iteration prefixed with NIX_[5]. In other words, these
variables were never part of a release and you'd only have this problem
if you'd use a Nix from a git revision of my branch from back then. In
other words, that's dead code.

[1] https://github.com/nixos/nix/pull/4770#issuecomment-834718851
[2] https://github.com/NixOS/nix/pull/9032
[3] https://github.com/NixOS/nix/issues/6736
[4] 3944a120ec
[5] 27ce722638
2023-10-04 18:35:30 +02:00
Florian Klink
1e41c3352b
Merge pull request #258972 from edef1c/cve-2023-4911
glibc: 2.38-23 -> 2.38-27
2023-10-04 18:39:01 +03:00
Florian Klink
1550a58e14
Merge pull request #258373 from misuzu/systemd-fix
systemd: fix RuntimeError issue when building for armv7l and riscv64
2023-10-04 16:50:42 +03:00
Nick Cao
31a4c3f2e2
Merge pull request #258841 from NickCao/x11-security
xorg.libX11: 1.8.6 -> 1.8.7, xorg.libXpm: 3.5.16 -> 3.5.17
2023-10-04 09:24:16 -04:00
edef
caa3d9d75d
glibc: 2.38-23 -> 2.38-27
Fixes CVE-2023-4911.

Change-Id: I154c79a7c6822051903ef15c547c3567691b1457
2023-10-04 14:19:15 +02:00
github-actions[bot]
2dc3af6ef9
Merge staging-next into staging 2023-10-04 12:01:34 +00:00
github-actions[bot]
c7a3c2d71b
Merge master into staging-next 2023-10-04 12:01:01 +00:00
Mario Rodas
b7750daf11
Merge pull request #258761 from trofi/linuxHeaders-revert-sockaddr_ll-flex
linuxHeaders: revert accidental `struct sockaddr_ll` size change
2023-10-04 06:38:30 -05:00
Mario Rodas
7131f3c223
Merge pull request #258952 from saschagrunert/catatonit
catatonit: 0.1.7 -> 0.2.0
2023-10-04 06:30:54 -05:00
Arnout Engelen
fbd0cc5d53
Merge pull request #258885 from arkivm/fix-inkscape-extensions
Fix inkscape extensions
2023-10-04 13:15:35 +02:00
R. Ryantm
c6c03530da erlang_26: 26.1 -> 26.1.1 2023-10-04 11:04:56 +00:00
OTABI Tomoya
b34e1bd3c3
Merge pull request #258762 from mweinelt/python-3.11.6
python311: 3.11.5 -> 3.11.6
2023-10-04 19:48:57 +09:00
Mario Rodas
6e1d5c4005
Merge pull request #257762 from ryneeverett/exaile-4.1.3
exaile: 4.1.2 -> 4.1.3
2023-10-04 05:41:59 -05:00
Mario Rodas
9648d540d7
Merge pull request #258077 from figsoda/funzzy
funzzy: 1.0.1 -> 1.1.1
2023-10-04 05:36:36 -05:00
Mario Rodas
869be6d111
Merge pull request #258665 from cpu/cpu-ldmud-3.6.7
ldmud: 3.6.6 -> 3.6.7
2023-10-04 05:30:30 -05:00
Mario Rodas
e21413d8a0
Merge pull request #258802 from figsoda/comrak
comrak: 0.18.0 -> 0.19.0
2023-10-04 05:29:07 -05:00
Mario Rodas
1991e35a26
Merge pull request #258945 from fabaff/trufflehog-bump
trufflehog: 3.58.0 -> 3.59.0
2023-10-04 05:26:45 -05:00
Mario Rodas
7640d55fe7
Merge pull request #258941 from r-ryantm/auto-update/nixpacks
nixpacks: 1.15.0 -> 1.17.0
2023-10-04 05:25:23 -05:00
Mario Rodas
4b7efda03e
Merge pull request #258948 from r-ryantm/auto-update/sarasa-gothic
sarasa-gothic: 0.42.0 -> 0.42.1
2023-10-04 05:24:57 -05:00
Mario Rodas
55218efb4c
Merge pull request #258873 from marsam/update-gallery-dl
gallery-dl: 1.25.8 -> 1.26.0
2023-10-04 05:23:46 -05:00
Mario Rodas
32b8bd327c
Merge pull request #258851 from cyrillzadra/bump-podman470
podman: 4.6.2 -> 4.7.0
2023-10-04 05:21:56 -05:00
Mario Rodas
ae2aa4cce9
Merge pull request #258876 from marsam/update-arti
arti: 1.1.8 -> 1.1.9
2023-10-04 05:21:31 -05:00
Doron Behar
34585a2b76
Merge pull request #256866 from kirillrdy/transmission
transmission, transmission_4: set mainProgram and restore nixosTests
2023-10-04 13:20:46 +03:00
Weijia Wang
41f6c3ff5a
Merge pull request #258341 from water-sucks/bruno
bruno: init at 0.17.0
2023-10-04 12:11:20 +02:00
Weijia Wang
71f3ef26f2
Merge pull request #257354 from SuperSandro2000/intel-graphics-compiler
intel-graphics-compiler: 1.0.12812.26 -> 1.0.14828.8
2023-10-04 12:07:31 +02:00
Sascha Grunert
6a62df5a8f
catatonit: 0.1.7 -> 0.2.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-10-04 11:43:14 +02:00
Florian Klink
7239f0198e
Merge pull request #258920 from ElvishJerricco/systemd-stage-1-full-build
systemd-stage-1: Default to full systemd build.
2023-10-04 12:02:36 +03:00
misuzu
7646ffb8bd systemd: fix RuntimeError issue when building for armv7l and riscv64 2023-10-04 11:40:55 +03:00
Florian Klink
42f2e2dadd
Merge pull request #257510 from ign0tus/fix/wake-on-lan-policy
Fix: WakeOnLan policy
2023-10-04 11:36:16 +03:00
Ulrik Strid
8d301f41a1
Merge pull request #256411 from wegank/zelus-init
ocamlPackages.zelus{,-gtk}: init at 2.2
2023-10-04 10:30:35 +02:00
Varun Narravula
30d510d152 bruno: init at 0.17.0 2023-10-04 01:29:25 -07:00
Franz Pletz
d082876654
Merge pull request #258561 from helsinki-systems/upd/conntrack-tools 2023-10-04 10:22:48 +02:00
Will Fancher
710b96b191 systemd-stage-1: Default to full systemd build. 2023-10-04 04:21:35 -04:00
Weijia Wang
8921c70ce0
Merge pull request #258938 from r-ryantm/auto-update/revive
revive: 1.3.3 -> 1.3.4
2023-10-04 10:20:53 +02:00
Franz Pletz
fb0b874a51
Merge pull request #258724 from mfrw/mfrw/prometheus-2.47.0 2023-10-04 10:20:25 +02:00
Florian Klink
d89aa11c89
Merge pull request #258345 from lf-/jade/wait-for-online
nixos/networkd: fix wait-online on networking.useDHCP default configuration
2023-10-04 10:58:14 +03:00
Weijia Wang
77671f856d
Merge pull request #258903 from r-ryantm/auto-update/arkade
arkade: 0.10.7 -> 0.10.10
2023-10-04 09:30:38 +02:00
Weijia Wang
bca33fcd27
Merge pull request #258904 from r-ryantm/auto-update/lsp-plugins
lsp-plugins: 1.2.10 -> 1.2.11
2023-10-04 09:30:04 +02:00
Weijia Wang
a000b56c0a
Merge pull request #258923 from r-ryantm/auto-update/kaniko
kaniko: 1.15.0 -> 1.16.0
2023-10-04 09:29:08 +02:00
Weijia Wang
34d941de42
Merge pull request #258115 from wegank/qgis-exiv2
qgis, qgis-ltr: add patch for exiv2 0.28
2023-10-04 09:21:31 +02:00
Doron Behar
d478d2c6b6
Merge pull request #258811 from Enzime/qalculate-bundle
qalculate-gtk: generate bundle on macOS
2023-10-04 10:17:45 +03:00
Weijia Wang
bc1d216bb2 ocamlPackages.zelus-gtk: init at 2.2 2023-10-04 09:11:26 +02:00
Weijia Wang
cd8f19163a ocamlPackages.zelus: init at 2.2 2023-10-04 09:11:22 +02:00
Fabián Heredia Montiel
38b9119cff
Merge pull request #258192 from markuskowa/split-scalpack
scalapack: split outputs -> out, dev
2023-10-04 01:02:00 -06:00
Fabián Heredia Montiel
a0db6b6b13
Merge pull request #258191 from markuskowa/split-elpa
elpa: split outputs and enable parallel builds
2023-10-04 00:56:26 -06:00
Matthias Beyer
27398bd14e
Merge pull request #258865 from r-ryantm/auto-update/kdash
kdash: 0.4.2 -> 0.4.3
2023-10-04 08:54:20 +02:00
Weijia Wang
79dc25b48d licenses: add inria-zelus 2023-10-04 08:47:08 +02:00
R. Ryantm
a0ec895413 sarasa-gothic: 0.42.0 -> 0.42.1 2023-10-04 06:37:15 +00:00