Commit Graph

7672 Commits

Author SHA1 Message Date
github-actions[bot]
7e5216523f
Merge staging-next into staging 2024-03-04 06:11:00 +00:00
github-actions[bot]
1a3380fec6
Merge master into staging-next 2024-03-04 06:10:33 +00:00
lassulus
97345af560
Merge pull request #291854 from DavHau/writers-wrap
writers: add support for wrapping
2024-03-04 08:37:18 +07:00
Sandro
0c448ca515
Merge pull request #292616 from alyssais/libredirect-LFS64
libredirect: don't test LFS64 functions on musl
2024-03-02 20:31:14 +01:00
Martin Weinelt
76d0baf0c2
Merge pull request #292777 from alyssais/rustdoc-wrap
wrapRustc: wrap rustdoc
2024-03-02 15:09:14 +01:00
Alyssa Ross
6f8fa05acf
wrapRustc: wrap rustdoc
We need to set -crt-static on musl for rustdoc as well, so let's unify
the wrappers.  Ideally, rather than wrapping rustdoc, we'd have
rustdoc use the wrapped rustc, but that's currently only possible with
an unstable option (--test-builder).

The options set by the wrapper, -C target-feature and --sysroot, are
supported by both rustdoc and rustc, but other flags maybe not be
supported by both, so I've introduced different environment
variables (the existing NIX_RUSTFLAGS and a new NIX_RUSTDOCFLAGS) to
allow those to be set independently.

This fixes cargo-auditable in pkgsMusl., which broke because its
doctests stopped working when -crt-static was moved to the wrapper.

