nixpkgs/pkgs/build-support
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
..
add-opengl-runpath
agda
alternatives
appimage appimage-run: add pciutils for FreeCAD 2023-09-28 19:15:01 +02:00
binary-cache binary-cache: use lib.makeBinPath 2023-06-30 00:42:14 +02:00
bintools-wrapper bintools-wrapper: fix dynamic linker for powerpc64 big-endian 2023-09-11 13:55:43 +02:00
build-bazel-package buildBazelPackage: add support for bazel run targets 2023-08-02 16:05:55 +08:00
build-fhsenv-bubblewrap Merge pull request #257122 from bjornfor/fix-buildfhsenv-pname 2023-10-01 13:55:09 +02:00
build-fhsenv-chroot buildFHSEnv: fix NIX_LDFLAGS propagation to ld wrapper 2023-08-21 07:50:37 +01:00
build-graalvm-native-image graalvm-ce: 22.3.1 -> 21.0.0 2023-09-27 10:25:44 +01:00
build-setupcfg
buildenv buildenv: Limit exclusion of info/dir 2023-07-09 22:06:26 -04:00
cc-wrapper Merge pull request #255488 from natto1784/libcxxabi 2023-09-20 09:12:51 +03:00
coq
dart buildDartApplication: Supply CA bundle to Dart in FOD 2023-08-29 13:12:15 +02:00
deterministic-uname deterministic-uname: fix default output 2023-09-17 00:08:43 +03:00
dhall
docker dockerTools: use makeOverridable for buildImage family of functions 2023-09-11 21:10:37 +01:00
dotnet Merge pull request #249091 from TomaSajt/dotnet-fix 2023-08-23 14:04:47 +09:00
emacs emacs: allow using as shebang on darwin 2023-09-24 19:50:52 -03:00
expand-response-params
fake-nss
fetch9front lib: add fetchFrom9Front 2023-07-23 13:16:28 -05:00
fetchbitbucket treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchbower
fetchbzr treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchcvs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchdarcs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchdebianpatch fetchDebianPatch: Require patch names with extensions 2023-09-14 18:55:30 +00:00
fetchdocker treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchfirefoxaddon fetchfirefoxaddon: fix passing md5 to fetchurl 2023-07-28 16:18:15 -04:00
fetchfossil treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchgit treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchgitea treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgithub treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
fetchgitiles treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgitlab treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgitlocal treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgx
fetchhg treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchipfs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchmavenartifact
fetchmtn treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchnextcloudapp fetchNextcloudApp: remove backwards compat for old interface 2023-08-20 13:41:43 +02:00
fetchpatch
fetchpijul build-support: Add fetchpijul function. 2023-07-17 18:44:06 +02:00
fetchpypi
fetchrepoorcz
fetchrepoproject fetchrepoproject: fix a bug that was there since bef6bef0d2 2023-08-06 12:17:09 +00:00
fetchs3
fetchsavannah treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchsourcehut fetchFromSourcehut: expose gitRepoUrl to consumers 2023-06-11 09:02:34 +01:00
fetchsvn treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchsvnrevision
fetchsvnssh treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchurl treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchzip fetchzip: cleanup and improve metrics a bit 2023-08-08 13:25:28 +00:00
flutter Merge pull request #239570 from hacker1024/feature/flutter-wrapper-gapps 2023-09-20 23:34:26 +02:00
go Revert "buildGoModule: set GOPROXY to go default" 2023-08-22 09:20:22 +10:00
icon-conv-tools
install-shell-files
java
kernel make-initrd-ng: use hostPlatform.ubootArch for uinitrdArch 2023-08-14 01:34:08 -07:00
libredirect libredirect: Fix segfault handling null paths 2023-08-19 00:58:43 +02:00
make-darwin-bundle writeDarwinBundle: use binary wrapper 2023-08-21 13:29:12 +10:00
make-desktopitem
make-hardcode-gsettings-patch
make-pkgconfigitem
make-startupitem make-startupitem: fix typo in comment 2023-08-16 18:03:02 +02:00
mkshell
mono-dll-fixer
nix-gitignore Merge pull request #239624 from Stunkymonkey/use-optionalString-then 2023-07-22 13:02:47 +02:00
node fetch-yarn-deps: warn on undefined expected hash 2023-09-27 00:17:40 +00:00
nuke-references
ocaml ocamlPackages.buildTopkgPackage: Added 2023-09-28 12:03:20 +02:00
oci-tools
php phpPackages.composer: 2.6.3 -> 2.6.4 2023-09-29 12:25:04 +02:00
pkg-config-wrapper treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
portable-service
prefer-remote-fetch
references-by-popularity
release treewide: use lib.optionalAttrs 2023-07-24 21:59:17 +02:00
remove-references-to Merge pull request #162447 from thefloweringash/remove-references-to-region 2023-05-17 12:34:28 +03:00
replace-secret
rust rust.toRustTargetForUseInEnvVars: support custom targets 2023-10-03 12:30:04 +00:00
setup-hooks autoPatchelfHook: add patchelfFlags option 2023-09-30 10:26:35 +03:00
singularity-tools
snap
src-only nixos/tests: Test that Remote SSH can patch Node 2023-06-09 18:21:41 +10:00
substitute
substitute-files
templaterpm
testers testers.testMetaPkgConfig: fix warning 2023-09-19 16:11:42 +02:00
trivial-builders writers.writeCBin: fix binary name when cross-compiling 2023-09-21 04:13:45 +03:00
vm build-support/vm: fix makeImageTestScript 2023-08-24 09:09:43 +01:00
wrapper-common wrapBintoolsWith: support LINK.EXE-style args in purity checks 2023-04-29 01:37:00 +00:00
writers Merge branch 'staging-next' into staging 2023-08-05 07:45:29 +02:00
build-maven.nix
closure-info.nix
make-impure-test.nix
plugins.nix
replace-dependency.nix
setup-systemd-units.nix
source-from-head-fun.nix