Commit Graph

3895 Commits

Author SHA1 Message Date
Adrian
a6133b7a39
writers.makeScriptWriter: fix on Darwin\MacOS (#93757)
* writers.makeScriptWriter: fix on Darwin\MacOS

On Darwin a script cannot be used as an interpreter in a shebang line, which
causes scripts produced with makeScriptWriter (and its derivatives) to fail at
run time if the used interpreter was wrapped with makeWrapper (as in the case
of python3.withPackages).

This commit fixes the problem by detecting if the interpreter is a script
and prepending its shebang to the final interpreter line.

For example if used interpreter is;
```
/nix/store/ynwv137n2650qy39swcflxbcygk5jwv1-python3-3.8.3-env/bin/python
```

which is a script with following shebang:
```
#! /nix/store/knd85yc7iwli8344ghav3zli8d9gril0-bash-4.4-p23/bin/bash -e
```

then the shebang line in the produced script will be
```
#! /nix/store/knd85yc7iwli8344ghav3zli8d9gril0-bash-4.4-p23/bin/bash -e /nix/store/ynwv137n2650qy39swcflxbcygk5jwv1-python3-3.8.3-env/bin/python
```

This works on Darwin since there does not seem to be a limit to the length
of the shabang line and the shebang lines support multiple arguments to
the interpreters (as opposed to linux where the kernel imposes a strict limit
on shebang lengh and everything following the interpreter is passed to it
as a single string).

fixes; #93609
related to: #65351 #11133 (and probably a bunch of others)

NOTE: scripts produced on platforms other than Darwin will remain unmodified
by this PR. However it might worth considering extending this fix to BSD systems
in general. I didn't do it since I have no way of testing it on systems other
than MacOS and linux.

* writers.makeScriptWriter: fix typo in comment

* writers.makeScriptWriter: fail build if interpreter of interpreter is a script
2020-07-25 11:47:20 +02:00
Lassulus
a2ba53f4e1
Merge pull request #93758 from adrian-gierakowski/improve-writers.writePython
writers.writePython2 and writePython3: use "bare" python if no deps are needed
2020-07-25 11:43:56 +02:00
Jörg Thalheim
0216dbd769
Merge pull request #93165 from jbedo/singularity
singularity: 3.2.1 -> 3.6.1
2020-07-24 16:57:59 +01:00
Adrian Gierakowski
76437a88bb writers.writePython2 and writePython3: use "bare" python if no deps are needed
`python.withPackages` has a runtime dependecy on bash since it's wrapped with
`makeWrapper`. This fix avoids bash as runtime dependency when it's not
needed.

as discussed here: https://github.com/NixOS/nixpkgs/issues/93609#issuecomment-662880047
2020-07-24 11:39:01 +01:00
adisbladis
e890823467
emacs: Add native builds for nativeComp enabled emacsen 2020-07-24 03:16:17 +02:00
Justin Bedo
712f1ee9aa
singularity: 3.2.1 -> 3.6.1 2020-07-22 08:51:37 +10:00
Ryan Mulligan
b78ffda2b5
Merge pull request #93398 from IvarWithoutBones/appimage-run-fix
appimage: switch to gst-plugins-base 1.0
2020-07-21 08:12:13 -07:00
IvarWithoutBones
0269421b7b appimage: switch to gst-plugins-base 1.0 2020-07-18 11:51:05 +02:00
zowoq
0f19b9ba72
Revert "Group packages by language/builder via dummy maintainer" 2020-07-18 17:45:08 +10:00
Luke Granger-Brown
d7d4a92695 buildBazelPackage: add "fetchConfigured" for fetching only things required for the build
"bazel fetch" will, by default, fetch everything that _might_ be used,
including things that will later be discarded due to the way the build
is configured.

Concretely, this means that for some builds of Java packages, this will
avoid failures where the builder tries to retrieve the JDK from /usr/share/java
(or equivalent).

This also means that for most packages we can fetch _fewer_ dependencies,
since the standard tree pruning for artifacts to fetch will take effect.

fetchConfigured is disabled by default since it changes the fetch hashes
of tensorflow/tensorflow2 (since it ends up fetching less).
2020-07-17 18:29:58 +02:00
zowoq
2613e6d0e7 buildRustPackage: add nixpkgs-rust maintainer 2020-07-17 11:16:54 +10:00
Robert Hensing
c1908bf802
Merge pull request #92934 from hercules-ci/dockerTools-set-imageTag
dockerTools: Always set imageTag attribute
2020-07-16 17:05:58 +02:00
Robert Hensing
8c0459f611 dockerTools: Always set imageTag attribute
The image tag can be specified or generated from the output hash.
Previously, a generated tag could be recovered from the evaluated
image with some string operations.

However, with the introduction of streamLayeredImage, it's not
feasible to compute the generated tag yourself.

With this change, the imageTag attribute is set unconditionally,
for the buildImage, buildLayeredImage, streamLayeredImage functions.
2020-07-11 16:58:25 +02:00
Frederik Rietdijk
ae8eee9c3f Merge master into staging-next 2020-07-11 08:59:54 +02:00
Jos van Bakel
66737168a4
dockerTools.buildLayeredImage: fix created=now 2020-07-09 09:34:18 +02:00
Matthew Bauer
669eb09bd5
Merge branch 'master' into fetchurl-no-hash 2020-07-06 14:40:49 -04:00
Utku Demir
06db331922
dockerTools: Verify nix-store contents on buildLayeredImage test 2020-07-06 16:59:58 +12:00
Utku Demir
2ae2186dfd
dockerTools.streamLayeredImage: Correctly copy hardlinks 2020-07-06 16:42:03 +12:00
Utku Demir
cc46362929
dockerTools: Support files directly under /nix/store
Also makes sure that the files inside a layer added in a sorted order
to make the results more deterministic.
2020-07-04 22:00:57 +12:00
Flakebi
deb78151a9 buildRustPackage: fix cargoBuildFlags
When features were supplied in cargoBuildFlags, the binaries were built
with these features enabled. Unless checking was disabled, `cargo test`
was executed without these build flags, meaning the binaries were
rebuilt and overwritten without the specified features.

Fix this bug by running tests after the installation phase.
2020-07-03 08:53:57 +10:00
Vladimír Čunát
9dcb508f2d
Merge #92089: {cc,bintools}-wrapper: Some fixes 2020-07-02 23:23:04 +02:00
Frederik Rietdijk
c33ca7c5ce Merge staging-next into staging 2020-07-02 17:14:53 +02:00
Vincent Laporte
885fb1406d ocamlPackages.buildOasis: fix handling of installation prefix 2020-07-02 07:13:34 +02:00
John Ericson
704daf7a6e {bintools,cc}-wrapper: Ensure nix-support/*-flags files exist
This will unbreak firefox and a few other packages which try to grab
some of the libcxx flags.
2020-06-30 18:26:37 +00:00
John Ericson
1085403acd {cc,bintools}-wrapper: Comments no longer spliced
This means we can freely keep the comments up to date without the
penalty of a mass rebuild.
2020-06-30 15:04:10 +00:00
Alyssa Ross
1421404d42 stdenv: fix backward multiple outputs conditional
This is supposed to shareDocName to a fallback value if it can't be
determined from looking at the configure script.  But the conditional
checked whether shareDocName was set, rather than if it wasn't.  This
meant that if shareDocName had been detected from a configure script,
it would be immediately overridden by the package name, and if it
couldn't be detected, shareDocName would remain unset.

This resulted in QEMU installing files like $out/share/doc/index.html,
which should of course have been in $out/share/doc/qemu/index.html.

An interesting side effect of this is that, since
9f8751528cd89d343258dd718afa56f8590917bb when this code was added, the
detected package name has never actually been used for installing
documentation, because it would always be overridden.  So this patch
will actually enable that for the first time, four years later.

Fixes: https://github.com/NixOS/nixpkgs/issues/90486
2020-06-29 13:56:27 +00:00
John Ericson
fa54dd346f
Merge pull request #85189 from Ericson2314/cxx-wrapper-debt
C++ compilers: Be sane with standard libraries
2020-06-22 10:38:34 -04:00
DavHau
c8c09b7dda add autoPatchelfIgnoreMissingDeps to auto-patchelf.sh 2020-06-22 10:41:35 +02:00
John Ericson
f3f7612a40 C++ Compilers: Systematize handling of standard libraries 2020-06-22 04:24:44 +00:00
Utku Demir
fa8f2bf34f
stream_layered_image: Use pathlib module for directory traversal 2020-06-22 15:11:04 +12:00
Utku Demir
16199521ea
stream_layered_image: Always set uid and gid to root 2020-06-21 12:35:39 +12:00
Utku Demir
fe71abfc12
stream_layered_image: Clarify assertion failure 2020-06-21 12:35:39 +12:00
Utku Demir
87a538e149
stream_layered_image: Use more descriptive variable name 2020-06-21 12:35:39 +12:00
Utku Demir
4bff5b7f3d
dockerTools: Properly quote a shell variable 2020-06-21 12:35:39 +12:00
Utku Demir
f1d7a09146
stream_layered_image: Add docstrings to functions 2020-06-21 12:35:38 +12:00
Utku Demir
26402290bf
stream_layered_image: Add main method 2020-06-21 12:35:38 +12:00
Utku Demir
307804d97d
dockerTools.streamLayeredImage: comments 2020-06-21 12:35:38 +12:00
Utku Demir
4ab7baf6f6
stream_layered_image.py: comments 2020-06-21 12:35:38 +12:00
Utku Demir
a5a611cacb
Set mtime in even more places 2020-06-21 12:35:38 +12:00
Utku Demir
4e0109f873
Set mtime to get more deterministic builds 2020-06-21 12:35:37 +12:00
Utku Demir
560201da66
Implement dockerTools.streamLayeredImage 2020-06-21 12:35:32 +12:00
Robert Hensing
06469493de
Merge pull request #91085 from hercules-ci/fix-dockerTools-nix-symlinks
Fix docker tools nix symlinks
2020-06-19 12:01:47 +02:00
Robert Hensing
2dd94af186 dockerTools: keep symlinks to nix intact 2020-06-19 10:08:34 +02:00
Robert Hensing
caf47063b4 dockerTools: test that tar keeps nix binary symlinks intact 2020-06-19 10:08:34 +02:00
Frederik Rietdijk
4af4a49251 Merge master into staging-next 2020-06-16 18:05:38 +02:00
Andreas Rammhold
d282a7e07f
Merge pull request #90193 from danieldk/build-rs-feature-env
buildRustCrate: set CARGO_FEATURE_* when running the build script
2020-06-16 14:19:56 +02:00
Lassulus
453014b456
Merge pull request #89245 from alexarice/agda-literate
agda: install literate files
2020-06-16 14:11:01 +02:00
Daniël de Kok
fe50bab788 buildRustCrate: set CARGO_FEATURE_* when running the build script
Cargo sets `CARGO_FEATURE_*` for all features when running a build
script:

https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

Some crates have build scripts (e.g. openblas-src) that rely on the
feature variables being properly set.

Since we now need several representations of features, this change
also updates `createFeatures` to be a list of features, rather than
`rustc` feature arguments. `configureCrate` and `buildCrate` then
build the required representations as-needed.

Fixes #68978
2020-06-13 14:09:06 +02:00
Frederik Rietdijk
2e4b4e3300 Merge staging-next into staging 2020-06-13 11:03:26 +02:00
Frederik Rietdijk
1523382160 Merge master into staging-next 2020-06-13 11:02:21 +02:00