Commit Graph

7690 Commits

Author SHA1 Message Date
Silvan Mosberger
1d14cc5182
Merge pull request #294944 from hercules-ci/docs-dedup-trivial-builders
trivial-builders: Deduplicate docs
2024-03-12 02:16:01 +01:00
Silvan Mosberger
aabd5fbfcf
Merge pull request #292259 from dawidd6/docker-nix-ssl
dockerTools: set NIX_SSL_CERT_FILE in image
2024-03-12 02:01:08 +01:00
Robert Hensing
e99021ff75 trivial-builders: Deduplicate docs
I didn't have the opportunity to do all work at once, so I've added
TODOs to bring attention to the situation.
2024-03-11 11:33:14 +01:00
David McFarland
445b240555
Merge pull request #290351 from corngood/dotnet-fixes
dotnet: infrastructure cleanup
2024-03-09 11:34:48 -04:00
github-actions[bot]
b2ae37aca4
Merge master into staging-next 2024-03-08 06:01:02 +00:00
adisbladis
434df3c94b
Merge pull request #289231 from adisbladis/fetchnpmlock
importNpmLock: init
2024-03-08 15:14:37 +13:00
David McFarland
92a255d13b nuget-to-nix: fix error handling 2024-03-06 10:14:21 -04:00
github-actions[bot]
d6370b05b5
Merge master into staging-next 2024-03-06 12:01:15 +00:00
Pol Dellaiera
c224b6e894
Merge pull request #293582 from drupol/build-support/php/improve-composer-validate
build-support/php: update `composer validate` steps
2024-03-06 10:47:35 +01:00
github-actions[bot]
8660ec23c7
Merge master into staging-next 2024-03-06 00:02:17 +00:00
David McFarland
5706443baf
Merge pull request #190129 from corngood/dotnet-sdk
dotnetCorePackages.dotnet_8: build from source
2024-03-05 18:41:04 -04:00
Pol Dellaiera
b2af238d31
build-support/php: update composer validate steps 2024-03-05 22:50:46 +01:00
Pol Dellaiera
bc627a6aca
build-support/php: move functions around (dry) 2024-03-05 19:39:35 +01:00
Pol Dellaiera
cf9e77ef8e
phpPackages.composer: 2.6.6 -> 2.7.1
Diff: https://github.com/composer/composer/compare/2.6.6..2.7.1
Changelog: https://github.com/composer/composer/releases/tag/2.7.1
Fix CVE: CVE-2024-24821
2024-03-05 19:39:35 +01:00
Pol Dellaiera
39502e7aa7
build-support/php/composer-local-repo-plugin: 1.0.3 -> 1.1.0 2024-03-05 19:39:35 +01:00
adisbladis
b6e4b86809 importNpmLock: init
This is an alternative to `fetchNpmDeps` that is notably different in that it uses metadata from `package.json` & `package-lock.json` instead of specifying a fixed-output hash.

Notable features:
- IFD free.
- Only fetches a node dependency once. No massive FODs.
- Support for URL, Git and path dependencies.
- Uses most of the existing `npmHooks`

`importNpmLock` can be used _only_ in the cases where we need to check in a `package-lock.json` in the tree.
Currently this means that we have 13 packages that would be candidates to use this function, though I expect most usage to be in private repositories.

This is upstreaming the builder portion of https://github.com/adisbladis/buildNodeModules into nixpkgs (different naming but the code is the same).
I will archive this repository and consider nixpkgs the new upstream once it's been merged.

For more explanations and rationale see https://discourse.nixos.org/t/buildnodemodules-the-dumbest-node-to-nix-packaging-tool-yet/35733

Example usage:
``` nix
stdenv.mkDerivation {
  pname = "my-nodejs-app";
  version = "0.1.0";

  src = ./.;

  nativeBuildInputs = [
    importNpmLock.hooks.npmConfigHook
    nodejs
    nodejs.passthru.python # for node-gyp
    npmHooks.npmBuildHook
    npmHooks.npmInstallHook
  ];

  npmDeps = buildNodeModules.fetchNodeModules {
    npmRoot = ./.;
  };
}
```
2024-03-05 12:23:28 +13:00
github-actions[bot]
6620dd578c
Merge master into staging-next 2024-03-04 12:06:01 +00:00
github-actions[bot]
1a3380fec6
Merge master into staging-next 2024-03-04 06:10:33 +00:00
Vladimír Čunát
ea4b95755d
Revert "writers: add support for wrapping" 2024-03-04 07:05:23 +01:00
lassulus
97345af560
Merge pull request #291854 from DavHau/writers-wrap
writers: add support for wrapping
2024-03-04 08:37:18 +07:00
David McFarland
6b047e397a mkNugetDeps: provide default for nugetDeps 2024-03-03 09:57:47 -04:00
David McFarland
ca181cefee nuget-to-nix: skip local sources 2024-03-03 09:57:47 -04: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
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
Dawid Dziurla
de8942e125
dockerTools: set NIX_SSL_CERT_FILE in image 2024-02-29 07:58:55 +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