Commit Graph

3445 Commits

Author SHA1 Message Date
John Ericson
63bd851e95 stdenv: Introduce hasCC attribute
Before, we'd always use `cc = null`, and check for that. The problem is
this breaks for cross compilation to platforms that don't support a C
compiler.

It's a very subtle issue. One might think there is no problem because we
have `stdenvNoCC`, and presumably one would only build derivations that
use that. The problem is that one still wants to use tools at build-time
that are themselves built with a C compiler, and those are gotten via
"splicing". The runtime version of those deps will explode, but the
build time / `buildPackages` versions of those deps will be fine, and
splicing attempts to work this by using `builtins.tryEval` to filter out
any broken "higher priority" packages (runtime is the default and
highest priority) so that both `foo` and `foo.nativeDrv` works.

However, `tryEval` only catches certain evaluation failures (e.g.
exceptions), and not arbitrary failures (such as `cc.attr` when `cc` is
null). This means `tryEval` fails to let us use our build time deps, and
everything comes apart.

The right solution is, as usually, to get rid of splicing. Or, baring
that, to make it so `foo` never works and one has to explicitly do
`foo.*`. But that is a much larger change, and certaily one unsuitable
to be backported to stable.

Given that, we instead make an exception-throwing `cc` attribute, and
create a `hasCC` attribute for those derivations which wish to
condtionally use a C compiler: instead of doing `stdenv.cc or null ==
null` or something similar, one does `stdenv.hasCC`. This allows quering
without "tripping" the exception, while also allowing `tryEval` to work.

No platform without a C compiler is yet wired up by default. That will
be done in a following commit.
2019-11-25 00:12:38 +00:00
John Ericson
4a0a297861 bintools-wrapper: Fix version 2019-11-24 17:57:06 +00:00
Craig Hall
99537e994f {cc,bintools}-wrapper: use cc pname/version if set 2019-11-24 16:33:21 +00:00
John Ericson
38ebb8ff82 fetchurl: Eliminate pointless cross differences 2019-11-11 00:25:24 -05:00
Frederik Rietdijk
e3f25191c4 Merge staging-next into staging 2019-09-09 08:11:34 +02:00
volth
7b8fb5c06c treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
Matthieu Coudron
4d526d6fc6 fetchurl: add luarocks mirrors
luarocks defines by default the following mirrors:
83093e7da7/src/luarocks/core/cfg.lua (L205)

