Commit graph

4405 commits

Author SHA1 Message Date
github-actions[bot] 6ef7c23763
Merge master into staging-next 2021-04-19 18:11:51 +00:00
Maciej Krüger da9400512d
Merge pull request #114400 from mkg20001/fhs-etc-nix
buildFHSUserEnv: symlink /etc/nix
2021-04-19 14:34:47 +02:00
github-actions[bot] d4f421cad9
Merge master into staging-next 2021-04-16 12:06:14 +00:00
Robert Hensing 578acc7a42
Merge pull request #118018 from considerate/master
dockerTools: Implement merging of image tarballs
2021-04-16 09:17:44 +02:00
Luke Granger-Brown 08b22e605b Merge remote-tracking branch 'upstream/staging-next' into down-integrate-staging 2021-04-12 18:49:01 +00:00
John Ericson 82ca81cd62
Merge pull request #111988 from thefloweringash/darwin-platform-versions
Darwin platform versions
2021-04-12 11:40:16 -04:00
Jörg Thalheim 65a40ca547
Merge pull request #102725 from thefloweringash/dockertools-proc
dockerTools: fix absent /proc during runAsRoot
2021-04-12 14:14:24 +01:00
Andrew Childs 6ee72dd5ab bintools-wrapper: ensure roles are set before mangling variables 2021-04-11 10:27:16 +09:00
Andrew Childs 6c4ce7960e bintools-wrapper, cc-wrapper: parameterize darwin min version variable
These variables are the ones that the standard toolchain uses, so we
should use those and not always use MACOSX_DEPLOYMENT_TARGET.

See 236a426c12/cctools/ld64/src/ld/PlatformSupport.cpp (L54-L55)
2021-04-11 09:47:10 +09:00
Andrew Childs 2a9b3b4943 cc-wrapper, bintools-wrapper: support MACOSX_DEPLOYMENT_TARGET with roles
In a typical build environment the toolchain will use the value of the
MACOSX_DEPLOYMENT_TARGET environment variable to determine the version
of macOS to support. When cross compiling there are two distinct
toolchains, but they will look at this single environment variable. To
avoid contamination, we always set the equivalent command line flag
which effectively disables the toolchain's internal handling.

Prior to this change, the MACOSX_DEPLOYMENT_TARGET variable was
ignored, and the toolchains always used the Nix platform
definition (`darwinMinVersion`) unless overridden with command line
arguments.

This change restores support for MACOSX_DEPLOYMENT_TARGET, and adds
nix-specific MACOSX_DEPLOYMENT_TARGET_FOR_BUILD and
MACOSX_DEPLOYMENT_TARGET_FOR_TARGET for cross compilation.
2021-04-11 09:47:10 +09:00
Andrew Childs 8b59d52ca3 cc-wrapper: use legacy -mmacosx-version-min for gcc
See https://github.com/NixOS/nixpkgs/pull/105026#discussion_r587169144
2021-04-11 09:47:10 +09:00
Andrew Childs 362cb82b75 cc-wrapper: specify default -mmacos-version-min
This avoids contamination via MACSOX_DEPLOYMENT_TARGET when cross
compiling.
2021-04-11 09:47:10 +09:00
Andrew Childs 6605fadc68 bintools-wrapper: default platform versions for darwin
Instead of always supplying flags, apply the flags as defaults. Use
clang's native flags instead of lifting the linker flags from binutils
with `-Wl,`.

If a project is using clang to drive linking, make clang do the right
thing with MACOSX_DEPLOYMENT_TARGET. This can be overridden by command
line arguments. This will cause modern clang to pass
`-platform_version 10.12 0.0.0`, since it doesn't know about the SDK
settings. Older versions of clang will pass down `-macos_version_min`
flags with no sdk version.

