Commit Graph

8339 Commits

Author SHA1 Message Date
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
lelgenio
7783e118af yarnInstallHook: init 2024-09-04 11:15:47 -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
K900
105933cf4f pkgs/build-support/rust: fix warning-related eval issue 2024-09-03 17:04:55 +03:00
Artturin
89bb3dfc21
cc-wrapper: fix guessing mainProgram (#323611) 2024-09-03 02:17:57 +03:00
Alyssa Ross
459e958661 rust.lib: enable planned deprecation warnings 2024-09-02 21:48:21 +02: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
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]
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]
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]
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]
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]
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]
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
lelgenio
80a2825733 npmHooks.npmInstallHook: extract npmInstall{Manuals,Executables} 2024-08-26 20:43:42 -03: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
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
github-actions[bot]
1f86c1b2e8
Merge master into staging-next 2024-08-23 18:04:09 +00: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