Let's add them to nixpkgs. I have modified luarocks-nix to generate the
proper nixpkgs urls.
I bump luarocks-nix in the following commits.
2019-09-07 19:59:23 +09:00
Jan Tojnar
f9237f3152
Merge branch 'master' into staging-next 2019-09-06 16:55:11 +02:00
Silvan Mosberger
da72765041
Merge pull request #67805 from Infinisil/more-git-determinism
nix-prefetch-git: Remove some pack file non-determinism
2019-09-06 10:24:45 +02:00
Jan Tojnar
cdf426488b
Merge branch 'master' into staging-next
Fixed trivial conflicts caused by removing rec.
2019-09-06 03:20:09 +02:00
Katharina Fey
18f7f19ce2 ociTools: init 2019-09-04 22:46:42 +00:00
Lily Ballard
43dade238f
installShellFiles: init (#65211)
This is a new package that provides a shell hook to make it easy to
declare manpages and shell completions in a manner that doesn't require
remembering where to actually install them. Basic usage looks like

  { stdenv, installShellFiles, ... }:
  stdenv.mkDerivation {
    # ...
    nativeBuildInputs = [ installShellFiles ];
    postInstall = ''
      installManPage doc/foobar.1
      installShellCompletion --bash share/completions/foobar.bash
      installShellCompletion --fish share/completions/foobar.fish
      installShellCompletion --zsh share/completions/_foobar
    '';
    # ...
  }

See source comments for more details on the functions.
2019-09-04 23:19:17 +02:00
Vladimír Čunát
4aad2947f8
Merge branch 'master' into staging-next 2019-09-04 11:00:56 +02:00
Bas van Dijk
37831d6d35
Merge pull request #67930 from basvandijk/applyPatches
trivial-builders: add the applyPatches function
2019-09-03 08:00:22 +02:00
Vladimír Čunát
f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
Sebastian Jordan
b97a20a567 nix-prefetch-github: 2.3 -> 2.3.1 2019-09-02 14:32:41 +02:00
Bas van Dijk
05393ca217 trivial-builders: add the applyPatches function
applyPatches applies a list of patches to a source directory.

For example to patch nixpkgs you can use:

  applyPatches {
    src = pkgs.path;
    patches = [
      (pkgs.fetchpatch {
        url = "1f770d2055.patch";
        sha256 = "1nlzx171y3r3jbk0qhvnl711kmdk57jlq4na8f8bs8wz2pbffymr";
      })
    ];
  }
2019-09-02 11:18:52 +02:00
Silvan Mosberger
478e7184f8
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type

Also fix up some minor module problems along the way
2019-08-31 18:19:00 +02:00
Frederik Rietdijk
ad1d58c622 Merge staging-next into staging 2019-08-31 10:04:20 +02:00
Frederik Rietdijk
fc74ba8291 Merge master into staging-next 2019-08-31 09:50:38 +02:00
Silvan Mosberger
89636b9a5e
nix-prefetch-git: Remove some pack file non-determinism 2019-08-31 01:16:50 +02:00
adisbladis
41d1b8fa88
emacsPackages: Drop old emacsPackages (non-NG) sets
These have been deprecated for a long time now and has not seen much maintenance.
2019-08-30 16:43:16 +01:00
volth
08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
Frederik Rietdijk
5061fe0c2c Merge staging-next into staging 2019-08-28 08:26:42 +02:00
volth
35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Vladimír Čunát
2e6bf42a22
Merge branch 'master' into staging-next
There ver very many conflicts, basically all due to
name -> pname+version.  Fortunately, almost everything was auto-resolved
by kdiff3, and for now I just fixed up a couple evaluation problems,
as verified by the tarball job.  There might be some fallback to these
conflicts, but I believe it should be minimal.

Hydra nixpkgs: ?compare=1538299
2019-08-24 08:55:37 +02:00
Josef Kemetmüller
bacf5619e2 mirrors: Add centos mirror (#66537)
This should remove the need to rename links from mirror.centos.org to
vault.centos.org as the removed comment mentions.
2019-08-20 16:40:07 -04:00
Dmitry Kalinkin
948025bca4
Merge pull request #66446 from bdesham/updated-boronine-perl-darwin-fix
Updated fix for Perl programs on Darwin
2019-08-19 19:18:19 -04:00
Nikolay Amiantov
3b3618ea3c buildBazelPackage: remove top-level symlinks
They always can be regenerated during the actual build, and they are sometimes
random, e.g in Tensorflow;

platforms -> NIX_BUILD_TOP/tmp/install/35282f5123611afa742331368e9ae529/_embedded_binaries/platforms
2019-08-19 11:23:17 +03:00
Benjamin Esham
3a9b0bd634 add shortenPerlShebang function
This setup hook modifies a Perl script so that any "-I" flags in its shebang
line are rewritten into a "use lib ..." statement on the next line. This gets
around a limitation in Darwin, which will not properly handle a script whose
shebang line exceeds 511 characters.
2019-08-18 16:22:23 -07:00
Nikolay Amiantov
e848ffe48c fetchurl mirrors: move steamrt mirror to another host
This one is hosted in a cloud so hopefully incidents like
https://github.com/NixOS/nixpkgs/pull/66853 won't repeat.
2019-08-19 01:26:01 +03:00
Frederik Rietdijk
fe9a3e3e63 Merge staging-next into staging 2019-08-17 09:39:23 +02:00
Frederik Rietdijk
c68f58d95c Merge master into staging-next 2019-08-17 09:30:16 +02:00
Graham Christensen
ee30e62e34
Merge pull request #66543 from grahamc/dt
dockerTools: document extraCommands, increase layers
2019-08-15 09:47:32 -04:00
volth
46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00
Yegor Timoshenko
da3da08cdf
buildRustPackage: link against pthreads-w32 on x86_64-pc-mingw32 2019-08-15 08:44:54 +00:00
Yegor Timoshenko
0fcffe88db
buildRustPackage: support cross-compilation to x86_64-pc-mingw32 2019-08-15 08:44:54 +00:00
Graham Christensen
8adaae2df2
dockertools.buildLayeredImage: default layer count up to 100 2019-08-12 19:59:40 -04:00
Frederik Rietdijk
9bd78cb048 Merge master into staging-next 2019-08-09 14:00:27 +02:00
Mario Rodas
50dd759948
Merge pull request #64852 from marsam/update-apache-mirrors
mirrors: update apache mirrors
2019-08-09 04:24:28 -05:00
Vincent Laporte
b1d37354d7
Merge pull request #65715 from mgttlinger/build-oasis-package
OCaml build support: add oasis build system
2019-08-07 08:07:55 +00:00
Merlin Göttlinger
b1f0e3ebc5
Suggested edits 2019-08-07 09:50:46 +02:00
Merlin Göttlinger
6e6c1448fa
Suggested edits 2019-08-07 06:51:36 +02:00
Merlin Göttlinger
961b83a99d
Don't use buildOcaml 2019-08-06 17:54:09 +02:00
Merlin Göttlinger
6ef367a5e8
Suggested changes 2019-08-06 06:46:03 +02:00
Merlin Göttlinger
2ea2643b13
OCaml build support: add oasis build system 2019-08-01 10:44:04 +02:00
Frederik Rietdijk
4ca8e53e1d Merge staging-next into staging 2019-08-01 09:44:06 +02:00
Frederik Rietdijk
55e4555b77 Merge master into staging-next 2019-08-01 09:42:54 +02:00
Sarah Brofeldt
19abdb765b
Merge pull request #63865 from dingxiangfei2009/dockertools-cross-compilation
dockerTools: use skopeo on the right platform
2019-07-31 20:11:18 +02:00
Adelbert Chang
4403d44763 buildRustPackage: fix cargo flag for release/debug build (#61521)
Previous behavior did not actually allow for "debug" build as it would
try to pass --debug to cargo, which is not a valid flag.
2019-07-31 13:19:01 +01:00