Commit Graph

8667 Commits

Author SHA1 Message Date
nicoo
3f7f5df38a nix-prefetch-cvs: emit SRI hashes by default 2024-09-17 15:00:28 +00:00
nicoo
ef232d59ac fetchcvs: support hash attribute 2024-09-17 15:00:27 +00:00
nicoo
07d3b14ce2 nix-prefetch-bzr: emit SRI hashes by default 2024-09-17 15:00:27 +00:00
nicoo
fb8a85e2bb fetchbzr: support hash attribute 2024-09-17 15:00:27 +00:00
nicoo
1ccd5ba540 fetchs3: support hash attribute 2024-09-17 15:00:27 +00:00
nicoo
b5aefcd40a fetchgx: support hash attribute 2024-09-17 15:00:27 +00:00
nicoo
45b95421fd
lib.fetchers: add hash-normalization helpers (#342072) 2024-09-17 14:59:43 +00:00
David McFarland
1b7f8c9165
dotnet: infrastructure improvements (#336824) 2024-09-17 11:42:45 -03:00
github-actions[bot]
73cf025711
Merge staging-next into staging 2024-09-17 12:05:50 +00:00
nicoo
633f94fa4a doc/coq: sha256hash 2024-09-17 10:47:31 +02:00
nicoo
0518f4d245 fetchgit: factor-out the hash logic to lib.fetchers.withNormalizedHash 2024-09-17 08:31:36 +00:00
nicoo
c361b3f7c8 buildBazelPackage: support fetchAttrs.hash 2024-09-17 06:34:07 +00:00
nicoo
80cafd06e6 fetchRepoProject: support hash attribute, wrapping in withnormalizedHash 2024-09-17 06:34:00 +00:00
David McFarland
424bbc430e addNuGetDeps: fix fetch-deps output path handling 2024-09-17 01:14:28 -03:00
David McFarland
be577a25f4 fetchNupkg: conservatively set sourceProvenance 2024-09-17 01:14:27 -03:00
David McFarland
f5e9dd4201 addNuGetDeps: print name of package being fetched 2024-09-17 01:14:27 -03:00
David McFarland
0e5b1ff245 add-nuget-deps: use NUGET_HTTP_CACHE_PATH from user's HOME 2024-09-17 01:12:13 -03:00
David McFarland
a4189437a3 add-nuget-deps: set HOME outside of nix-shell 2024-09-17 01:12:13 -03:00
David McFarland
206693180f add-nuget-deps: expose fetch derivation as passthru.fetch-drv 2024-09-17 01:12:13 -03:00
David McFarland
4bb15106d5 add-nuget-deps: use cacert via nativeBuildInputs 2024-09-17 01:12:13 -03:00
David McFarland
e6bca73d01 nuget-to-nix: use xmlstarlet instead of xq (yq)
xq has such a long startup time that this significantly improves
performance.
2024-09-17 01:12:13 -03:00
David McFarland
c693cb8ec6 addNuGetDeps: move TMPDIR handling out of fetch-deps
We now handle creating TMPDIR and setting the working directory outide
of nix-shell.  This allows nix-shell to set NIX_BUILD_TOP correctly.
2024-09-17 01:12:13 -03:00
David McFarland
521b7b5e5f fetch-nupkg: use helper from nuget-package-hook to unpack 2024-09-17 01:12:12 -03:00
David McFarland
b1685747a7 nuget-package-hook: move package unpacking from buildDotnetModule 2024-09-17 01:12:11 -03:00
David McFarland
c1ee815d03 dotnet-fixup-hook: obey dontFixup 2024-09-17 01:12:11 -03:00
David McFarland
60d3a7d230 nuget-to-nix: set SSL_CERT_FILE
This is required for curl.
2024-09-17 01:12:11 -03:00
David McFarland
1d4d0d3db7 nuget-to-nix: use dotnet from PATH
The dotnet sdk used usually needs to match the one required by the
project (global.json). Having the dependcy in nix just meant it always
had to be overridden.
2024-09-17 01:12:11 -03:00
David McFarland
e05c0c4f98 dotnet-fixup-hook: remove confusing logs 2024-09-17 01:12:11 -03:00
David McFarland
773cc0de74 dotnet-sdk-setup-hook: move nuget configuration from dotnetBuildModule 2024-09-17 01:12:11 -03:00
David McFarland
60eb0db2ab dotnet-sdk-setup-hook: add trailing slashes to NUGET_PACKAGES vars 2024-09-17 01:12:11 -03:00
David McFarland
f820d2cf3c dotnetCorePackages: split fetch-deps logic into addNuGetDeps 2024-09-17 01:12:11 -03:00
github-actions[bot]
1c3463dc7a
Merge staging-next into staging 2024-09-16 12:06:19 +00:00
Robert Hensing
20f9370d5f
lib.fixedPoints.toExtension: init (#336414) 2024-09-16 12:17:16 +02:00
github-actions[bot]
952947bdf8
Merge staging-next into staging 2024-09-15 18:04:54 +00:00
Emily
d71660e9a7
{gcc6,gcc6Stdenv,gfortran6,gcj}: drop (#341714) 2024-09-15 15:13:29 +01:00
Emily
de4388c609 {cc-wrapper,gcc}: drop unused logic and patches 2024-09-15 02:45:00 +01:00
Artturin
be13e1b404 expand-response-params: Fix windows build and add mainProgram 2024-09-15 00:26:11 +03:00
github-actions[bot]
70ab79847d
Merge staging-next into staging 2024-09-14 18:04:45 +00:00
Johannes Kirschbauer
e78c3b6d6e
Format: pkgs.writers 2024-09-14 19:23:41 +02:00
Johannes Kirschbauer
9d9decda25
Doc: {pkgs.writers.*} migrate doc-comments 2024-09-14 19:20:17 +02:00
Yueh-Shun Li
e31ace5cd4 buildGoModule: use lib.toExtension
Use toExtension from Nixpkgs library instead of the one defined locally.
2024-09-14 21:47:59 +08:00
github-actions[bot]
5c9c7359c3
Merge staging-next into staging 2024-09-14 00:13:49 +00:00
Artturin
19bf002d43
treewide: fix editorconfig (#341423) 2024-09-13 21:49:38 +03:00
github-actions[bot]
76501a1b92
Merge staging-next into staging 2024-09-13 18:04:52 +00:00
Artturin
a0c06061b4 treewide: follow editorconfig 2024-09-13 18:17:51 +03:00
Artturin
a4e4fc5d35 dotnetenv.{buildSolution,buildWrapper}: follow editorconfig & follow common bash style
There seems to be duplication and also improvements to one between these, so someone
should rework these.

Add missing `pre` and `post` hook runs.
2024-09-13 18:17:41 +03:00
Thiago Kenji Okada
303f08f0c2
flutter: move build-support/flutter to flutter directory (#332623) 2024-09-13 16:14:35 +01:00
github-actions[bot]
2616bf59e4
Merge staging-next into staging 2024-09-13 12:05:50 +00:00
Gabriel Nützi
ba2b91866b
chore: typos and comment fixups in Go build-support function 2024-09-13 13:26:51 +02:00
Sergei Trofimovich
35671aabff dotnet/build-dotnet-module: fix eval of fetch-deps
Without the change the eval fails as:

    $ nix build --no-link -f. csharp-ls.fetch-deps --show-trace
    error:
       … while evaluating a path segment
         at pkgs/build-support/dotnet/build-dotnet-module/default.nix:258:36:
          257|                   else
          258|                     ''$(mktemp -t "${finalAttrs.pname ? finalAttrs.finalPackage.name}-deps-XXXXXX.nix")'';
             |                                    ^
          259|                 nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; });

       error: cannot coerce a Boolean to a string: false

Switch from `?` operator (attribute presence predicate) to an `or`
("else" form).
2024-09-13 07:12:37 +01:00
Aleksana
eaa7682ca1
treewide: fix buildInputs attribute typos (#315204) 2024-09-13 13:00:47 +08:00
K900
6afe0e76eb
buildEnv: add includeClosures option (#341371) 2024-09-13 07:17:17 +03:00
Philip Taron
05e5a56f04
auto-patchelf: refactor structuredAttrs support (#340858) 2024-09-12 15:13:20 -07:00
Peder Bergebakken Sundt
b79305dfdd treewide: fix typos 2024-09-12 22:39:51 +02:00
Anderson Torres
a0f3c9ac50 flutter: move build-support/flutter to flutter directory
Rationale:

With the advent of RFC 140, Nixpkgs becomes to promote self-contained package
directories and strongly discourages scattering along the old and deprecated
filesystem hierarchy.

Further, `build-support/flutter/*` is not referenced by any other expressions in
Nixpkgs besides flutter itself.

Further, concentrating all Flutter-related toolset below a same directory
hierarchy (arguably?) eases maintenance and future migrations.
2024-09-12 13:20:33 -03:00
K900
db0914534a buildFHSEnv: force overwriting ld-linux.so.2
That can be a problem if we already have it in the inputs.
2024-09-12 15:27:46 +03:00
K900
4654ea4cc0 buildEnv: support pulling in closures of paths
This will become important for Steam.
2024-09-12 15:27:46 +03:00
Manuel Mendez
17b3df2861 rust: Write to .cargo/config.toml instead of .cargo/config
Seeing the following new warnings pop up on stderr when cargo was bumped
to 1.78:

```
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
```

which happens to break commitmsgfmt builds in nix (#320294).

closes #320294
2024-09-11 21:03:32 -04:00
Wolfgang Walther
bc0395ee6f
auto-patchelf: refactor structuredAttrs support
stdenv now provides better tooling to support structuredAttrs without
depending on $__structuredAttrs itself.
2024-09-11 19:29:39 +02:00
github-actions[bot]
408e32a8fe
Merge staging-next into staging 2024-09-11 00:13:38 +00:00
Philip Taron
fa26d1fe93
makeInitrdNG: fixup contents documentation (#341082)
Let's not let the perfect be the enemy of the drive-by contribution.
2024-09-10 16:38:35 -07:00
Axel Karjalainen
a99c334965
treewide: Fix remaining Android sdkVer and ndkVer references (#341106)
Fix remaining sdkVer and ndkVer references

1144d46 renamed sdkVer and ndkVer, but forgot one reference and
incorrectly replaced another
2024-09-11 01:06:52 +03:00
Emily
bf5f0b6e70
rust: support structuredAttrs in setup hooks (#340862) 2024-09-10 20:52:10 +01:00
Aaron Andersen
c7bb47aac1
makeInitrdNG: fixup contents documentation 2024-09-10 15:31:48 -04:00
Doron Behar
d77ecc757a
fetchYarnDeps: fix by deduplicating requests (#336784) 2024-09-10 18:17:48 +00:00
Wolfgang Walther
d5013e942e
rust: shellcheck setup hooks 2024-09-10 08:32:33 +02:00
Wolfgang Walther
9220a19a4d
rust: support structuredAttrs in setup hooks
Tested the following packages with and without structuredAttrs:
- rust-analyzer: cargo-build-hook, cargo-check-hook
- jujutsu: cargo-nextest-hook
- kornia-rs: maturin-build-hook
2024-09-10 08:32:33 +02:00
Fea
207072fca3 fetchYarnDeps: fix by deduplicating requests 2024-09-09 23:39:44 +02:00
github-actions[bot]
5725a1eed6
Merge staging-next into staging 2024-09-08 18:04:33 +00:00
github-actions[bot]
3b1652aad3
Merge master into staging-next 2024-09-08 18:04:04 +00:00
Matt Sturgeon
c8a0f01473
dotnetCorePackages.fetchNupkg: override avalonia to include upstream fix
Backport https://github.com/AvaloniaUI/Avalonia/pull/16835 to versions
11.1.0 through 11.2.0-beta1

Co-authored-by: Nick Cao <nickcao@nichi.co>
2024-09-08 16:38:43 +01:00
Sefa Eyeoglu
567bd7c6a6
autoPatchelfHook: expose script as top level package
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-09-08 15:57:53 +02:00
github-actions[bot]
5310eaa51e
Merge staging-next into staging 2024-09-07 18:04:28 +00:00
github-actions[bot]
5a5ebe5a1c
Merge master into staging-next 2024-09-07 18:04:01 +00:00
Ilan Joselevich
82bd98c069
buildRustCrate: Fix rust-overlay usage (#339298) 2024-09-07 19:19:40 +03:00
Philip Taron
4160ccc634
treewide: handle *Phases variables __structuredAttrs-agnostically (#339117) 2024-09-07 09:17:57 -07:00
github-actions[bot]
c35ab72937
Merge staging-next into staging 2024-09-07 12:05:25 +00:00
github-actions[bot]
de15243c9a
Merge master into staging-next 2024-09-07 12:04:51 +00:00
David McFarland
13a975148a
dotnet: add override mechanism for nuget packages (#339953) 2024-09-07 09:00:01 -03:00
github-actions[bot]
50da31693c
Merge staging-next into staging 2024-09-07 06:04:40 +00:00
github-actions[bot]
319af78438
Merge master into staging-next 2024-09-07 06:04:15 +00:00
éclairevoyant
3207bc2237
rustPlatform.fetchCargoTarball: support pname, version 2024-09-07 01:10:00 -04:00
éclairevoyant
1f0f59d5a1
rustPlatform.fetchCargoTarball: nixfmt 2024-09-07 01:09:59 -04:00
github-actions[bot]
899adc3017
Merge staging-next into staging 2024-09-07 00:13:22 +00:00
github-actions[bot]
b6b2ac4f61
Merge master into staging-next 2024-09-07 00:12:59 +00:00
David McFarland
e6c700ed11 dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
David McFarland
cc9c59c478 buildDotnetModule: use individual dependencies for nugetDeps 2024-09-06 16:05:19 -03:00
David McFarland
9a0be2fd28 dotnetCorePackages.fetchNupkg: override skiasharp to find fontconfig 2024-09-06 16:05:19 -03:00
John Ericson
f43cc75868
Clean up cross bootstrapping, take 2 (#321525) 2024-09-06 14:56:54 -04:00
John Ericson
5f134ec6cf Clean up cross bootstrapping
For a long time, we've had `crossLibcStdenv`, `*Cross` libc attributes,
and `*bsdCross` pre-libc package sets. This was always bad because
having "cross" things is "not declarative": the naming doesn't reflect
what packages *need* but rather how we *provide* something. This is
ugly, and creates needless friction between cross and native building.

Now, almost all of these `*Cross` attributes are gone: just these are
kept:

- Glibc's and Musl's are kept, because those packages are widely used
  and I didn't want to risk changing the native builds of those at this
  time.

- generic `libcCross`, `theadsCross`, and friends, because these relate
  to the convolulted GCC bootstrap which still needs to be redone.

The BSD and obscure Linux or freestnanding libcs have conversely all
been made to use a new `stdenvNoLibc`, which is like the old
`crossLibcStdenv` except:

1. It usable for native and cross alike

2. It named according to what it *is* ("a standard environment without
   libc but with a C compiler"), rather than some non-compositional
   jargon ("the stdenv used for building libc when cross compiling",
   yuck).

I should have done this change long ago, but I was stymied because of
"infinite recursions". The problem was that in too many cases we are
overriding `stdenv` to *remove* things we don't need, and this risks
cyles since those more minimal stdenvs are used to build things in the
more maximal stdenvs.

The solution is to pass `stage.nix` `stdenvNoCC`, so we can override to
*build up* rather than *tear down*. For now, the full `stdenv` is also
passed, so I don't need to change the native bootstraps, but I can see
this changing as we make things more uniform and clean those up.

(adapted from commit 51f1ecaa59)
(adapted from commit 1743662e55)
2024-09-06 10:26:56 -04:00
Ilan Joselevich
8d2ba0feae
buildRustCrate: Fix rust-overlay usage
I broke the usage of buildRustCrate with a toolchain from rust-overlay
when I added support for wasm32-unknown-unknown, this change adds
additional conditionals to restore the usage.

The toolchain can now be overriden either through
```
buildRustCrate {
  rust = toolchain;
  cargo = toolchain
}
```
or
```
buildRustCrate.override {
  rustc = toolchain;
  cargo = toolchain;
}
```
They should now be consistent with each other.
2024-09-06 16:47:29 +03:00
David McFarland
1f6cd35f5e dotnetCorePackages.fetchNupkg: add override mechanism 2024-09-05 23:46:24 -03:00
David McFarland
32ccfdc278 dotnetCorePackages.fetchNupkg: run missing hooks 2024-09-05 23:46:24 -03:00
David McFarland
7ea78aaf5a dotnetCorePackages.fetchNupkg: split from mkNugetDeps 2024-09-05 23:46:23 -03:00
David McFarland
2d43ecc400 buildDotnetModule: clean-up stdenv attributes
- stop binding attributes we don't care about (e.g. name, doCheck)
- remove attributes we handle in nix (e.g. useAppHost)
- inherit attributes with default values (e.g. packNupkg)
2024-09-05 23:46:23 -03:00
David McFarland
e78882326b mkNugetDeps: unpack to source/
Unpacking to the build root was a bad idea. stdenv uses dumpVars() to
create a file env-vars containing the entire environment.  This was
being installed in the derivation output, and since it contains lots of
store paths, it was bloating the closure for every nuget package.
2024-09-05 22:47:39 -03:00
David McFarland
e49642596f buildDotnetModule: set TMPDIR in fetch-deps
Some packages assume TMPDIR is unshared, even in nix-shell.
2024-09-05 22:47:39 -03:00
David McFarland
e530139caa buildDotnetModule: fix tool manifest detection 2024-09-05 22:47:38 -03:00
github-actions[bot]
d76d809dd4
Merge staging-next into staging 2024-09-05 00:13:35 +00:00
github-actions[bot]
74cdd9c9b1
Merge master into staging-next 2024-09-05 00:13:11 +00:00
sohalt
b60d3f6270 fetchgithub: support fetchLFS 2024-09-04 19:01:22 +02:00
Emily
a1dbc04bb9
gst_all_1.gstreamer: disable Rust if unavailable (#338999) 2024-09-04 16:12:25 +01:00
lelgenio
7783e118af yarnInstallHook: init 2024-09-04 11:15:47 -03:00
K900
23b4832da0 Merge remote-tracking branch 'origin/master' into staging-next 2024-09-04 08:53:48 +03:00
David McFarland
683ffbdc5c
buildDotnetModule: inherit enableParallelBuilding (#339335) 2024-09-03 20:56:37 -07:00
Ivan Trubach
2d33d5c778 buildDotnetModule: inherit enableParallelBuilding
After this change, enableParallelBuilding defaults to true for packages
using buildDotnetModule. The argument value already defaults to true,
but we did not use it. Note that default values in Nix are not present
in the arguments attribute set, e.g. `args` does not contain `def` for
`{ def ? true }@args: …` function unless this argument is explicitly
passed.
2024-09-03 22:57:52 +03:00
Jörg Thalheim
0e21bc6af9
buildGoModule: be nicer when overrideAttrs clears passthru (#339042) 2024-09-03 20:54:14 +02:00
Alyssa Ross
0852f8eb84
rustc: expose platform lists
Previously, it wasn't possible to access the list of platforms we can
build Rust programs for outside of buildRustPackage.  This was a
problem for packages that have optional Rust components, like
gstreamer or Meson, as there was no way to only build the Rust parts
for supported platforms.  Now it's possible to get that information
from rustc's passthru.
2024-09-03 17:47:27 +02:00
K900
105933cf4f pkgs/build-support/rust: fix warning-related eval issue 2024-09-03 17:04:55 +03:00
github-actions[bot]
a07f612219
Merge master into staging-next 2024-09-03 00:13:11 +00:00
Artturin
89bb3dfc21
cc-wrapper: fix guessing mainProgram (#323611) 2024-09-03 02:17:57 +03:00
Yueh-Shun Li
758056dac7 treewide: handle postPhases __structuredAttrs-agnostically
Always specify the postPhases attribute as a list instead of a string.

Append elements to the postPhases Bash variable using appendToVar
instead of string or Bash array concatenation.
2024-09-03 05:56:17 +08:00
Yueh-Shun Li
054c5f0e10 treewide: handle preDistPhases __structuredAttrs-agnostically
Always specify the preDistPhases attribute as a list instead of a string.

Append elements to the preDistPhases Bash variable using appendToVar
instead of string or Bash array concatenation.

Handle element insertion before a specific element using string
substitution as before, but handle both structured and unstructured
attributes.
2024-09-03 05:33:59 +08:00
Yueh-Shun Li
5d42a8b38c treewide: handle preConfigurePhases __structuredAttrs-agnostically
Always specify the preConfigurePhases attribute as a list instead of a
string.

Append elements to the preConfigurePhases Bash variable using
appendToVar instead of string or Bash array concatenation.
2024-09-03 05:33:59 +08:00
Yueh-Shun Li
21c0129841 treewide: handle prePhases __structuredAttrs-agnostically
Always specify the prePhases attribute as a list instead of a string.

Append elements to the prePhases Bash variable using appendToVar
instead of string or Bash array concatenation.
2024-09-03 05:33:59 +08:00
Alyssa Ross
459e958661 rust.lib: enable planned deprecation warnings 2024-09-02 21:48:21 +02:00
github-actions[bot]
ce19166255
Merge master into staging-next 2024-09-02 18:04:19 +00:00
Sandro Jäckel
bc12ef1bf0
buildGoModule: be nicer when overrideAttrs clears passthru
Before an overlay in the form of:

package.overrideAttrs (old: {
  passthru = {};
})

would fail evaluation like:

       error: attribute 'overrideModAttrs' missing
       at /nix/store/afwc3m1sm49qq57xjv2hmd7iy4x0j33h-source/pkgs/build-support/go/module.nix:179:20:
          178|     outputHashAlgo = if finalAttrs.vendorHash == "" then "sha256" else null;
          179|   }).overrideAttrs finalAttrs.passthru.overrideModAttrs;
             |                    ^
          180|

Now instead we take the fallback default.
2024-09-02 17:53:36 +02:00
David McFarland
7bc85af0c5
buildDotnetModule: add testFilters arg (#336571) 2024-09-02 07:09:06 -07:00
github-actions[bot]
4aa8416117
Merge master into staging-next 2024-09-02 12:05:34 +00:00
Alyssa Ross
2ade30b7af rustPlatform.buildRustPackage: merge custom platforms
We should constrain the set of supported platforms to the platforms
supported by the compiler.  Otherwise we run into the unfortunate
situation where setting meta.platforms in a Rust package to
platforms.unix or platforms.linux will reintroduce CPU architectures
unsupported by the compiler.
2024-09-02 08:58:07 +02:00
github-actions[bot]
023a2c3d2a
Merge staging-next into staging 2024-08-31 06:04:54 +00:00
github-actions[bot]
8158f1d5b3
Merge master into staging-next 2024-08-31 06:04:15 +00:00
Jörg Thalheim
e6c09b2d57
breakpointHook: move to by-name (#338497) 2024-08-31 07:01:11 +02:00
github-actions[bot]
fab50d5f8d
Merge staging-next into staging 2024-08-31 00:13:46 +00:00
github-actions[bot]
dcad9b571a
Merge master into staging-next 2024-08-31 00:13:18 +00:00
Philip Taron
ef0bb1fc69
singularity-tools: make runscript modifiable (#334826) 2024-08-30 15:57:50 -07:00
Philip Taron
1b9af797ec
breakpointHook: move to by-name, mark broken instead of asserting 2024-08-30 15:03:42 -07:00
github-actions[bot]
758138647a
Merge staging-next into staging 2024-08-30 12:05:38 +00:00
github-actions[bot]
43febad8fc
Merge master into staging-next 2024-08-30 12:05:11 +00:00
Doron Behar
3326d57216
npmInstallHook: extract nodejsInstall{Manuals,Executables} (#336644) 2024-08-30 06:06:06 +00:00
github-actions[bot]
a2cea72749
Merge staging-next into staging 2024-08-30 00:13:56 +00:00
github-actions[bot]
22c53603c5
Merge master into staging-next 2024-08-30 00:13:29 +00:00
Philip Taron
3e0f69b8c9
treewide: use a consistent meta.priority default (#338223) 2024-08-29 14:15:22 -07:00
github-actions[bot]
eacf5283f3
Merge staging-next into staging 2024-08-29 18:04:46 +00:00
github-actions[bot]
d83e365b06
Merge master into staging-next 2024-08-29 18:04:21 +00:00
Artturin
65bf97a942
buildFHSEnv: use relative symlinks (#330712) 2024-08-29 20:57:43 +03:00
Philip Taron
ae92f312bf
treewide: use a consistent meta.priority default 2024-08-29 09:04:57 -07:00
adisbladis
9c7ff7277c
importNpmLock.buildNodeModules: init
`importNpmLock.buildNodeModules` returns a derivation with a pre-built `node_modules` directory, as imported by `importNpmLock`.
This is to be used together with `importNpmLock.hooks.linkNodeModulesHook` to facilitate `nix-shell`/`nix develop` based development workflows:

```nix
pkgs.mkShell {
  packages = [
    importNpmLock.hooks.linkNodeModulesHook
    nodejs
  ];

  npmDeps = importNpmLock.buildNodeModules {
    npmRoot = ./.;
    inherit nodejs;
  };
}
```
will create a development shell where a `node_modules` directory is created & packages symlinked to the Nix store when activated.

This code is adapted from https://github.com/adisbladis/buildNodeModules
2024-08-29 06:12:07 -07:00
github-actions[bot]
4a1df24885
Merge staging-next into staging 2024-08-29 06:05:29 +00:00
github-actions[bot]
b430e34392
Merge master into staging-next 2024-08-29 06:05:05 +00:00
seth
278e1bfb89
yarnConfigHook: apply as a postConfigure hook
This follows in this example of npmConfigHook and allows for using this
hook alongside others that may override configurePhase
2024-08-28 23:30:55 -04:00
Anderson Torres
e548b31708 installShellFiles: migrate to by-name 2024-08-28 18:51:06 -03:00
Anderson Torres
8b674370c4 installShellFiles: nixfmt-rfc-style 2024-08-28 18:51:06 -03:00
Anderson Torres
f72e74d7ae installShellFiles: migrate tests to tests subdirectory
Rationale: Since RFCs 140 and 146, the old category-based hierarchy is
deprecated and obsolete, and a new approach took place: packages should be as
self-contained as possible.

This paradigm is reflected in many new strict checks that prohibit a package to
refer to files outside its directory tree.

Following this spirit, this commit essentially moves nixpkgs
pkgs/test/default.nix to ./tests/default.nix.

Further, to keep the top-level `tests` attribute, a green alias is kept in the
place of older file.
2024-08-28 18:51:06 -03:00
Anderson Torres
8f4200d165 installShellFiles: move setup script to the same directory
So that it can be migrated to by-name later.
2024-08-28 18:51:06 -03:00
Philip Taron
0d1b26857b
treewide: support structuredAttrs in setup hooks (part 2) (#335666) 2024-08-28 14:07:58 -07:00
Artturin
740804dd5f
patch-shebangs: don't patch shebangs with bash builtins (#330188) 2024-08-27 03:54:10 +03:00
lelgenio
80a2825733 npmHooks.npmInstallHook: extract npmInstall{Manuals,Executables} 2024-08-26 20:43:42 -03:00
github-actions[bot]
eb9c198aae
Merge staging-next into staging 2024-08-26 12:05:49 +00:00
github-actions[bot]
132f2322d0
Merge master into staging-next 2024-08-26 12:05:25 +00:00
lassulus
9eda2c63f4
writers.*: use lib.makeBinPath in documentation (#337437) 2024-08-26 13:20:29 +02:00
Alexander Sieg
3b0ba6a6e1
writers.*: use lib.makeBinPath in documentation
This also fixes a syntax error with `,` being used as a array element
separator.
2024-08-26 12:19:19 +02:00
Silvan Mosberger
ea17c502d2 tests.trivial-builders: Prevent rebuilds when Nix files change
There's no need to use a Nix file in the path here. By using a different
file we won't cause rebuilds when we change the Nix file, in particular
also when the Nix file is reformatted.
2024-08-25 04:59:11 +02:00
Wolfgang Walther
1efcffa700
stdenv: support default values in concatTo
The previously used pattern was introduced in #318614, but technically
leaked the default flags into the global scope. While this would
probably not make much of a practical difference, making concatTo
support default values is a much cleaner approach.
2024-08-24 12:23:35 +02:00
github-actions[bot]
6c92725f2c
Merge staging-next into staging 2024-08-24 06:04:36 +00:00
github-actions[bot]
fd3525921f
Merge master into staging-next 2024-08-24 06:04:09 +00:00
Gabriella Gonzalez
0b6fa5ee40
virtualisation.oci-containers: Add new imageStream option (#335430)
This adds a new `imageStream` option that can be used in conjunction
with `pkgs.dockerTools.streamLayeredImage` so that the image archive
never needs to be materialized in the `/nix/store`.  This greatly
improves the disk utilization for systems that use container images
built using Nix because they only need to store image layers instead of
the full image.  Additionally, when deploying the new system and only
new layers need to be built/copied.
2024-08-24 04:38:27 +02:00
Nathan Henrie
16f3c7ebcb rustPlatform.buildRustPackage: provide debug symbols on darwin
Currently we cannot debug rust binaries on darwin (via lldb).

The debug symbols seem to be provided by default in a number of files
in `target/debug/deps/*.rcgu.o`. As far as I can tell these have
hardcoded paths referring to the ephemeral build directory. However,
`split-debuginfo=packed` conveniently produces a `.dSYM` file that can
be copied to `$out/bin/` and immediately provide debugging information.

Fixes https://github.com/NixOS/nixpkgs/issues/262131
2024-08-23 13:07:16 -06:00
github-actions[bot]
a3836576dd
Merge staging-next into staging 2024-08-23 18:04:38 +00:00
github-actions[bot]
1f86c1b2e8
Merge master into staging-next 2024-08-23 18:04:09 +00:00
Tim Cuthbertson
911aa1440f treewide: support NIX_SSL_CERT_FILE as an impureEnvVar
This envvar is also added to lib.proxyImpureEnvVars since it's
typically required for https proxies.

This change also updates fetchgit and go module fetching to use this
envvar. NIX_GIT_SSL_CAINFO is still supported for backwards
compatibility in fetchgit.
2024-08-23 21:34:22 +10:00
Adam Joseph
bbb42450c5 default-crate-overrides: proc-macro-crate assumes env::var("CARGO")
Since version 2.0.0, proc-macro-crate has assumed it can exec()
`env::var("CARGO")` in order to run `cargo locate-project`.

This commit adds a crate override to proc-macro-crate which simply writes the
path to buildPlatform.cargo into the proc-macro-crate sources.

This way we don't need to set `env.CARGO` for every build that depends on
proc-macro-crate -- if we do that, the $CARGO environment variable would be
visible to the entire build.  This could potentially lead to incredibly
hard-to-troubleshoot heisenbugs if there is some other crate that expects
`env::var("CARGO")` to exist -- that other crate would mysteriously work only
in projects that use proc-macro-crate but not anywhere else!
2024-08-23 09:36:47 +03:00
Matt Sturgeon
1c379e3a57
buildDotnetModule: add testFilters arg
In addition to the existing `disabledTests`, allow defining more general
test filters using `testFilters`.
2024-08-22 19:52:07 +01:00
K900
5c68540f8b Merge remote-tracking branch 'origin/staging-next' into staging 2024-08-22 13:20:38 +03:00
Philip Taron
f300433fcc
Merge pull request #336383 from motiejus/compress-drv-docs 2024-08-21 12:46:48 -07:00
Motiejus Jakštys
26249b62fd compressDrv: fix a confusing comment 2024-08-21 21:52:00 +03:00
Sigmanificient
f03b7856a6 makePythonWriter: add doCheck toggle 2024-08-21 19:17:36 +02:00
Pol Dellaiera
dbc4f15b89
Merge pull request #308059 from drupol/build-support/php/remove-composer-local-repo-plugin
build-support/php: init `buildComposerProject2` and `mkComposerRepository2`
2024-08-20 18:38:44 +02:00
Philip Taron
be245de559
Merge pull request #333262 from nbraud/doc/runCommandWith
nixpkgs-manual: Document `runCommandWith`, refactor `runCommand{,CC,Local}`
2024-08-19 12:29:58 -07:00
nicoo
80e3fd91a9 doc/build-helpers: document runCommandWith
Co-authored-by: Johannes Kirschbauer <hsjobeki+github@gmail.com>
2024-08-19 19:16:42 +00:00
Sandro Jäckel
0505523e98
compress-drv: correct comment 2024-08-19 13:19:27 +02:00
Sandro Jäckel
0654f81d56
compress-drv: carry pname, version forward
This is required to overwrite to use a compressed version of nextcloud in services.nextcloud.package because the module accesses version
2024-08-19 13:17:05 +02:00
Sandro Jäckel
4cc5dee048
compress-drv: allow passing extra arguments to find
This is useful for eg. nextcloud to prevent compressing thousands of
later unused files which are actually not used by the web server.
2024-08-19 13:15:55 +02:00
Sandro Jäckel
0ca4bfa700
compress-drv: add zstd 2024-08-19 13:15:54 +02:00
Sandro Jäckel
9581a2bdca
compress-drv: misc cleanup 2024-08-19 13:15:54 +02:00
Sandro Jäckel
6449d32b0a
compress-drv: add htm, otf formats to default 2024-08-19 13:15:46 +02:00
Sandro Jäckel
7ebbf27832
compress-drv: sort formats 2024-08-19 13:15:46 +02:00
Philip Taron
bd346e9f29
Merge pull request #335575 from felschr/make-startupitem-extra-args-fix
make-startupitem: fix {prepend,append}ExtraArgs for Exec without arguments
2024-08-18 19:56:39 -07:00
Motiejus Jakštys
1bd350449a gitea: fix passthru.data-compressed
Fixes two bugs:
- pass a forgotten `{}` to `compressDrv`.
- remove incorrect usage of `lndir` in `compressDrv`. I added a brief
  comment on why, see [this comment][1] for more details.

Tested with:

```
$ nix build .#legacyPackages.x86_64-linux.gitea.passthru.data-compressed
$ ls -lh result/public/assets/licenses.txt*
lrwxrwxrwx 1 root root  90 Jan  1  1970 result/public/assets/licenses.txt -> /nix/store/p21irsr57hckd3x3ym18aa0cr9zmm3an-gitea-1.22.1-data/./public/assets/licenses.txt
-r--r--r-- 1 root root 30K Jan  1  1970 result/public/assets/licenses.txt.br
-r--r--r-- 1 root root 82K Jan  1  1970 result/public/assets/licenses.txt.gz
```

[1]: https://github.com/NixOS/nixpkgs/pull/332752#discussion_r1721043286
2024-08-18 22:47:03 +03:00
Philip Taron
661aa513a1
writers: remove with statements from aliases 2024-08-18 06:31:14 -07:00
Philip Taron
c406a6ed33
fetchsvn: remove with statements 2024-08-18 06:31:14 -07:00
Felix Schröter
498d662662
make-startupitem: fix {prepend,append}ExtraArgs for Exec without arguments 2024-08-18 12:28:06 +02:00
github-actions[bot]
150d965bfb
Merge staging-next into staging 2024-08-17 18:01:41 +00:00
Yueh-Shun Li
51ef09110b singularity-tools: make runscript modifiable 2024-08-18 00:37:37 +08:00
Philip Taron
bc0fb46cd2
Merge pull request #334995 from pbsds/fix-test-version-1723771306 2024-08-17 07:53:03 -07:00
github-actions[bot]
7fab29afce
Merge staging-next into staging 2024-08-17 06:01:46 +00:00
Philip Taron
cd7b95ee37
Merge pull request #333236 from nbraud/testers/runCommand
testers.runCommand: init
2024-08-16 18:07:41 -07:00
Peder Bergebakken Sundt
ecb342fd4e testers.testVersion: ignore echoed store paths
Fixes the error mode where the test always passes if the store path of the binary is echoed by the test command.
2024-08-16 20:16:44 +02:00
Doron Behar
0d920a91a2
Merge pull request #225051 from ShamrockLee/go-module-overlay-stdenv
buildGoModule: Fix overriding with overlay-style stdenv
2024-08-16 15:44:15 +00:00
github-actions[bot]
4c8722e915
Merge staging-next into staging 2024-08-15 18:02:28 +00:00
Someone
10ce447aea
Merge pull request #333843 from ShamrockLee/singularity-tools-fixes2
singularity-tools: miscellaneous fixes (2nd round)
2024-08-15 17:29:01 +00:00
Yueh-Shun Li
c2eb0aa56e singularity-tools: don't preserve store content ownership
Don't preserve store content ownership to prepare for unprivileged-build
workflow.
2024-08-15 21:33:18 +08:00
Yueh-Shun Li
c229d14f50 singularity-tools: proper line looping with while-read 2024-08-15 21:33:06 +08:00
Yueh-Shun Li
5396a84b1d singularity-tools: string-interpolate and and quote members in contents
String-interpolation converts path objects inside `contents` into store
paths to ensure they are properly included in the result image.

See tests.trivial-builders.references for the necessity of
string-interpolation.

Quote each string-interpolated content member to accomodates spaces
inside.
2024-08-15 20:09:56 +08:00
github-actions[bot]
688ae1bcd3
Merge staging-next into staging 2024-08-15 12:02:43 +00:00
Pol Dellaiera
65c0e4ebf6
build-support/php: implement v2 2024-08-15 13:43:00 +02:00
Pol Dellaiera
b356a808fd
build-support/php: copy v1 into v2 2024-08-15 13:43:00 +02:00
Markus Kowalewski
b909e2c80d
Merge pull request #333444 from markuskowa/fix-mpi-check-hook
mpiCheckPhaseHook: update to use openmpi-5 compatible parameters
2024-08-15 11:34:51 +02:00
github-actions[bot]
78a583fbf0
Merge staging-next into staging 2024-08-15 06:01:41 +00:00
lassulus
4b3c31b884
Merge pull request #334776 from aos/aos/update-writepy3-example
fix: Update writePython3Bin docs
2024-08-15 07:42:45 +02:00
Aos Dabbagh
55e4114fb3 fix: Update writePython3Bin docs
Was trying out the recommended example for `writePython3Bin` and it
failed with:
```
Traceback (most recent call last):
  File "/nix/store/gcmhfm7mslpndjasfhvs66f1ca24vxim-test_py3/bin/test_py3", line 4, in <module>
    y = yaml.load("""
TypeError: load() missing 1 required positional argument: 'Loader'
```

Looks like `yaml.load(input)` was deprecated in 5.1: https://msg.pyyaml.org/load

`nixos-24.05` uses `6.0.1` so we're in the clear.
2024-08-15 00:57:39 -04:00
squalus
0a3ed67ff6
autoPatchelfHook: add keep_libc flag (#332617)
* autoPatchelfHook: add keep_libc flag

- Add keep_libc flag to disable the default libc handling. Intended
  to be used by systemd.
- Add autoPatchelfFlags to autoPatchelfHook for passing arguments to
  the autoPatchelf script

This reverts part of the change made in #307068 / 80be926.

Fixes #332533
2024-08-14 02:54:27 -04:00
github-actions[bot]
1582d7624e
Merge staging-next into staging 2024-08-14 06:01:31 +00:00
github-actions[bot]
261f1edcbd
Merge master into staging-next 2024-08-14 06:01:07 +00:00
adisbladis
bed19bdf39 fetchPypiLegacy: Pass cacert to enable TLS verification when username/password is used
The intent was for TLS verification to be enabled when transfering credentials only, and normally disabled for long-term reproducibility.

See https://github.com/nix-community/poetry2nix/issues/1740
2024-08-14 13:22:31 +12:00
adisbladis
e5d7d560f8
Merge pull request #334059 from adisbladis/fetchpypilegacy-netrc-pureeval
fetchPypiLegacy: pass NETRC via impureEnvVars if inPureEval
2024-08-14 13:16:46 +12:00
adisbladis
482a26382f fetchPypiLegacy: pass NETRC via impureEnvVars if inPureEval
Co-authored-by: Matthew Croughan <matt@croughan.sh>
2024-08-14 11:58:15 +12:00
Someone
ccaaa9ca53
Merge pull request #318614 from wolfgangwalther/structured-attrs-setup-hooks
treewide: support structuredAttrs in setup hooks
2024-08-13 19:29:36 +00:00
Martin Weinelt
0906206d42
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/top-level/python-packages.nix
2024-08-13 13:21:03 +02:00
adisbladis
14e1662fa6
Merge pull request #334136 from hsjobeki/importNpmLock/opts
importNpmLock: init fetcherOps per package
2024-08-13 20:59:12 +12:00
Johannes Kirschbauer
3ed5055f0f
importNpmLock: init fetcherOps per package 2024-08-13 09:38:37 +02:00
Markus Kowalewski
b898495c9a mpiCheckPhaseHook: update to use openmpi-5 compatible parameters 2024-08-12 21:45:24 +02:00
github-actions[bot]
62f43c3094
Merge master into staging-next 2024-08-12 18:02:11 +00:00
Philip Taron
7fbfc53b54
Merge pull request #334176 from philiptaron/pr-333270/follow-up
pkgs.writers: improve documentation on {makeScriptWriter,makeScriptWriterBin}
2024-08-12 09:16:24 -07:00
Alyssa Ross
6f95189f88 wrapBintoolsWith: add s390(x)-linux dynamic linkers
This fixes autoPatchElfHook for these platforms.
2024-08-12 17:52:03 +02:00
Philip Taron
989f10d419
pkgs.writers: improve documentation on {makeScriptWriter,makeScriptWriterBin} 2024-08-12 08:42:11 -07:00
adisbladis
2a9ab9c1e0 fetchPypiLegacy: Reformat with nixfmt 2024-08-12 17:05:37 +12:00
Yueh-Shun Li
eed069a5bc buildGoModule: fix overrideAttrs overriding
Fix overriding of vendorHash and various attributes via the fixed point
attribute support of stdenv.mkDerivation.

Pass as derivation attributes
goModules, modRoot, vendorHash, deleteVendor, and proxyVendor.

Move goModules and vendorHash out of passthru.

Co-authored-by: Doron Behar <doron.behar@gmail.com>
2024-08-11 13:38:11 +08:00
Yueh-Shun Li
7487a6207d singularity-tools: quote shell variables 2024-08-11 13:22:39 +08:00
Yueh-Shun Li
4be1e115d6 singularity-tools: rename the VM mountpoint as "workspace" 2024-08-11 13:22:39 +08:00
Yueh-Shun Li
a7b54b36c5 singularity-tools: create VM disk image outside $out
Place the VM disk image in a local directory "disk-image" instead of
"$out", so that we don't have to delete it to reserve "$out" for the
container image.
2024-08-11 13:22:39 +08:00
Yueh-Shun Li
e8360a61bc singularity-tools: make extensible 2024-08-11 13:22:39 +08:00
Yueh-Shun Li
3ca6a8c60e singularity-tools: add bashInteractive and runScript into layerClosure 2024-08-11 13:22:02 +08:00
github-actions[bot]
45080a9559
Merge master into staging-next 2024-08-10 18:01:08 +00:00
Pol Dellaiera
c4e73af4dd
Merge pull request #284161 from felschr/make-startupitem-extra-args
make-startupitem: add `prependExtraArgs` and `appendExtraArgs`
2024-08-10 18:39:01 +02:00
Jörg Thalheim
7a3ae61af1
Merge pull request #333270 from hsjobeki/doc/writers
Pkgs.writers: improve and document {makeScriptWriter,makeScriptWriterBin}
2024-08-10 18:48:21 +03:00
Someone
a3a5fb4bbc
Merge pull request #332437 from ShamrockLee/singularity-tools-fixes
singularity-tools: miscellaneous fixes
2024-08-10 13:44:11 +00:00
github-actions[bot]
68894e5504
Merge master into staging-next 2024-08-10 00:02:11 +00:00
Sandro Jäckel
f4e18f55ef fetch-npm-deps: be less noisy
Before every package in node_modules was printed. Lets be a bit more
quiet and drop that.
2024-08-09 15:08:33 -04:00
Johannes Kirschbauer
85a8d22290
Pkgs.writers: document {makeScriptWriter,makeScriptWriterBin} 2024-08-09 14:13:02 +02:00
Yueh-Shun Li
a1318915d3 singularity-tools: deprecate build helpers mkLayer and shellScript
Deprecate singularity-tools.mkLayer and singularity-tools.shellScript,
for they are no longer related to image building.

Use writers.writeBash instead of singularity-tools.shellScript.
2024-08-09 09:15:52 +00:00
Yueh-Shun Li
d3692ddf54 singularity-tools: drop override argument storeDir 2024-08-09 09:09:52 +00:00
Yueh-Shun Li
c2fa248bca singularity-tools: fix singularity run with bashInteractive 2024-08-09 09:07:46 +00:00
nicoo
18dd486bb9 emptyFile: use SRI hash 2024-08-08 20:06:21 +00:00
nicoo
244229a8b6 python3Packages.bork: add test using testers.runCommand
This will serve as a “real-world” example, running tests requiring network.
2024-08-08 15:29:15 +00:00
nicoo
d0a96c6eda testers.runCommand: add, document, and test 2024-08-08 15:29:14 +00:00
nicoo
906598c914 testers: format inputs per RFC166 2024-08-08 13:26:37 +00:00
github-actions[bot]
d240a34ea6
Merge master into staging-next 2024-08-08 06:01:15 +00:00
David McFarland
7f2de09531
Merge pull request #331398 from MattSturgeon/dotnet-finalAttrs
buildDotnetModule: add `finalAttrs` support
2024-08-07 22:06:07 -03:00
github-actions[bot]
3c3dab7679
Merge master into staging-next 2024-08-08 00:02:33 +00:00
Philip Taron
b0b3172fb4
replaceVars: init 2024-08-07 07:27:50 -07:00
Matt Sturgeon
79d26048de
buildDotnetModule: add finalAttrs support
Allow users to pass arguments to `buildDotnetModule` in the form:

```nix
buildDotnetModule (finalAttrs: {
  # Args
})
```

Exposing the behaviour of the underlying `mkDerivation` and allowing
packages to be defined in a recursive way that works correctly even when
the package is overridden, e.g. using `overrideAttrs`.

Added some simple test cases that piggyback on the existing
`structured-attrs` test.
2024-08-06 16:33:49 +01:00
github-actions[bot]
3b5460f093
Merge staging-next into staging 2024-08-06 00:02:48 +00:00
Philip Taron
fcefb0a17c
Merge pull request #332558 from motiejus/compressDrv
compressDrv: get rid of unneeded extra params
2024-08-05 14:58:06 -07:00
Philip Taron
1e6e7faa18
Merge pull request #332466 from hsjobeki/doc/compressDrv
Doc: pkgs{compressDrv,compressDrvWeb} improve clarity
2024-08-05 14:56:30 -07:00
Motiejus Jakštys
6b70cde244 compressDrv: get rid of unneeded extra params
This is a leftover from the original versions of #292324. Reduces the
API surface to not accept accidental arguments.
2024-08-05 23:26:17 +03:00
github-actions[bot]
cf88251824
Merge staging-next into staging 2024-08-05 18:01:40 +00:00
Marcus Ramberg
8e931f3330
Merge pull request #332462 from bolives-hax/bootstrap-tools-cross-add-s390x
Bootstrap tools cross add s390x
2024-08-05 18:41:17 +02:00
Johannes Kirschbauer
782c1eabe2
Docs: pkgs{compressDrv,compressDrvWeb} improve clarity 2024-08-05 14:16:54 +02:00