Commit graph

131 commits

Author SHA1 Message Date
GenericNerdyUsername
3687bee81c
requireFile: allow using hash instead of sha256/sha1 2023-04-22 16:02:34 +01:00
Vladimír Čunát
87a8a597e6
Merge #223741: writeTextFile: chmod before checkPhase
...into staging
2023-04-04 08:57:05 +02:00
Andrew Hamon
e929a99848 writeShellApplication: allow substitutions and remote building.
Unlike most other trivial builders, writeShellApplication has a
relatively heavy checkphase that invokes shellcheck. On my system,
a small writeShellApplication takes over 1 second to build.

This PR allows substitutions and stops preferring local builds for
writeShellApplication.
2023-04-02 14:36:32 -07:00
Naïm Favier
62a3b6448f Revert "symlinkjoin: print warning when keeping existing file" 2023-03-30 13:21:42 -03:00
Naïm Favier
e6f19ea429
writeTextFile: chmod before checkPhase
Set the executable bit before running the check phase, so that the check
phase can run the script to test its behaviour.

This aligns with what `concatTextFile` is doing.

Also use explicit `if` statements so that we don't silently ignore
`chmod` failures.
2023-03-29 14:06:45 +02:00
Artturin
b1e6e553fa trivial-builders.writeShellApplication: use unwrapped shellcheck
originally done in 62e1d58a6f

but

reverted in 6d8041b053

because it contained many haskell deps
2023-03-07 21:18:48 +02:00
Ilan Joselevich
99de63aafa
Merge pull request #219860 from hesiod/write-shell-application
writeShellApplication: Prefer lib.getExe over unwrapped ShellChecked
2023-03-07 20:37:17 +02:00
Tobias Markus
6d8041b053 writeShellApplication: Prefer lib.getExe over unwrapped ShellChecked
writeShellApplication currently uses the unwrapped (passthru) attribute
which is simply defined as the ShellCheck Haskell package.
Unfortunately the unwrapped version contains everything and the kitchen
sink, while the bin output of the top-level shellcheck package contains
only the static shellcheck executable.
In other words, by using writeShellApplication, currently 3GB of
packages have to be unnecessarily fetched just to run the checkPhase.

