Commit Graph

5972 Commits

Author SHA1 Message Date
Robert Hensing
16f5747575
Merge pull request #175649 from Artturin/opt-in-structured-attrs
stdenv: support opt-in __structuredAttrs
2022-12-10 21:12:43 +01:00
figsoda
cfc6213879
Merge pull request #204686 from figsoda/auditable
rustPlatform.buildRustPackage: build auditable binaries
2022-12-09 16:46:45 -05:00
Artturi
91d19a6e66
Merge pull request #204692 from Artturin/relative-links-fix-error
make-symlinks-relative: fix no such file or directory if output is cr…
2022-12-09 19:27:41 +02:00
Vladimír Čunát
9c497bb8d6
Merge branch 'staging-next' into staging 2022-12-09 10:27:46 +01:00
Robert Hensing
454d2307ae nixosTests.docker-tools: Fix nginx test 2022-12-08 22:29:10 +01:00
Robert Hensing
3e28f972fc dockerTools: refactor, rename internal variable
> has to fit its domain, which is the OCI spec, which uses
> `architecture`. The `defaultArch` and `GOARCH` names are irrelevant.
2022-12-08 20:29:10 +01:00
Christian Kemper
f6ae4479ea dockerTools: allowing architecture to be specified
... for buildImage, buildLayeredImage and streamLayeredImage,
adding docs and tests.
2022-12-08 20:29:09 +01:00
Artturin
c01f509e44 treewide: source .attrs in builders
if theres a source $stdenv then this is needed

for structuredAttrs
2022-12-08 21:09:02 +02:00
Artturin
adc8900df1 treewide: fix some core package structuredAttrs 2022-12-08 21:05:28 +02:00
Artturin
734d7df235 allow derivation attributes in env
derivations can be coerced to their output paths
2022-12-08 06:13:19 +02:00
Artturin
238a6053c4 stdenv: support opt-in __structuredAttrs
Co-authored-by: Robin Gloster <mail@glob.in>

stdenv: print message if structuredAttrs is enabled

stdenv: add _append

reduces the chance of a user doing it wrong

fix nix develop issue

output hooks don't work yet in nix develop though

making $outputs be the same on non-structuredAttrs and structuredAttrs
is too much trouble.

lets instead make a function that gets the output names

reading environment file '/nix/store/2x7m69a2sm2kh0r6v0q5s9z1dh41m4xf-xz-5.2.5-env-bin'
nix: src/nix/develop.cc:299: std::string Common::makeRcScript(nix::ref<nix::Store>, const BuildEnvironment&, const Path&): Assertion `outputs != buildEnvironment.vars.end()' failed.

use a function to get all output names instead of using $outputs

copy env functionality from https://github.com/NixOS/nixpkgs/pull/76732/commits
2022-12-08 06:13:19 +02:00
figsoda
a6137b73f9 cargo-auditable-cargo-wrapper: init 2022-12-07 00:23:43 -05:00
John Ericson
8890f3b893
Merge pull request #203766 from obsidiansystems/build-rust-crate-link-flags
buildRustCrate: Support `cargo:rustc-link-arg` and some friends from build.rs
2022-12-06 21:48:07 -05:00
Greg Pfeil
58eb3d3806 mkshell: refactor Bash snippet
I’ve been using https://github.com/Fuuzetsu/shellcheck-nix-attributes on most of
my derivations, and attaching it to one derived from `mkShell` resulted in

```
shellcheck_buildPhase

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 1:
echo "------------------------------------------------------------" >>$out
^-- SC2129 (style): Consider using { cmd1; cmd2; } >> file instead of individual redirects.
                                                                      ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo "------------------------------------------------------------" >>"$out"

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 2:
echo " WARNING: the existence of this path is not guaranteed." >>$out
                                                                 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo " WARNING: the existence of this path is not guaranteed." >>"$out"

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 3:
echo " It is an internal implementation detail for pkgs.mkShell."   >>$out
                                                                      ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo " It is an internal implementation detail for pkgs.mkShell."   >>"$out"

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 4:
echo "------------------------------------------------------------" >>$out
                                                                      ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo "------------------------------------------------------------" >>"$out"

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 5:
echo >> $out
        ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo >> "$out"

In /nix/store/8774inwznc87dwhac90winc9b5k6gmkb-nix-shell_shellcheck_buildPhase line 7:
export >> $out
          ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
