Commit Graph

7713 Commits

Author SHA1 Message Date
adisbladis
5ef1bd952c build-support/lib/cmake: Statically compute default cmake flags 2024-03-20 16:35:31 +13:00
Someone
63709965b7
Merge pull request #178717 from ShamrockLee/write-multiple-references
trivial-builders: replace writeReferencesToFile with writeClosure
2024-03-19 08:57:20 +00:00
Pol Dellaiera
186c3e34a7
Merge pull request #296549 from TomaSajt/strip-java-archives-hook
add stripJavaArchivesHook and use treewide
2024-03-19 05:41:08 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
Yueh-Shun Li
112c3d5ecd ociTools.buildContainer: writeReferencesToFile -> writeClosure 2024-03-19 05:30:54 +08:00
Yueh-Shun Li
67ec1a7d7b dockerTools.buildImage: writeReferencesToFile -> writeClosure 2024-03-19 05:30:54 +08:00
Yueh-Shun Li
5c1a3b619d singularity-tools.buildImages: use writeClosure 2024-03-19 05:30:54 +08:00
Yueh-Shun Li
e28ad1a0a3 referenceByPopularity: rename in comment writeReferencesToFile -> writeClosure 2024-03-19 05:30:53 +08:00
Yueh-Shun Li
8a8d07bc15 tests.trivial-builders.references: test writeClosure
Test writeClosure instead of writeReferencesToFile.

Add multiple-path test for writeReferenceClosureToFile.

Rename variables:
- references -> closures (passthru affected)
- REFERENCES -> CLOSURES
2024-03-19 05:30:42 +08:00
Yueh-Shun Li
e9fd4389d2 writeClosure: init, replacing writeReferencesToFile
Replace writeReferencesToFile with writeClosure.

Make writeClosure accept a list of paths instead of a path.

Re-implement with JSON-based exportReferencesGraph interface provided by
__structuredAttrs = true.

Reword the documentation.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Someone Serge <sergei.kozlukov@aalto.fi>
2024-03-19 02:45:50 +08:00
TomaSajt
48285f7169
stripJavaArchivesHook: rename from canonicalize-jars-hook and use strip-nondeterminism 2024-03-17 13:30:54 +01:00
a-n-n-a-l-e-e
8c421f78b2
Merge pull request #296082 from a-n-n-a-l-e-e/dont-pass-march-swift
swift: don't pass -march to swiftc
2024-03-16 19:18:41 -07:00
annalee
8a7841ceef
swift: don't pass -march to swiftc
swiftc uses cc-wrapper which sets the -march flag on some systems which
breaks the build. This change adds a flag, disableMarch, to cc-wrapper
which disables using the -march flag.
https://github.com/NixOS/nixpkgs/issues/295322
2024-03-16 11:02:44 +00:00
Emily Trau
8bb29a3881
Merge pull request #295954 from bjornfor/revert-avrlibc-revdeps-breakage
Revert "avrlibc: hook up libdir for cc-wrapper"
2024-03-16 14:34:01 +11:00
lassulus
6fd3c2ebcf
Merge pull request #295982 from philiptaron/remove-lib-or-usages
Avoid `lib.or` in `pkgs/build-support/writers/`
2024-03-15 20:23:18 +07:00
Philip Taron
dc59ca2bd9
Avoid lib.or in pkgs/build-support/writers/ 2024-03-14 14:11:11 -07:00
Pol Dellaiera
8c40e060f3
build-support/php: update warnings when composer validate fails 2024-03-14 21:52:08 +01:00
Bjørn Forsman
6ff5b79096 Revert "avrlibc: hook up libdir for cc-wrapper"
This reverts commit b2844f89d1.

It broke simavr:

  $ nix-build -A simavr
  [...]
  /nix/store/3k4djrsq23m2yg9ar4h1lkkz1ijv0ghv-avr-binutils-2.41/bin/avr-ld: /nix/store/3rpyzla18mbj690hv7j5dang0kd3c1fq-avr-libc-avr-2.1.0/avr/lib/libc.a(vfprintf_std.o): in function `.L15':
  vfprintf.c:(.text.avr-libc+0xd8): undefined reference to `__mulqi3'
  /nix/store/3k4djrsq23m2yg9ar4h1lkkz1ijv0ghv-avr-binutils-2.41/bin/avr-ld: /nix/store/3rpyzla18mbj690hv7j5dang0kd3c1fq-avr-libc-avr-2.1.0/avr/lib/libc.a(vfprintf_std.o): in function `.L18':
  vfprintf.c:(.text.avr-libc+0xe4): undefined reference to `__mulqi3'
  collect2: error: ld returned 1 exit status
  make[1]: *** [../Makefile.common:161: atmega644_adc_test.axf] Error 1
  make[1]: Leaving directory '/build/source/tests'
  make: *** [Makefile:21: build-tests] Error 2

Fixes #295610.
2024-03-14 20:09:11 +01:00
Silvan Mosberger
f60515ddea
Merge pull request #293416 from DanielSidhion/remove-makesnap
snapTools: remove
2024-03-14 16:46:22 +01:00
Lily Foster
ae86a507ed npmHooks.npmInstallHook: ignore bundle deps when calculating files to install
This assumes that downstream users of `buildNpmPackage` would rather our
own built `node_modules` be copied to the output rather than only the
`bundleDependencies` specified in the `package.json` file.

Having the latter behavior seems unexpected and unintuitive, and would
not work as installing from an `npm pack` is intended to (since doing
that would not do a `rebuild` step on those dependencies and it would
skip reifying a full dependency tree).
2024-03-14 14:04:51 +01:00
Robert Hensing
09364e249d
Merge pull request #295378 from hercules-ci/makeDerivationArgument
make-derivation.nix: Factor out `makeDerivationArgument`
2024-03-14 13:01:35 +01:00
Robert Hensing
8dad51a2e2 make-derivation.nix: Split makeDerivationArgument, mkDerivation with duplicate functionality 2024-03-12 18:16:56 +01:00
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
DS
1d85557b50 snapTools: remove
`snapTools.makeSnap` has produced broken snaps since at least Oct 2020,
as indicated by the following issue: https://github.com/NixOS/nixpkgs/issues/100618

No person has shown interest in maintaining it, and given that there is
no fix available, it's assumed that all attempts made to fix that
function have not succeeded.

Given that `snapTools` only contained `makeSnap`, it was removed
completely.
2024-03-04 22:22:14 -08: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