$ nix path-info -Sh $(nix build --print-out-paths --no-link nixpkgs#shellcheck.unwrapped)
/nix/store/23x8702b9kqn0r8swah05ky7w5fnh6m2-ShellCheck-0.9.0             3.0G

$ nix path-info -Sh $(nix build --print-out-paths --no-link nixpkgs#shellcheck.bin)
/nix/store/594izb2jz3c57c7hgxfnb6irypnr4575-shellcheck-0.9.0-bin        45.3M

There is no benefit to using shellcheck.unwrapped in this case.
Therefore, replace shellcheck.unwrapped with lib.getExe shellcheck.
2023-03-07 15:01:59 +01:00
Artturin
680309fc9c add docs for makeSetupHook 2023-02-07 21:02:02 +02:00
Artturin
8f171925b3 makeSetupHook: deprecate deps argument 2023-02-07 21:02:02 +02:00
Artturin
4e3dcf364e treewide: makeSetupHook deps -> propagatedBuildInputs 2023-02-07 21:02:00 +02:00
Artturin
9a9c42e19f makeSetupHook: support depsTargetTargetPropagated 2023-02-07 21:00:18 +02:00
milahu
d1bb936cf7
symlinkJoin: print warning when keeping existing file 2023-02-05 09:58:20 +01:00
Johannes Kirschbauer
a2780dc543
Docs/fix: make doc-strings nixdoc compliant (#213570)
* re-format all doc-strings to make them nixdoc compliant

* reformat comments to make them markdown-renderable
2023-02-02 11:20:02 +01:00
Alyssa Ross
1fc2a79ee1 makeSetupHook: make "name" argument mandatory
It's very frustrating to try to read through a derivation graph full
of derivations that are all just called "hook", so let's try to avoid
that.
2023-01-19 15:00:36 +00:00
Sandro Jäckel
b33ee831d3
build-support: order comments above corresponding line 2022-12-19 08:47:54 +01:00
Artturin
62e1d58a6f trivial-builders.writeShellApplication: use unwrapped pandoc
writeShellApplication does not need shellcheck docs

it takes ~1 hour to compile the dependencies of pandoc on r9 5900x
because haskell is so slow

$ nix path-info -r ".#sway" --derivation | wc -l
2357

$ nix path-info -r ".#sway" --derivation | wc -l
2055
2022-12-13 05:39:58 +02:00
Bernardo Meurer
6382598677
linkFarm: make last entry win in case of list repeats 2022-11-15 11:45:20 -05:00
Robert Hensing
449ae7573b
Merge pull request #170048 from lovesegfault/link-farm-passthru
linkFarm: add entries to passthru
2022-11-15 17:39:43 +01:00
Bernardo Meurer
a93aed5bab
linkFarm: allow entries to be an attrset 2022-11-15 11:01:52 -05:00
Bernardo Meurer
b54257fb36
linkFarm: add entries to passthru 2022-11-15 10:59:31 -05:00
Robert Hensing
8deb17a36e
Merge pull request #186323 from ShamrockLee/make-setuphook-passthru
trivial-builders.nix: Add input argument `passthru` to makeSetupHook
2022-09-19 11:30:37 +01:00
Jonathan Ringer
dc607cf67b writeShellApplication: don't prefix empty PATH 2022-08-23 22:41:28 +02:00
Robert Hensing
e8a38a2f52 makeSetupHook: Deprecate substitutions.passthru 2022-08-13 11:53:06 +02:00
Shamrock Lee
ba895a7da8 trivial-builders.nix: Add input argument passthru to makeSetupHook
One significant use case is adding `passthru.tests` to setup-hooks,
and help increase test coverage for mission-critical setup-hooks.

As `meta`, `passthru` doesn't go into the build script directly.
However, passing an empty set to `passthru` breaks nixpkgs-review
and OfBorg tests, so pass it only when specified.
2022-08-13 04:20:12 +08:00
Sandro Jäckel
43d4ddf28e
treewide: remove usage of runCommandNoCC aliases 2022-06-07 16:57:06 +02:00
Artturin
1d44ac176c treewide: add enableParallelBuilding's to bootstrap packages so hashes stay the same
when enableParallelBuildingByDefault is enabled

verified with
`nix-diff $(nix eval ".#gcc-unwrapped.drvPath") $(nix eval --expr 'with import ./. { config = { enableParallelBuildingByDefault = true; }; }; gcc-unwrapped.drvPath' --impure)`
2022-05-25 16:03:14 +03:00
Artturin
f002ffed9a treewide: enable strictDeps in bootstrap packages 2022-05-22 16:40:26 +03:00
Artturin
39b85d1c2a trivial-builders.nix: add TODO 2022-05-22 16:40:22 +03:00
Jörg Thalheim
03bf2ff19e
Merge pull request #173206 from SuperSandro2000/writeCBin
writeCBin: fix formatting
2022-05-16 06:58:47 +01:00
Sandro
27123795ad
writeCBin: fix formatting 2022-05-16 01:43:05 +02:00
Jules Aguillon
4acd65ce95
Escape paths
Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
2022-05-15 21:29:01 +02:00
Jules Aguillon
f2a91a6679 Fix string context lost in linkFarm
```nix
let pkgs = import ./. {}; in
pkgs.linkFarm "test" [
  { name = "foo"; path = ./README.md; }
]
```

The nix code above generates this result: (`nix build -f test.nix`)

```
lrwxrwxrwx 1 root root 31 Jan  1  1970 /nix/store/98mdz626n99w0467q4r203q154bnnli9-test/foo -> /home/juloo/w/nixpkgs/README.md
```

With this patch, the target file is naturally copied into the store:

```
lrwxrwxrwx 1 root root 53 Jan  1  1970 /nix/store/ndvffnardifqwzbp07g15llav55r5k1m-test/foo -> /nix/store/9rqwjskbbgbflrpyhzi6rak2j7jspr5f-README.md
```
2022-05-14 19:23:15 +02:00
Artturin
250ef1ff39 testers.testVersion: move from trivial-builders.nix
we will have more testers in the future so they should have their own
location

putting 'testers' in args will also make it simpler to use multiple testers
2022-04-22 16:22:40 +03:00
Artturi
3886bcd30f
Merge pull request #168703 from Artturin/testversion1 2022-04-17 22:40:45 +03:00
Artturin
390439d726 testVersion: when there is a error show the whole error
before

$ nix build ".#whipper.tests.version"
whipper>   File "/nix/store/2iiyy58pmm1ys6dy8ycbmmmfm67iakv1-whipper-0.10.0/bin/.whipper-wrapped", line 6, in <module>
whipper>   File "/nix/store/2iiyy58pmm1ys6dy8ycbmmmfm67iakv1-whipper-0.10.0/lib/python3.9/site-packages/whipper/__init__.py", line 5, in <module>
note: keeping build directory '/tmp/nix-build-whipper-0.10.0-test-version.drv-7'

after
$ nix build ".#whipper.tests.version"
whipper> Traceback (most recent call last):
whipper>   File "/nix/store/2iiyy58pmm1ys6dy8ycbmmmfm67iakv1-whipper-0.10.0/bin/.whipper-wrapped", line 6, in <module>
whipper>     from whipper.command.main import main
whipper>   File "/nix/store/2iiyy58pmm1ys6dy8ycbmmmfm67iakv1-whipper-0.10.0/lib/python3.9/site-packages/whipper/__init__.py", line 5, in <module>
whipper>     from pkg_resources import (get_distribution,
whipper> ModuleNotFoundError: No module named 'pkg_resources'
note: keeping build directory '/tmp/nix-build-whipper-0.10.0-test-version.drv-34'
error: builder for '/nix/store/5lxjicdhwgmjcz9ddlxgq3s3gyaa6lz4-whipper-0.10.0-test-version.drv' failed with exit code 1;
2022-04-14 23:10:20 +03:00
github-actions[bot]
3dc8bd98b9
Merge staging-next into staging 2022-04-06 00:02:41 +00:00
Vladimír Čunát
b4729bad3d
Merge #165406: staging-next 2022-03-23 2022-04-05 20:34:08 +02:00
Robert Hensing
225ca9088a runCommand*: Rely on mkDerivation to sanitize name 2022-03-30 10:29:19 +02:00
Ben Siraphob
ed863440b8
Merge pull request #163924 from OPNA2608/fix/autoPatchelfHook_isLinux 2022-03-26 16:01:56 -05:00
OPNA2608
48034046bf autoPatchelfHook: Make Linux-exclusive
After being rewritten in https://github.com/NixOS/nixpkgs/pull/149731, this hook
can fail on Mach-O binaries. Since patching ELF files on Darwin doesn't make
much sense anyway, we'll mark this as Linux-exclusive.
2022-03-22 19:55:46 +01:00
K900
3fae68b30c build-support/writeTextFile: fix for names with spaces
I am sorry.
2022-03-10 13:30:20 +03:00
Jan Tojnar
f7aa55946b Merge branch 'staging-next' into staging
; Conflicts:
;	nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
;	nixos/doc/manual/release-notes/rl-2205.section.md
;	pkgs/build-support/libredirect/default.nix
2022-01-10 01:26:05 +01:00
Naïm Favier
10ec5da56e tests.trivial-builders.overriding: update after shellDryRun 2021-12-27 20:30:01 -05:00
Naïm Favier
f2065d81ad stdenv/generic: introduce shellDryRun
Add `shellDryRun` to the generic stdenv and substitute it for uses of
`${stdenv.shell} -n`. The point of this layer of abstraction is to add
the flag `-O extglob`, which resolves #126344 in a more direct way.
2021-12-27 20:30:01 -05:00
pasqui23
767d56e834
concatScript: formatting
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2021-11-28 20:43:17 +00:00
Pasquale
67320a1668
concatText: fix typos 2021-11-28 19:35:43 +01:00
Pasquale
0f316ecef2
concatTextFile: init
nixos/networking: using concatTextFile
2021-11-28 01:39:42 +01:00
0x4A6F
0ca14515c6
testVersion: name runCommand after package.name 2021-11-20 22:00:22 +01:00
Bernardo Meurer
174995d14f
writeShellApplication: set meta.mainProgram 2021-11-08 09:33:42 -08:00