export >> "$out"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>...
```
——— https://garnix.io/build/qgxbameB

This addresses the shellcheck complaints.
2022-12-07 01:25:48 +01:00
Martin Weinelt
60f52f6c83 Merge remote-tracking branch 'origin/staging-next' into staging 2022-12-06 01:27:11 +01:00
github-actions[bot]
0ac4c6779e
Merge master into staging-next 2022-12-06 00:02:32 +00:00
figsoda
0e5137f267 rustPlatform.buildRustPackage: make it not auditable by default 2022-12-05 18:46:00 -05:00
figsoda
ff93685724
Merge pull request #199371 from figsoda/fetchCrate
fetchCrate: rewrite in terms of fetchzip
2022-12-05 18:15:33 -05:00
Artturin
6c01681679 make-symlinks-relative: fix no such file or directory if output is created in postFixup
wlroots(and others) have
```
wlroots> +++ find /nix/store/3a0xwszw8n5dzzhsgfnilvsqi4hk565s-wlroots-0.15.1-examples -type l -print0
wlroots> find: '/nix/store/3a0xwszw8n5dzzhsgfnilvsqi4hk565s-wlroots-0.15.1-examples': No such file or directory
```

because the examples output is created in postFixup while this hook runs in fixupPhase
2022-12-06 00:08:11 +02:00
figsoda
8a041c63c0 rustPlatform.buildRustPackage: build auditable binaries 2022-12-05 16:18:17 -05:00
Sandro
4484c12d81
Merge pull request #196449 from natto1784/crate-overrides 2022-12-05 22:00:51 +01:00
Jörg Thalheim
1a70303230
Merge pull request #204497 from Mic92/go-build
buildGo{module,package}: do not build with verbose flags
2022-12-05 13:43:36 +01:00
Martin Weinelt
2c56dc4832 Merge remote-tracking branch 'origin/staging-next' into staging 2022-12-04 22:07:03 +01:00
Martin Weinelt
fe8eef1ae4 Merge remote-tracking branch 'origin/master' into staging-next 2022-12-04 22:06:42 +01:00
Jörg Thalheim
4a94d77712 buildGo{module,package}: do not build with verbose flags
This creates a lot of noise that can hide actual compile errors.
2022-12-04 16:42:53 +01:00
figsoda
75c01e730d
Merge pull request #203520 from figsoda/nextest
rustPlatform.buildRustPackage: add cargo-nextest support
2022-12-03 19:03:34 -05:00
Luke Granger-Brown
d6b617b124
Merge pull request #203743 from lukegb/yubioath-flutter
yubioath-flutter: init at 6.0.2
2022-12-03 12:10:43 -08:00
github-actions[bot]
1ac9e3255b
Merge staging-next into staging 2022-12-03 06:02:18 +00:00
github-actions[bot]
7ec4183673
Merge master into staging-next 2022-12-03 06:01:28 +00:00
Sandro
02e6e7a535
Merge pull request #202765 from mdarocha/roslyn-update 2022-12-03 05:27:19 +01:00
Martin Weinelt
e3da5a807b Merge remote-tracking branch 'origin/staging-next' into staging 2022-12-03 01:28:01 +01:00
github-actions[bot]
a83c4dd193
Merge master into staging-next 2022-12-03 00:02:19 +00:00
Zane van Iperen
1d0b9702fc bintools-wrapper: add dlltool, dllwrap, windmc, and windres 2022-12-03 00:28:59 +01:00
Guillaume Girol
c1c6998684
Merge pull request #203598 from symphorien/appimage-owd
appimage-run: export OWD
2022-12-02 20:12:49 +00:00
Robert Hensing
dbdd8fad26 testers.testBuildFailure: Read last log line without final newline 2022-12-02 16:12:50 +00:00
Victor Engmark
f7cbf3f7ca build-support: Quote expansions inside ${…}
As per ShellCheck:

> SC2295 (info): Expansions inside ${..} need to be quoted separately,
> otherwise they match as patterns.
2022-12-02 04:59:43 -05:00
Luke Granger-Brown
8a4ef88653 mkFlutterApp: support apps which don't produce a .packages 2022-12-02 03:22:52 +00:00
github-actions[bot]
7ea4004879
Merge master into staging-next 2022-12-01 06:01:22 +00:00
Robert Hensing
c2f071abc2
Merge pull request #182250 from Artturin/fetchpatch2
fetchpatch2: init
2022-12-01 01:31:46 +00:00
github-actions[bot]
cb51cfe745
Merge master into staging-next 2022-11-30 18:01:11 +00:00
Nick Cao
994deb2bf1 cc-wrapper: fix path to libcxx includes for cross compilers 2022-11-30 18:46:16 +01:00
John Ericson
fde3b57055 buildRustCrate: Support cargo:rustc-link-arg and some friends from build.rs
See https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-link-argfor details. We are supporting:

 - `cargo:rustc-link-arg`
 - `cargo:rustc-link-arg-bins`
 - `cargo:rustc-link-arg-lib`

at this time.

`cargo:rustc-link-arg-bin` is left as future work because the per-binary
flag keeping is more difficult.
2022-11-30 11:40:50 -05:00
github-actions[bot]
aff62e907a
Merge master into staging-next 2022-11-30 06:01:30 +00:00
Izorkin
fc7eef65a2 dockerTools: fix nginx test 2022-11-30 15:23:43 +10:00
github-actions[bot]
843fc7a4a5
Merge master into staging-next 2022-11-29 18:01:54 +00:00
figsoda
1341c60941
Merge pull request #203561 from l0b0/fix/macos-sierra-reexport-hack-SC2242
build-support: Use equivalent valid exit code
2022-11-29 11:41:21 -05:00
Guillaume Girol
c0cdf0ad4b appimage-run: export OWD
documented here: https://docs.appimage.org/packaging-guide/environment-variables.html

Fixes #203330
2022-11-29 12:00:00 +00:00
Victor Engmark
2a028c4f46 build-support: Use equivalent valid exit code
`exit -1` is equivalent to `exit 255`, since Bash does modulo 256 on the
number.

As per ShellCheck:

> SC2242 (error): Can only exit with status 0-255. Other data should be
> written to stdout/stderr.
2022-11-29 19:11:45 +13:00
figsoda
d3eb606296 rustPlatform.buildRustPackage: add useNextest option to check with cargo-nextest 2022-11-28 17:00:17 -05:00
figsoda
0643540f97 rustPlatform.cargoNextestHook: init 2022-11-28 16:59:52 -05:00