Commit Graph

4639 Commits

Author SHA1 Message Date
Gabriella Gonzalez
9a8850aea9
dhallToNix: Permit inputs referring to derivations (#134459)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/2267

`pkgs.dhallToNix` currently fails when a Dhall package is
interpolated into the input source code, like this:

```nix
let
  pkgs = import <nixpkgs> { };

  f = { buildDhallPackage }: buildDhallPackage {
    name = "not";
    code = "λ(x : Bool) → x == False";
    source = true;
  };

  not = pkgs.dhallPackages.callPackage f {};

in
  pkgs.dhallToNix "${not}/source.dhall True"
```

This is because `dhallToNix` was using `builtins.toFile`, which
does not permit inputs with interpolated derivations.  However,
`pkgs.writeText` does not have this limitation, so we can switch
to using that instead.
2021-08-21 19:25:01 -07:00
Sandro
20a82c1281
Merge pull request #135007 from Stunkymonkey/fetchgx-phases
fetchgx: deprecate phases
2021-08-21 15:13:32 +02:00
Sandro
4372fb396e
Merge pull request #134416 from Stunkymonkey/nix-template-rpm-phases 2021-08-21 02:19:24 +02:00
Felix Buehler
b5c8a485c6 fetchgx: deprecate phases 2021-08-20 23:47:21 +02:00
Florian Klink
f8031c60b7
dockerTools.fakeNss: add /etc/nsswitch.conf (#134958)
Apparently, a non-existent nsswitch.conf causes a very misleading host
resolution, differing from the defaults people are used to.

According to
https://github.com/golang/go/issues/22846#issuecomment-346377144, glibc
says the default is "dns [!UNAVAIL=return] files".

This means, `/etc/hosts` isn't really honored, causing all sorts of
unexpected behaviour.

Let's prevent this, and first ask `/etc/hosts` before querying DNS, like
we do on NixOS too.
2021-08-20 19:44:17 +02:00
Robin Stumm
3bdfca4491 buildRustPackage: remove unused parameter 2021-08-20 12:46:05 +02:00
davidak
a614698169
Merge pull request #134356 from Stunkymonkey/replace-secret-phases
replace-secret: deprecate phases
2021-08-19 04:30:08 +02:00
Alyssa Ross
6e6c8b7338 s6-rc: fix cross builds that run s6-rc-compile
The reason for this change is explained in the long comment I added.

Here's a simple example of the problem:

	let
	  pkgs = import <nixpkgs> { crossSystem.system = "aarch64-linux"; };
	in

	pkgs.callPackage ({ stdenv, s6-rc }: stdenv.mkDerivation {
	  name = "s6-rc-compiled";

	  nativeBuildInputs = [ s6-rc ];

	  buildCommand = ''
	    mkdir in
	    s6-rc-compile $out in
	  '';
	}) {}

We're cross compiling for aarch64 here, so we'd expect the scripts
generated by this derivation to be things we could run on aarch64.
But when I build this on my x86_64 machine, without this change
applied, $out/servicedirs/s6rc-oneshot-runner/run gets generated full
of references to x86_64 non-cross store paths for execline, s6, and
s6-rc.

With this change applied, the scripts generated by the above
expression now refer to the cross-compiled aarch64 store paths for
execline, s6, and s6-rc.
2021-08-18 20:09:19 +00:00
Sandro
3f3e055bcd
Merge pull request #133905 from raboof/buf-use-testVersion-utility
buf: use testVersion utility
2021-08-18 11:59:49 +02:00
Ben Siraphob
6b7decf64b
Merge pull request #134413 from Zimmi48/package-hydra-battles 2021-08-17 08:32:21 -05:00
Théo Zimmermann
90654cce7d
coqPackages.mkCoqDerivation: fix useDune2
- Reuse build phase from the `buildDunePackage` function.
- Only install the package that was just built (useful for monorepo support).
- Introduces `opam-name` to override the default package name to build with Dune.
2021-08-17 14:38:47 +02:00
Felix Buehler
90f9565f1a nix-template-rpm: deprecate phases 2021-08-17 11:04:49 +02:00
Felix Buehler
454c6dee5e replace-secret: deprecate phases 2021-08-17 09:59:37 +02:00
Dmitry Kalinkin
a57ca31b3b
Merge pull request #133350 from rasendubi/fetchzip-downloadname
fetchzip: add extension parameter
2021-08-15 13:04:32 -04:00
Robert Hensing
9feb144c8c runCommandNoCC: deprecate
It has been synonymous with runCommand ~5y.
2021-08-15 17:36:41 +02:00
Robert Hensing
a13aa64bd3 build-support/rust: remove unused runCommandNoCC 2021-08-15 17:36:41 +02:00
Robert Hensing
fbafeb7ad5 treewide: runCommandNoCC -> runCommand
This has been synonymous for ~5y.
2021-08-15 17:36:41 +02:00
sternenseemann
b4c9d6eb31 skawarePackages.buildManPages: derivation wrapper for skaware man page ports
GitHub user flexibeast has been porting the html documentation from
skarnet.org to mdoc, making them available as man pages. While the
documentation is non authorative, it is certainly useful and is also
linked from skarnet.org.

buildManPages implements the common mkDerivation machinery common to all
ported man page packages / repositories.
2021-08-15 11:43:10 +02:00
Jörg Thalheim
ec9f44e541
Merge pull request #134119 from tekeri/rust-crate-override-pamsys
rust: fix build of pam-sys package
2021-08-15 09:35:22 +01:00
Arnout Engelen
1a604de2e7
buf: use testVersion utility
`installCheckPhase` is mainly intended for checks that are part of the
upstream package, for our 'own' checks we prefer `passthru.tests`.

This loses running `buf --help`, but I'm not sure how much that adds
on top of `buf --version`?
2021-08-15 09:00:30 +02:00
tekeri
2419ea4aff rust: fix build of pam-sys package 2021-08-15 15:55:20 +09:00
Jörg Thalheim
52657498f7
Merge pull request #133588 from zhaofengli/nuget-to-nix
nuget-to-nix: init
2021-08-15 07:02:43 +01:00
Luke Granger-Brown
dbe9bf9848 dockerTools.pullImage: fix for skopeo 1.4.x
skopeo 1.4.x doesn't accept --src-tls-verify as a flag to the *program*,
only as a flag to copy; we must pass it after the "copy" verb, or it
will fail with:

> FATA[0000] unknown flag: --src-tls-verify
2021-08-14 21:21:26 +00:00
Zhaofeng Li
1ad800d919 nuget-to-nix: init
Adapted from `pkgs/games/osu-lazer/update.sh`.

Restore the packages to a directory with `--packages`, then run
`./nuget-to-nix.sh [path to packages] > deps.nix`.
2021-08-13 22:50:20 -07:00
Shea Levy
9ecfbe0c5b
mingw: Disalbe FORTIFY_SOURCE by default.
In newer versions of mingw, programs compiled with FORTIFY_SOURCE need
to link to libssp or they will have link-time errors.

gmp has been broken since @pstn updated mingw-64 in c60a0b0447
2021-08-11 05:07:42 -04:00
Alexey Shmalko
1893e2be4d
fetchzip: add extension parameter
fetchzip downloads the file from specified URL, renames it to basename
of that url, and then relies on unzip to do the unpacking.

The first consequence is that this requires URL to end with proper
extension—otherwise it will fail to unpack. This is not always the
case and input-fonts workarounds this by adding “&.zip” query
parameter (which is obviously a hack and is not guaranteed to work
with every URL).

The second consequence is that basename of the url must be a valid
filename. I’ve tried to build a custom configuration of input-fonts
and I get an error from mv that the filename is too long:

> trying https://input.djr.com/build/?fontSelection=fourStyleFamily&regular=InputMonoNarrow-Regular&italic=InputMonoNarrow-Italic&bold=InputMonoNarrow-Bold&boldItalic=InputMonoNarrow-BoldItalic&a=0&g=0&i=topserif&l=serifs_round&zero=0&asterisk=height&braces=straight&preset=default&line-height=1.2&accept=I+do&email=&.zip
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100  406k  100  406k    0     0   230k      0  0:00:01  0:00:01 --:--:--  230k
> mv: failed to access '/build/?fontSelection=fourStyleFamily&regular=InputMonoNarrow-Regular&italic=InputMonoNarrow-Italic&bold=InputMonoNarrow-Bold&boldItalic=InputMonoNarrow-BoldItalic&a=0&g=0&i=topserif&l=serifs_round&zero=0&asterisk=height&braces=straight&preset=default&line-height=1.2&accept=I+do&email=&.zip': File name too long

We could use “name” parameter as the filename (that’s how it is used
in fetchurl). However, the previous attempt to do
so (fc01353703) was
reverted (24b5eb61eb) because of the
introduced regression—many fetchzip invocations use names without
extension (also the default name is just “source”).

This commit adds an optional “extension” parameter. If it is set,
fetchzip renames the downloaded file to “download.${extension}”
effectively solving both problems above without introducing a massive
regression.

This is a no-op for all existing packages.

Tested by updating my NixOS setup + the extra inputs-fonts
configuration mentioned above + tons of unstable emacs packages after
a nix-collect-garbage (3Gb downloaded) with this patch applied.
2021-08-10 19:57:08 +03:00
Sandro Jäckel
ceb417aaf1
docker: format 2021-08-10 10:32:46 +02:00
Linus Heckemann
b0fc6e8ff9 make-initrd: fix #132059 2021-08-08 07:53:59 +02:00
Robert Hensing
1c4b1018a3
Merge pull request #132626 from zowoq/tarsum
tarsum: init
2021-08-05 12:14:35 +02:00
zowoq
5dde5ea73e tarsum: init
- move from dockerTools.tarsum
- remove go from runtime closure
2021-08-05 08:54:41 +10:00
Robert Hensing
641bac80e5
dockerTools.buildImage: Allow build on darwin (#132640)
Indeed Docker can not run darwin exes, but darwin can build
Docker images, as some users already do with buildLayeredImage.
2021-08-04 06:06:06 -04:00
adisbladis
f09a770d9c
Merge pull request #130021 from neosimsim/fix-emacs-override-examples
emacs: fix overrideScope' examples
2021-08-04 03:08:33 -05:00
sternenseemann
c3c4ef859a gprbuild, xmlada: init at 21.0.0
GPRbuild is a multi language build system developed by AdaCore which
is mostly used for build Ada-related projects using GNAT.

Since GPRbuild is used to build itself and its dependency library
XML/Ada we first build a bootstrap version of it using the provided
bash build script bootstrap.sh as the gprbuild-boot derivation.
gprbuild-boot is then used to build xmlada and the proper gprbuild
derivation.

GPRbuild has its own search path mechanism via GPR_PROJECT_PATH which
we address via a setupHook. It currently works quite similar to the
pkg-config one: It accumulates all inputs into GPR_PROJECT_PATH,
GPR_PROJECT_PATH_FOR_BUILD etc. However this is quite limited at the
moment as we don't have a gprbuild wrapper yet which understands the
_FOR_BUILD suffix. However, we'll need to address this in the future
as it is currently basically impossible to test since the distinction
only affects cross-compilation, but it is not possible to build a GNAT
cross-compiler in nixpkgs at the moment (I'm working on changing that,
however).

Another issue we had to solve was GPRbuild not finding the right GNAT
via its gprconfig tool: GPRbuild has a knowledge base with compiler
definitions which run some checks and collect info about binaries
which are in PATH. In the end the first compiler in PATH that supports
the desired language is selected.

We want GPRbuild to discover our wrapped GNAT since the unwrapped one
is incapable of producing working binaries since it won't find the
crt*.o objects distributed with libc. GPRbuild however needs to find
the Ada runtime distributed with GNAT which is not part of the wrapper
derivation, so it will skip the wrapper and select the unwrapped GNAT.
Symlinking the unwrapped's lib directory into the wrapper fixes this
problem, but breaks linking in some cases (e. g. when linking against
OMP from gcc, the runtime variant will shadow the problem dynamic lib
from buildInputs). Additionally it uses gnatls as an indicator it has
found GNAT which is not part of the wrapper.

The solution we opted to adopt here is to install a custom compiler
description into gprbuild's knowledge base which properly detects the
nixpkgs GNAT wrapper: It uses gnatmake to detect GNAT instead of
gnatls and discovers the runtime via a symlink we add to
`$out/nix-support`. This additional definition is enough to properly
detect GNAT, since the plain wrapped gcc detection works out of the
box. It may, however, be necessary to add special definitions for
other languages in the future where gprbuild also needs to discover
the runtime.

One future improvement would be to install libgpr into a separate
output or split it into a separate derivation (which would require to
link gprbuild statically always since otherwise we end up with a
cyclical dependency).
2021-08-03 14:58:49 +02:00
Sandro
65c0fdf2a1
Merge pull request #131047 from SuperSandro2000/fetchfromgitlab
fetchgitlab: add deepClone, fetchSubmodules, leaveDotGit arguments
2021-08-02 14:06:02 +00:00
Jörg Thalheim
c145ac7eab build-fhs-userenv: fix defaults on aarch64 2021-07-30 11:23:37 +02:00
github-actions[bot]
d01381167a
Merge master into staging-next 2021-07-26 18:01:17 +00:00
github-actions[bot]
527dacdda6
Merge master into haskell-updates 2021-07-26 00:05:43 +00:00
github-actions[bot]
6a5e4f2c3d
Merge master into staging-next 2021-07-25 06:01:27 +00:00
Ben Siraphob
0f1204bd2b Initial implementation of s390 cross-compile 2021-07-25 10:12:18 +07:00
github-actions[bot]
0dfed52fcf
Merge master into haskell-updates 2021-07-25 00:05:51 +00:00
github-actions[bot]
859acbc1bc
Merge master into staging-next 2021-07-24 18:01:04 +00:00
John Ericson
c5a8d45d41
Merge pull request #131310 from siraben/m86k-cross
Initial implementation of m68k cross-compile
2021-07-24 09:25:53 -06:00
Ben Siraphob
407953e9df Initial implementation of m68k cross-compile 2021-07-24 14:37:35 +07:00
Jörg Thalheim
7bf8b97d68
Merge pull request #130601 from happysalada/stdenv_cosmetic
Stdenv cosmetic
2021-07-23 09:45:43 +01:00
github-actions[bot]
1019c5c2a8
Merge master into haskell-updates 2021-07-23 00:05:21 +00:00
github-actions[bot]
0b0a8c7c9a
Merge staging-next into staging 2021-07-22 18:01:39 +00:00
Guillaume Girol
f98bc23805
nix-gitignore: fix evaluation when .gitignore contains \# or \! (#130643) 2021-07-22 12:18:10 -04:00
Manuel Bärenz
af84eacb05 agdaPackages: Don't build broken packages on hydra 2021-07-22 17:29:09 +02:00
Sandro
202f0e817f
Merge pull request #129846 from sbruder/fhs-userenv-bwrap-pipewire-alsa 2021-07-22 17:17:35 +02:00
Sandro Jäckel
94848bd430
fetchgitlab: add deepClone, fetchSubmodules, leaveDotGit arguments 2021-07-22 13:09:14 +02:00