nixpkgs/pkgs/test
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
..
cc-wrapper tests.cc-wrapper.supported: add test for cxxabi header 2023-09-18 06:43:36 +05:30
coq
cross tests.cross.sanity: add armv5tel and armv6l 2023-08-15 19:11:09 -07:00
cuda
cue
dhall
dotnet
haskell Merge master into haskell-updates 2023-07-26 00:13:28 +00:00
hooks
install-shell-files
ld-library-path
macos-sierra-shared
make-binary-wrapper makeBinaryWrapper: protect wildcards in flags 2023-09-18 02:49:33 -04:00
make-hardcode-gsettings-patch
make-wrapper
nixos-functions
nixpkgs-check-by-name Merge pull request #256913 from xfix/make-nixpkgs-check-by-name-tests-thread-safe 2023-09-23 23:31:49 +02:00
php
simple treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
stdenv
stdenv-inputs
texlive texlive.bin.core-big: enable upmendex 2023-08-29 16:16:15 +01:00
top-level pkgs/top-level: use lib.systems.equals for crossSystem 2023-09-13 07:22:52 +03:00
vim vimUtils: buildVimPluginFrom2Nix renamed to buildVimPlugin 2023-09-27 19:08:38 +02:00
config.nix
default.nix pkgs/top-level: use lib.systems.equals for crossSystem 2023-09-13 07:22:52 +03:00
kernel.nix
overriding.nix