nixpkgs/pkgs/development/interpreters
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
..
acl2 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
angelscript angelscript: 2.32.0 -> 2.33.0 2019-01-03 20:54:24 -08:00
bats treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
ceptre treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
chibi chibi: 0.7.3 -> 0.8 2018-07-18 15:56:04 -07:00
clips treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
clisp clisp: Add license 2019-04-09 13:23:55 +02:00
clojure Merge branch 'master' into staging-next 2019-08-24 08:55:37 +02:00
clojurescript/lumo treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
dart treewide: name -> pname 2019-08-17 10:54:38 +00:00
dhall
duktape treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
eff treewide: name -> pname 2019-08-17 10:54:38 +00:00
elixir treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
erlang treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
evcxr evcxr: 0.4.3 -> 0.4.4 2019-08-29 01:51:25 +02:00
falcon treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
gauche treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gnu-apl Merge remote-tracking branch 'origin/master' into gcc-8 2019-09-03 22:15:07 +02:00
groovy Merge branch 'master' into staging-next 2019-08-24 08:55:37 +02:00
gtk-server gtk-server: link with libdl explicitly 2019-01-04 21:44:19 +00:00
guile treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
hugs Revert "hugs: broken on clang" 2018-12-02 16:46:31 -05:00
hy hy: 0.16.0 -> 0.17.0 2019-07-04 04:09:28 -06:00
icon-lang treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
io
j treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
janet janet: 1.1.0 -> 1.2.0 2019-08-19 06:37:04 -07:00
jimtcl treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
joker joker: 0.12.4 -> 0.12.7 2019-09-03 04:50:02 -03:00
jruby Merge branch 'master' into staging-next 2019-08-24 08:55:37 +02:00
jython treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
kona treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
lfe
lolcode treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
love treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
lua-5 treewide: Get rid of most parseDrvName without breaking compat 2019-11-24 17:22:28 +00:00
luajit treewide: remove unused variables (#63177) 2019-06-16 19:59:05 +00:00
lush treewide/xorg: replace *proto with xorgproto 2019-01-04 14:38:57 +01:00
maude treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
metamath treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
mujs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
nix-exec treewide: name -> pname 2019-08-17 10:54:38 +00:00
octave treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
perl stdenv: Introduce hasCC attribute 2019-11-25 00:12:38 +00:00
php php72: 7.2.21 -> 7.2.22 2019-09-07 14:51:05 +02:00
picoc treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
picolisp treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
pixie treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
proglodyte-wasm v8: 5.4.232 -> 7.4.255 2019-04-11 00:25:12 -04:00
pure pure: link with libLLVMJIT explicitly 2019-01-04 21:44:21 +00:00
pyrex treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
python treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
qnial treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
racket treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
rakudo treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
rascal treewide: use dontUnpack 2019-07-01 04:23:51 -04:00
rebol treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
red treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
regina treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
renpy treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
ruby ruby_2_6: patch use-after-free 2019-09-07 14:32:56 +00:00
scheme48 scheme48: add license 2018-08-04 18:53:53 +02:00
scsh treewide: Make more complicated configureFlags lists 2018-08-03 17:06:03 -04:00
self treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
spidermonkey treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
supercollider supercollider: 3.10.2 -> 3.10.3 2019-09-03 04:20:00 -05:00
tcl treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
tinyscheme treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
unicon-lang treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
wasm-gc treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
wasmtime treewide: remove redundant rec 2019-08-28 11:07:32 +00:00