Fixes: 79156bf13a ("rustc: move crt-static default override to wrapper (#291829)")
2024-03-02 13:09:07 +01:00
github-actions[bot]
9819563ca9
Merge master into staging-next 2024-03-02 06:00:53 +00:00
Gabriella Gonzalez
b8698cd8d6
macOS support for NixOS tests (#282401)
Closes #193336
Closes #261694
Related to #108984

The goal here was to get the following flake to build and run on
`aarch64-darwin`:

```nix
{ inputs.nixpkgs.url = <this branch>;

  outputs = { nixpkgs, ... }: {
    checks.aarch64-darwin.default =
      nixpkgs.legacyPackages.aarch64-darwin.nixosTest {
        name = "test";

        nodes.machine = { };

        testScript = "";
      };
  };
}
```

… and after this change it does.  There's no longer a need for the
user to set `nodes.*.nixpkgs.pkgs` or
`nodes.*.virtualisation.host.pkgs` as the correct values are inferred
from the host system.
2024-03-02 06:33:14 +01:00
Alyssa Ross
13eea132c0
libredirect: don't test LFS64 functions on musl
These were removed in musl 1.2.4.
2024-03-02 01:02:36 +01:00
github-actions[bot]
18bc3c64e6
Merge master into staging-next 2024-03-01 12:00:58 +00:00
Vladimír Čunát
0e4d8e918e
Merge #291901: clang: don't set -march for overridden target
...into staging-next
2024-03-01 11:32:18 +01:00
Alyssa Ross
12b0e8ac74
clang: don't set -march for overridden target
If -target is explicitly passed to clang, we shouldn't pass our -march
value for the default target, because it probably won't exist for the
target being used.  Up until now, clang has been lenient with this,
but it's a hard error with clang 17, so since gcc.arch is always set
on aarch64, fixing this is a hard requirement for upgrading our
default clang to 17.

Before (with clang 17 on aarch64-linux):

	$ clang -target bpf -c -o /dev/null test.bpf.c
	clang: warning: ignoring '-fstack-protector-strong' option as it is not currently supported for target 'bpf' [-Woption-ignored]
	clang: error: unsupported option '-march=' for target 'bpf'
	clang: warning: argument unused during compilation: '--gcc-toolchain=/nix/store/cngak08nb1yk44gnjipv5rg1ahh1xkax-gcc-13.2.0' [-Wunused-command-line-argument]

After:

	$ clang -target bpf -c -o /dev/null test.bpf.c
	clang: warning: ignoring '-fstack-protector-strong' option as it is not currently supported for target 'bpf' [-Woption-ignored]
	clang: warning: argument unused during compilation: '--gcc-toolchain=/nix/store/cngak08nb1yk44gnjipv5rg1ahh1xkax-gcc-13.2.0' [-Wunused-command-line-argument]
2024-03-01 09:51:49 +01:00
lassulus
2db7e7c5e2
Merge pull request #292300 from hsjobeki/writers
doc & fix: Clean up writers/data.nix file
2024-03-01 13:44:29 +07:00
github-actions[bot]
c7d7e4a7a5
Merge staging-next into staging 2024-02-29 18:01:30 +00:00
Pol Dellaiera
2bf7ff4806
Merge pull request #289840 from PigeonF/master
Make `dockerTools.buildImageWithNixDb` reproducible
2024-02-29 13:03:07 +01:00
DavHau
3e3ae4ecf5 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-02-29 17:31:58 +07:00
Johannes Kirschbauer
54658a47d0
doc: improve pkgs.writers comments 2024-02-29 10:38:03 +01:00
Martin Weinelt
65b31e498a Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/development/python-modules/influxdb/default.nix
- pkgs/development/tools/misc/binutils/default.nix
2024-02-29 07:19:15 +01:00
Thomas Lepoix
6aa4ed4487
applyPatches: Fix a bug (#283887) 2024-02-29 01:29:48 +01:00
Silvan Mosberger
cd5dc76d83 substitute: Deprecate replacements, introduce replacementsList
Also:
- Add tests
- Treewide update
- Improve docs
2024-02-29 00:35:27 +01:00
Alyssa Ross
79156bf13a
rustc: move crt-static default override to wrapper (#291829)
Previously, when cross compiling from non-musl to musl, the crt-static
default override wouldn't be applied, because the compiler wouldn't
have been built with it due to fastCross.  Moving it to the wrapper
fixes this without having to introduce extra compiler rebuilds.  And
because the wrapper is applied even to the bootstrap rustc, we no
longer need special handling of crt-static in the Cargo expression.

Unlike --sysroot, rustc allows -C target-feature= to be passed
multiple times, with later instances taking precedence over earlier
ones.  This means that it's very easy to set the default in the
wrapper, just by our overridden default before any other arguments.

This fixes pkgsCross.aarch64-multiplatform-musl.mesa from x86_64-linux.
2024-02-28 23:10:07 +01:00
github-actions[bot]
6de655cb49
Merge staging-next into staging 2024-02-28 06:01:43 +00:00
Robert Hensing
57c1108204
Merge pull request #282886 from WxNzEMof/docker-tools-uid
Allow streaming layered containers with non-root Nix store
2024-02-28 03:43:07 +01:00
github-actions[bot]
ac95e31c0c
Merge staging-next into staging 2024-02-27 00:02:36 +00:00
Thomas Gerbet
3a19a727c8
Merge pull request #285828 from drupol/php/remove-COMPOSER-ROOT-VERSION-env
build-support/php: set `COMPOSER_ROOT_VERSION` environment variable
2024-02-26 20:38:02 +01:00
WxNzEMof
b2f19980db Remove the redundant comments from streamLayeredImage parameters
The proper place to describe them is the documentation, where they are
described thoroughly.
2024-02-26 19:29:04 +00:00
WxNzEMof
2697d34603 streamLayeredImage: Change mode of /nix, /nix/store to 755
The change is insignificant when the owner is root.  However, when it
is not root, this change is needed to allow using Nix (as an
unprivileged user) inside the container.
2024-02-26 18:10:51 +00:00
WxNzEMof
0ec13cdb90 streamLayeredImage: Allow customizing ownership
This opens the way towards building images where Nix can be used as an
unprivileged user (in single-user mode).
2024-02-26 18:10:51 +00:00
github-actions[bot]
41e7732291
Merge staging-next into staging 2024-02-25 18:01:23 +00:00
Thomas Heijligen
f2a142727c gnatPackages: Add scope for all ada packages
Ada depencencies musst be build with the same gnat version as the
project. Use a namespace as preperation to build with different gnat
versions.

gprbuild and gnatprove are still globaly visable.
2024-02-25 18:19:50 +01:00
Pol Dellaiera
f43fb4c110
build-support/php: set COMPOSER_ROOT_VERSION by default 2024-02-25 10:03:22 +01:00
Robert Scott
4a91b3e798 cc-wrapper: add trivialautovarinit hardening flag support
this equates to -ftrivial-auto-var-init=pattern

clang has removed support for -ftrivial-auto-var-init=zero and
are unlikely to re-add it, so use -ftrivial-auto-var-init=pattern
on both compilers if only to make behaviour more consistent
between the two.

add to pkgsExtraHardening's defaultHardeningFlags.
2024-02-24 12:00:09 +00:00
Weijia Wang
5f5062d1ef Merge branch 'master' into staging-next 2024-02-23 05:09:55 +01:00
Sandro
f9bc4e1718
Merge pull request #277494 from trofi/buildFHSEnv-fix-eval 2024-02-22 21:00:19 +01:00
Bruno Bigras
8be4892fcb
Merge pull request #283572 from baracoder/appimage-pipewire
appimage-run: Add pipewire support
2024-02-22 14:17:54 -05:00
github-actions[bot]
2d9ce4a9af
Merge master into staging-next 2024-02-19 18:01:11 +00:00
Robert Hensing
d2dfcfcfad
Merge pull request #289584 from athre0z/docker-zstd
dockerTools: configurable compression schema
2024-02-19 18:06:54 +01:00
Herman Fries
30f9f9c2e5 appimage-run: Add pipewire support 2024-02-18 22:34:27 +01:00
pigeon
2cea1dce6d
nixos/dockerTools: make buildImageWithNixDb reproducible
The loaded database contains timestamps of when the nix paths were
registered. Depending on the host store, these can differ between runs.
Resetting them to a well known values ensures that the produced image is
reproducible.
2024-02-18 21:16:35 +01:00
Joel Höner
4b603ad9cd dockerTools: configurable compression schema
This commit adds support for swapping out the compression algorithm
used in all major docker-tools commands that generate images. The
default algorithm remains unchanged (gzip).
2024-02-17 18:52:42 +01:00
github-actions[bot]
e662338182
Merge staging-next into staging 2024-02-17 12:01:31 +00:00
DavHau
81d43b9b83 fetchPypiLegacy: add test 2024-02-17 17:11:59 +13:00
adisbladis
d52b3a7cc0 fetchPypiLegacy: init PyPi legacy API fetcher
This fetcher is to be used with PyPi mirrors exposing the "legacy" API, such as devpi.

A variant of this fetcher has been used in poetry2nix for years and
has served us well there to support private PyPi mirrors and Devpi.

Example usage:
``` nix
fetchPypiLegacy {
  file = "urllib3-1.26.2.tar.gz";
  hash = "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08";
  pname = "urllib3";
  url = "https://pypi.org/simple";
}
```

cc @lewo who wrote the this originally
cc contributors @rskew @gmacon @jperras @Smaug123
2024-02-17 17:11:59 +13:00
Rick van Schijndel
b728d76d0e
Merge pull request #255463 from emilylange/stdenv/patch-shebangs-trailing-newline
patch-shebangs: fix crash with shebang without trailing newline
2024-02-16 18:33:27 +01:00
Pol Dellaiera
4dfb2b2405
build-support/php: replace preCheckInstall, postCheckInstall with preInstallCheck, postInstallCheck 2024-02-15 22:26:18 +01:00
Robert Hensing
dcf985388c
Merge pull request #271976 from r-k-b/fix-dockerTools-includeStorePaths
nixos/dockerTools: fix includeStorePaths when enableFakechroot
2024-02-14 23:38:44 +01:00
Will Fancher
f8781c3668
Merge pull request #283770 from r-ryantm/auto-update/makeInitrdNGTool
makeInitrdNGTool: 0.1.0 -> 0.1.0
2024-02-10 22:19:21 -05:00
github-actions[bot]
a7f4ae0644
Merge master into staging-next 2024-02-09 12:01:11 +00:00
Orivej Desh (NixOS)
a1c4193600
Merge pull request #285964 from melvyn2/patch-1
build-fhs-user-env: add compatibility for pipewire alsa emulation
2024-02-09 08:17:38 +00:00
github-actions[bot]
13d222c591
Merge master into staging-next 2024-02-08 18:01:04 +00:00