At the linker layer, apply a default value for anything left
ambiguous. If nothing is specified, pass a full
`-platform_version`. If only `-macos_version_min` is specified, then
lock down the sdk_version explicitly with `-sdk_version`. If a min
version and sdk version is passed, do nothing.
2021-04-11 09:47:09 +09:00
arcnmx 2f1131cff7 cc-wrapper: match useGccForLibs conditional order
This breaks an evaluation cycle between `cc` and `gccForLibs` for cross
builds, fixing an infinite recursion error.
2021-04-10 10:39:07 -07:00
github-actions[bot] bf6abedefb
Merge master into staging-next 2021-04-08 12:06:16 +00:00
zseri ff5ff66ef3 build-rust-crate: disable incremental builds 2021-04-08 10:45:56 +02:00
github-actions[bot] 8d1d992273
Merge master into staging-next 2021-04-08 00:17:24 +00:00
Sandro add1a1cd6b
Merge pull request #118530 from SuperSandro2000/fetchzip-urls 2021-04-07 22:39:37 +02:00
github-actions[bot] 6e4d572602
Merge master into staging-next 2021-04-07 18:14:53 +00:00
Viktor Kronvall 5caed960d3 dockerTools: add merged example images 2021-04-08 00:22:59 +09:00
Viktor Kronvall b2aa1f9d7a dockerTools: preserve order of images in manifest 2021-04-07 23:20:14 +09:00
Viktor Kronvall dcc9aef015 dockerTools: take a list of images in mergeImages 2021-04-07 22:49:44 +09:00
Viktor Kronvall ecc293ff7a dockerTools: Implement merging of image tarballs
The `docker load` command supports loading tarballs that contain
multiple docker images with their respective image names and tags. This
enables distributing these images as a single file which simplifies the
release of software when an application requires multiple services to
run.

However, pkgs.dockerTools only create tarballs with a single docker
image and there exists is no mechanism in nixpkgs to combine the created
tarballs. This commit implements merging of tarballs in a way that is
compatible with `docker load`.
2021-04-07 22:49:44 +09:00
Robert Hensing 58b21dea78
Merge pull request #116749 from vroad/docker-layered-image-fakeroot
dockerTools.streamLayeredImage: add fakeRootCommands option
2021-04-07 15:02:24 +02:00
vroad 63e7c4186f dockerTools.streamLayeredImage: Add test for fakeRootCommands 2021-04-07 18:11:02 +09:00
Sandro Jäckel 9f78dd4a1c fetchzip: accept urls
Required after 9bbfb26854
2021-04-07 02:41:25 +02:00
Jan Tojnar c04a14edd6 Merge branch 'master' into staging-next 2021-04-06 16:01:14 +02:00
Sandro 8af17b602c
Merge pull request #115936 from matthewmazzanti/bubblewrap-hardcode-readlink
fhs-userenv-bubblewrap: Add store path to readlink
2021-04-05 22:53:13 +02:00
Sandro Jäckel 3453b89f4b
lzma: deprecate alias 2021-04-04 19:49:52 +02:00
github-actions[bot] 60739e07d2
Merge master into staging-next 2021-04-02 12:06:12 +00:00
Doron Behar 785d2c03a0
Merge pull request #116677 from alexarice/agda-test-hello-world 2021-04-02 10:19:00 +00:00
github-actions[bot] 636e58e31b
Merge staging-next into staging 2021-04-02 00:21:46 +00:00
Vladimír Čunát e5ec487840
fetchurl: check that url is a string
Otherwise we (may) get a hard to debug issue in the tarball job,
e.g. see the grandparent commit.
2021-04-01 22:50:22 +02:00
rnhmjoj 61b7cab481
treewide: use perl.withPackages when possible
Since 03eaa48 added perl.withPackages, there is a canonical way to
create a perl interpreter from a list of libraries, for use in script
shebangs or generic build inputs. This method is declarative (what we
are doing is clear), produces short shebangs[1] and needs not to wrap
existing scripts.

Unfortunately there are a few exceptions that I've found:

  1. Scripts that are calling perl with the -T switch. This makes perl
  ignore PERL5LIB, which is what perl.withPackages is using to inform
  the interpreter of the library paths.

  2. Perl packages that depends on libraries in their own path. This
  is not possible because perl.withPackages works at build time. The
  workaround is to add `-I $out/${perl.libPrefix}` to the shebang.

