669 Commits

Author SHA1 Message Date
Arne Keller 74ebbfaf0b make{Script; Binary}Wrapper: log if target file does not exist (#384765) 2026-07-04 10:59:59 +00:00
nixpkgs-ci[bot] 87a9b3959a Merge staging-next into staging 2026-06-17 00:51:16 +00:00
Guillaume Maudoux 6aa26dc716 various: move some hooks to pkgs/by-name (#532125) 2026-06-16 22:25:06 +00:00
Stefan Frijters 720365f01c wrapGAppsHook: only wrap out/$outputBin by default (#526688) 2026-06-16 20:01:39 +00:00
nixpkgs-ci[bot] 2eaa7a755f Merge staging-next into staging 2026-06-16 00:56:26 +00:00
Michael Daniels 258f97415d various: move some hooks to pkgs/by-name 2026-06-15 19:37:11 -04:00
Michael Daniels 392f1151c7 installFonts: move to pkgs/by-name
This will prevent unnecessary pings, as seen in
https://github.com/NixOS/nixpkgs/issues/532030#issuecomment-4711382871
2026-06-15 17:39:58 -04:00
Stefan Frijters 5767290bcd wrapGAppsHook: add tests for multiple outputs 2026-06-15 18:52:51 +02:00
Stefan Frijters e858e80fb1 wrapGAppsHook: only wrap $outBin by default 2026-06-15 18:52:51 +02:00
Stefan Frijters e64ef4b137 wrapGAppsHook: make more bash variables local 2026-06-09 10:09:11 +02:00
nixpkgs-ci[bot] 50d9dbad25 Merge staging-next into staging 2026-06-04 00:54:51 +00:00
Michael Daniels a2b7689338 envypn-font: use installFonts (#513541) 2026-06-03 23:00:45 +00:00
nixpkgs-ci[bot] f50dc660d4 Merge staging-next into staging 2026-05-28 18:54:19 +00:00
Eman Resu a070adc9c8 setup-hooks/wrap-gapps-hook: remove assertMsg usage 2026-05-26 14:15:03 -04:00
Sigmanificient 6bbf6293ea installFonts: install pcf.gz 2026-05-25 21:47:15 +02:00
nixpkgs-ci[bot] 13e9f64a65 Merge staging-next into staging 2026-05-25 18:35:07 +00:00
Sigmanificient 0bbc8dffae treewide: set meta.license on hooks 2026-05-25 13:48:20 +02:00
Stefan Frijters 128c058fbe wrapGAppsHook: prepare for structuredAttrs (#511330) 2026-05-24 12:56:07 +00:00
pancaek 980931056e installFonts: make preInstall hook 2026-05-22 00:58:08 +02:00
Stefan Frijters a0ee897044 wrapGAppsHook: prepare for structuredAttrs
This hook is called in the fixupPhase via

```
local output
for output in $(getAllOutputNames); do
  prefix="${!output}" runHook fixupOutput
done
```

Without `__structuredAttrs`, `getAllOutputNames` returns the `output` array, in order.
However, with `__structuredAttrs`, it returns the keys of the `output` associative array,
which are no longer necessarily ordered in the same way.

In the case of some packages (e.g. `mate-panel-with-applets`) this means that instead of
`[ "out" "man" ]`, we process `[ "man" "out" ]`. Running the hook for `"man"` then sets
`wrapGAppsHookHasRun` and no wrapping is done for `"out"`, which is what was really needed.

Instead, keep track of whether the hook has run on a per-output basis. That way, the order
does not matter and any executables that are spread around multiple outputs are wrapped.
2026-05-18 15:34:13 +02:00
eveeifyeve 3a1d1f70ce installFonts: add warning about webfonts when woff/woff2 file are present 2026-05-05 00:31:15 +10:00
Jo aba74a9054 installFontsHook: install some more font formats
This adds support for installing type1 fonts and their support files, OpenType-collections and x11 specific formats.
2026-04-01 12:23:24 +02:00
Jo 1d100db921 installFontsHook: install psfu fonts 2026-03-30 22:36:22 +02:00
pancaek ed2072a520 installFonts: init hook 2026-02-27 12:39:45 -08:00
David McFarland a61e4dbb18 cygwin-dll-link: move from make-derivation to cross stdenv 2026-02-08 19:47:24 -04:00
David McFarland 208e7dd03b cygwin-dll-link: fix shellcheck warnings 2026-02-08 13:08:11 -04:00
David McFarland b23c8ab816 cygwin-dll-link: fix indentation 2026-01-25 11:24:06 -04:00
Wolfgang Walther 46c0c0eae7 Merge branch 'staging-next' into staging 2025-12-10 18:42:31 +01:00
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
DavHau c66b12ff90 make-symlinks-relative.sh: optimize - use multiple cores
This optimizes the performance of the hook on machines with multiple cores.

The previous implementation was slow, as it was launching two extra processes per symlink (readlink and ln) while not making use of multiprocessing.

The following improvements were made:
- don't even execute the hook if dontRewriteSymlinks is set
- replace multiple find calls with single find call over all outputs
- use xargs -P to process symlinks in parallel
- add test to check that the hook operates as expected
2025-12-03 11:39:52 +07:00
nixpkgs-ci[bot] 5059ffbd3f Merge staging-next into staging 2025-11-26 12:08:06 +00:00
Connor Baker caac26618a arrayUtilities.getRunpathEntries: init
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
2025-11-25 01:15:31 +00:00
polyfloyd 637727353c perlPackages: Deprecate shortenPerlShebang 2025-11-15 19:33:37 +01:00
Ross Smyth 89be9a6225 copyDesktopItems: Support derivations with structuredAttrs 2025-10-16 14:30:10 -04:00
NAHO c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
David McFarland a56ff336a7 cygwin-dll-link.sh: init 2025-09-27 21:21:48 -03:00
Arnout Engelen 4108382f36 compress-man-pages: don't leak build timestamp into archive
without `-n`, gzip leaks the file timestamp into the compressed file,
which is likely to leak the build timestamp into the output.

This fixes #434930, a regression introduced in c5252e1 / #406922
2025-08-20 17:03:51 +02:00
Wolfgang Walther 535b720589 Merge branch 'master' into staging-next 2025-07-24 14:27:50 +02:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
DavHau a1154d6348 patch-shebangs: fix binary data corrupt after patching
This removes the recently introduced shell based implementation of `sponge` which wasn't capable of managing binary input.

Now, a tmpFile under $TMPDIR is created manually and later deleted

see: https://github.com/NixOS/nixpkgs/pull/414448#issuecomment-3041238623
2025-07-07 14:57:21 +07:00
DavHau 2029515f40 patchShebangs: fix crash on read-only files
Fixes a regression introduced by c1cc6ff0c0 where patchShebangs would crash if a file is read-only
2025-07-01 12:43:26 +07:00
Jörg Thalheim 6039e03bbd patch-shebangs.sh: fix for macos sandbox (#414448) 2025-06-27 18:59:59 +02:00
Guillaume Girol b0d26fa2cd autoPatchelfHook: teach it to avoid objects created by separateDebugInfo
otherwise systemd fails to build because autoPatchelfHook patches libs
with debug objects and this creates circular dependencies from out to
debug (of course, debug depends on out)

example of faulty behavior:

searching for dependencies of /nix/store/c8cd7b82py02f0rkags351nhg82wwjm6-systemd-minimal-257.5/bin/systemd-delta
    libsystemd-shared-257.so -> found: /nix/store/icpqrawjhsw4fbi4i2hp7cxvf3kbzq7m-systemd-minimal-257.5-debug/lib/debug
    libc.so.6 -> found: /nix/store/7lyblga0bzjk0sl93vp4aiwbvb57vp2x-glibc-2.40-66/lib
2025-06-14 22:14:57 +02:00
Guillaume Girol a924c0eb95 separateDebugInfo: add symlinks to executable and source for debuginfod support
A debuginfod support must be able to map a build-id to
- debug symbols
- the original elf file for which the debug symbols where separated
- the corresponding source files

Currently, hydra provides an index from build-id to the nar of the debug
output containing the debug symbols.

Add symlinks in these outputs so that we can recover the store path of
the source and original elf file. We can then fetch them by the normal
binary cache protocol.

About source files: to minimize storage demands, in the ideal case,
software would be built from the source store path $src and the
debuginfod server would just have to serve source files from this store
path. In practice, source files are sometimes patched as part of the
build. This commit stores the modified files in the debug output is a so
called source overlay so that the debuginfod serve can serve the patched
content of the file.

The checksum was chosen as follows (where big is 4GB of zeros):

$  hyperfine -L s sysv,bsd,crc,sha1,sha224,sha256,sha384,sha512,blake2b,sm3 'cksum -a {s} big'
Benchmark 1: cksum -a sysv big
  Time (mean ± σ):     854.5 ms ± 270.5 ms    [User: 245.3 ms, System: 601.8 ms]
  Range (min … max):   760.5 ms … 1623.8 ms    10 runs

  Warning: The first benchmarking run for this command was significantly slower than the rest (1.624 s). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.

Benchmark 2: cksum -a bsd big
  Time (mean ± σ):      5.838 s ±  0.045 s    [User: 5.118 s, System: 0.693 s]
  Range (min … max):    5.767 s …  5.897 s    10 runs

Benchmark 3: cksum -a crc big
  Time (mean ± σ):     829.9 ms ±  28.6 ms    [User: 274.5 ms, System: 551.0 ms]
  Range (min … max):   803.2 ms … 904.8 ms    10 runs

Benchmark 4: cksum -a sha1 big
  Time (mean ± σ):      2.553 s ±  0.010 s    [User: 1.912 s, System: 0.631 s]
  Range (min … max):    2.543 s …  2.575 s    10 runs

Benchmark 5: cksum -a sha224 big
  Time (mean ± σ):      2.716 s ±  0.018 s    [User: 2.054 s, System: 0.645 s]
  Range (min … max):    2.695 s …  2.743 s    10 runs

Benchmark 6: cksum -a sha256 big
  Time (mean ± σ):      2.751 s ±  0.029 s    [User: 2.057 s, System: 0.674 s]
  Range (min … max):    2.712 s …  2.812 s    10 runs

Benchmark 7: cksum -a sha384 big
  Time (mean ± σ):      5.600 s ±  0.049 s    [User: 4.820 s, System: 0.753 s]
  Range (min … max):    5.515 s …  5.683 s    10 runs

Benchmark 8: cksum -a sha512 big
  Time (mean ± σ):      5.543 s ±  0.021 s    [User: 4.751 s, System: 0.768 s]
  Range (min … max):    5.523 s …  5.579 s    10 runs

Benchmark 9: cksum -a blake2b big
  Time (mean ± σ):      5.091 s ±  0.025 s    [User: 4.306 s, System: 0.764 s]
  Range (min … max):    5.048 s …  5.125 s    10 runs

Benchmark 10: cksum -a sm3 big
  Time (mean ± σ):     14.220 s ±  0.120 s    [User: 13.376 s, System: 0.783 s]
  Range (min … max):   14.077 s … 14.497 s    10 runs

Summary
  cksum -a crc big ran
    1.03 ± 0.33 times faster than cksum -a sysv big
    3.08 ± 0.11 times faster than cksum -a sha1 big
    3.27 ± 0.11 times faster than cksum -a sha224 big
    3.31 ± 0.12 times faster than cksum -a sha256 big
    6.13 ± 0.21 times faster than cksum -a blake2b big
    6.68 ± 0.23 times faster than cksum -a sha512 big
    6.75 ± 0.24 times faster than cksum -a sha384 big
    7.03 ± 0.25 times faster than cksum -a bsd big
   17.13 ± 0.61 times faster than cksum -a sm3 big

unfortunately, crc (and sysv) are not supported by --check, so they are
disqualified. sha1 sha224 and sha256 are sensibly as fast as one
another, so let's use a non broken one, even though cryptographic
qualities are not needed here.
2025-06-14 22:14:55 +02:00
nixpkgs-ci[bot] c3c7187bcf Merge staging-next into staging 2025-06-12 18:05:58 +00:00
nixpkgs-ci[bot] f2f7b3ab09 Merge master into staging-next 2025-06-12 18:05:17 +00:00
Connor Baker c02c4a4316 no-broken-symlinks: fail on links to /build (#411775) 2025-06-11 22:15:19 -07:00
Dominique Martinet 9b36201b94 no-broken-symlinks: fail on links to /build
The no-broken-symlinks hook does not fail if bad links exist out of
store, but /build is also a special directory for nix derivations: the
build directory in the builder mount namespace.

There should be no link to /build in the output derivation, so also
error on these directories (through $TMPDIR which default to that)

Closes #410508
2025-06-12 05:23:42 +09:00
Connor Baker 38a8232461 arrayUtilities: init
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
2025-06-11 17:08:13 +00:00
DavHau 6b8e23b9f2 Revert "parallelRun, parallelMap: init"
This reverts commit 4d12b83ae0.

The stdin read lock mechnism can cause the whole process pool to lock up
indefinitely
2025-06-10 10:37:35 +07:00