In all other cases I propose to switch to perl.withPackages.

[1]: https://lwn.net/Articles/779997/
2021-03-31 21:35:37 +02:00
github-actions[bot] cb1554f24c
Merge staging-next into staging 2021-03-31 00:12:32 +00:00
github-actions[bot] 4ba71fb819
Merge master into staging-next 2021-03-31 00:12:29 +00:00
Alex Rice 0e162b97d6
agda nixos test: add to passthru for agda + stdlib 2021-03-30 13:54:02 +01:00
Sander van der Burg 44704440ef releaseTools: fix nixBuild function
Without this fix, I can no longer build anything with releaseTools.nixBuild {}. A job typically fails with:

$ nix-build release.nix -A build.basic.x86_64-linux --show-trace
error: while evaluating the attribute 'lib' of the derivation 'libnixxml-0.1pre1234' at /home/sander/teststuff/nixpkgs/pkgs/build-support/release/nix-build.nix:89:5:
cannot coerce a set to a string, at /home/sander/teststuff/nixpkgs/pkgs/build-support/release/nix-build.nix:89:5

This is caused by the fact that `lib' is propagated as a parameter, which is a function. Functions cannot be converted to strings.
2021-03-29 21:24:00 +02:00
github-actions[bot] 219312a10b
Merge staging-next into staging 2021-03-26 12:06:44 +00:00
github-actions[bot] eddd1a74ec
Merge master into staging-next 2021-03-26 12:06:41 +00:00
Louis Blin b3f68289df dockerTools.streamLayeredImage: resolve duplicate env vars
For images running on Kubernetes, there is no guarantee on how duplicate
environment variables in the image config will be handled. This seems
to be different from Docker, where the last environment variable value
is consistently selected.

The current code for `streamLayeredImage` was exploiting that assumption
to easily propagate environment variables from the base image, leaving
duplicates unchecked. It should rather resolve these duplicates to
ensure consistent behavior on Docker and Kubernetes.
2021-03-25 23:29:54 +00:00
github-actions[bot] 0a29e611e1
Merge staging-next into staging 2021-03-24 00:41:13 +00:00
github-actions[bot] 2417360191
Merge master into staging-next 2021-03-24 00:41:10 +00:00
Benjamin Hipple 561cc81ee6
Merge pull request #115857 from lbpdt/feature/docker-tools-layered-base-image
dockerTools.buildLayeredImage: support fromImage
2021-03-23 18:15:34 -04:00
Louis Blin aae8588182 dockerTools.buildLayeredImage: support fromImage
It is now possible to pass a `fromImage` to `buildLayeredImage` and
`streamLayeredImage`, similar to what `buildImage` currently supports.

This will prepend the layers of the given base image to the resulting
image, while ensuring that at most `maxLayers` are used. It will also
ensure that environment variables from the base image are propagated
to the final image.
2021-03-23 14:50:42 +00:00
github-actions[bot] 2c40ff9620
Merge staging-next into staging 2021-03-21 06:17:18 +00:00
github-actions[bot] b0455cafa7
Merge master into staging-next 2021-03-21 06:17:15 +00:00
Sandro 6cecff003a
Merge pull request #112073 from ztzg/x-16304-debbuild-checkinstall 2021-03-21 05:35:45 +01:00
Sandro d6df2c3fab
Merge pull request #111782 from Luflosi/fetchgit-escape-regex
fetchgit: escape dot in regex
2021-03-21 05:34:53 +01:00
Thomas Tuegel 54c7a0f422 cc-wrapper: -nostdlib does not imply -nostdinc++
The check for including the C++ standard library headers was nested inside the
check for linking with the C++ standard library. As a result, the `-nostdlib`
flag incorrectly implied `-nostdinc++`, which made it virtually impossible to
partially link C++ objects.
2021-03-20 09:26:04 +01:00