Commit graph

74 commits

Author SHA1 Message Date
Tuomas Tynkkynen c909f1b18e stdenv: Add updateAutoconfGnuConfigScriptsHook for aarch64
This is required for Aarch64 since a lot of source tarballs ship with
outdated configure scripts that don't recognize aarch64. Simply
replacing the config.guess and config.sub with new versions from
upstream makes them build again.

This same approach is used by at least Buildroot and Fedora. In
principle this could be enabled for all architectures but
conditionalizing this on aarch64 avoids a mass rebuild on x86.
2017-01-25 00:01:52 +02:00
John Ericson 1c0365bd88 cross-stdenv: Inline useless bindings and reindent
Semantics should be unchanged
2017-01-24 11:37:56 -05:00
John Ericson 92edcb7ebb top-level: Lay the groundwork for {build,host,target}Platform
The long term goal is a big replace:
  { inherit system platform; } => buildPlatform
  crossSystem => hostPlatform
  stdenv.cross => targetPlatform
And additionally making sure each is defined even when not cross compiling.

This commit refactors the bootstrapping code along that vision, but leaves
the old identifiers with their null semantics in place so packages can be
modernized incrementally.
2017-01-24 11:37:56 -05:00
John Ericson bf17d6dacf top-level: Introduce buildPackages for resolving build-time deps
[N.B., this package also applies to the commits that follow it in the same
PR.]

In most cases, buildPackages = pkgs so things work just as before. For
cross compiling, however, buildPackages is resolved as the previous
bootstrapping stage. This allows us to avoid the mkDerivation hacks cross
compiling currently uses today.

To avoid a massive refactor, callPackage will splice together both package
sets. Again to avoid churn, it uses the old `nativeDrv` vs `crossDrv` to do
so. So now, whether cross compiling or not, packages with get a `nativeDrv`
and `crossDrv`---in the non-cross-compiling case they are simply the same
derivation. This is good because it reduces the divergence between the
cross and non-cross dataflow. See `pkgs/top-level/splice.nix` for a comment
along the lines of the preceding paragraph, and the code that does this
splicing.

Also, `forceNativeDrv` is replaced with `forceNativePackages`. The latter
resolves `pkgs` unless the host platform is different from the build
platform, in which case it resolves to `buildPackages`. Note that the
target platform is not important here---it will not prevent
`forcedNativePackages` from resolving to `pkgs`.

--------

Temporarily, we make preserve some dubious decisions in the name of preserving
hashes:

Most importantly, we don't distinguish between "host" and "target" in the
autoconf sense. This leads to the proliferation of *Cross derivations
currently used. What we ought to is resolve native deps of the cross "build
packages" (build = host != target) package set against the "vanilla
packages" (build = host = target) package set. Instead, "build packages"
uses itself, with (informally) target != build in all cases.

This is wrong because it violates the "sliding window" principle of
bootstrapping stages that shifting the platform triple of one stage to the
left coincides with the next stage's platform triple. Only because we don't
explicitly distinguish between "host" and "target" does it appear that the
"sliding window" principle is preserved--indeed it is over the reductionary
"platform double" of just "build" and "host/target".

Additionally, we build libc, libgcc, etc in the same stage as the compilers
themselves, which is wrong because they are used at runtime, not build
time. Fixing this is somewhat subtle, and the solution and problem will be
better explained in the commit that does fix it.

Commits after this will solve both these issues, at the expense of breaking
cross hashes. Native hashes won't be broken, thankfully.

--------

Did the temporary ugliness pan out? Of the packages that currently build in
`release-cross.nix`, the only ones that have their hash changed are
`*.gcc.crossDrv` and `bootstrapTools.*.coreutilsMinimal`. In both cases I
think it doesn't matter.

 1. GCC when doing a `build = host = target = foreign` build (maximally
    cross), still defines environment variables like `CPATH`[1] with
    packages.  This seems assuredly wrong because whether gcc dynamically
    links those, or the programs built by gcc dynamically link those---I
    have no idea which case is reality---they should be foreign. Therefore,
    in all likelihood, I just made the gcc less broken.

 2. Coreutils (ab)used the old cross-compiling infrastructure to depend on
    a native version of itself. When coreutils was overwritten to be built
    with fewer features, the native version it used would also be
    overwritten because the binding was tight. Now it uses the much looser
    `BuildPackages.coreutils` which is just fine as a richer build dep
    doesn't cause any problems and avoids a rebuild.

So, in conclusion I'd say the conservatism payed off. Onward to actually
raking the muck in the next PR!

[1]: https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
2017-01-24 11:37:56 -05:00
John Ericson 5b7bdb2861 Remove more dead code: stdenvDarwinNaked no longer exists 2016-06-20 23:53:09 -07:00
John Ericson 47d95a7571 Remove dead code in stdenvCross adaptor 2016-06-20 23:53:09 -07:00
Vladimír Čunát 8b292a1b35 stdenv on mingw: fix 64-bin DLL detection in some cases
In particular, this makes 64-bit libpng create DLL now,
and thus depending packages won't fail anymore (e.g. freetype).
2016-04-23 10:52:01 +02:00
Eelco Dolstra 13a1c7b8c1 useOldCXXAbi: Change into a setup hook
Stdenv adapters considered weird.
2016-04-01 13:36:59 +02:00
Nikolay Amiantov 9134f9358a stdenvAdapters.useOldCXXAbi: add new adapter 2016-03-31 19:52:33 +03:00
Vladimír Čunát 5ad448df3a enableDebugging: use more suitable gcc flags
-ggdb is supposed to provide better symbol information when used with gdb
-Og is the recommended optimization level for debugging purposes
2015-08-10 09:11:30 +02:00
Eelco Dolstra a58356c953 useGoldLinker: Fix appending to $NIX_CFLAGS_LINK 2015-05-04 14:00:45 +02:00
Ambroz Bizjak 0a8ca604b4 Fix cross compiling regression due to gcc->cc renaming. 2015-02-05 21:25:25 +01:00
Eric Seidel 48f63c2f2e rename gcc-wrapper to cc-wrapper.
also makes cc-wrapper compatible with clang in the darwin fork.
2015-01-14 20:26:56 -08:00
Shea Levy bbd2be6075 Restore accidentally-dropped stdenv adapter 2014-12-26 12:38:18 -05:00
John Wiegley 28b6fb61e6 Change occurrences of gcc to the more general cc
This is done for the sake of Yosemite, which does not have gcc, and yet
this change is also compatible with Linux.
2014-12-26 11:06:21 -06:00
Eelco Dolstra a0f3faf34e Merge remote-tracking branch 'origin/glibc-2.20' into staging 2014-11-16 22:17:36 +01:00
Eelco Dolstra 7a05d33386 useGoldLinker: Don't set dontStrip
Probably caused by a bad cut&paste...
2014-11-12 15:10:54 +01:00
Eelco Dolstra d135422009 Remove obsolete useKlibc stdenv adapter 2014-10-29 13:43:00 +01:00
Eelco Dolstra 5cc92eb0d8 Remove obsolete useDietLibC stdenv adapter 2014-10-29 13:43:00 +01:00
Eelco Dolstra ffbdcbfe29 gcc-wrapper: Wrap ld.gold
This ensures that gcc's ‘-fuse-ld=gold’ flag works.
2014-10-10 14:55:17 +02:00
Eelco Dolstra 811de3bfaa Merge remote-tracking branch 'origin/staging' into darwin-clang-stdenv
Conflicts:
	pkgs/tools/security/gnupg/default.nix
2014-10-09 10:57:57 +02:00
Eelco Dolstra 14d6454b9a stdenv-linux: Turn allowedRequisites back on 2014-10-06 22:11:05 +02:00
Joel Taylor afa1db198b fix even more clang builds 2014-09-09 13:54:57 -07:00
Eelco Dolstra 5ba24cc8ea Typo/comment 2014-04-22 18:42:44 +02:00
Eelco Dolstra 497997cc38 Move generation of coverage reports from nixos/lib/testing to releaseTools
Also, turn some stdenv adapters into setup hooks.
2014-03-03 13:57:08 +01:00
Eelco Dolstra 80647127a3 Turn the coverage analysis stdenv adapters into setup hooks
Stdenv adapters are kinda weird and un-idiomatic (especially when they
don't actually change stdenv).  It's more idiomatic to say

  buildInputs = [ makeCoverageAnalysisReport ];
2014-02-05 19:18:33 +01:00
Eelco Dolstra bea2b3c517 addCoverageInstrumentation: Set NIX_CFLAGS_COMPILE as an attribute
This allows it to show up in nix-shell.
2014-02-05 19:18:33 +01:00
Eelco Dolstra c3d84d15ce Apply makeOverridable to stdenv
This removes the need for hacks like stdenv.regenerate.  It also
ensures that overrideGCC is now stackable (so ‘stdenv = useGoldLinker
clangStdenv’ works).
2014-02-05 19:18:33 +01:00
Eelco Dolstra 7703f04b75 Add a stdenv adapter ‘useGoldLinker’ to force use of Gold 2014-02-05 19:18:33 +01:00
Eelco Dolstra e2d505b24e More renames 2012-12-28 19:42:10 +01:00
Eelco Dolstra dcdef5a0fe More random cleanup 2012-12-28 19:37:42 +01:00
Eelco Dolstra 22ba03c123 Random cleanup: use "or" in adapters.nix 2012-12-28 19:35:35 +01:00
Eelco Dolstra ab3eeabfed Rename buildNativeInputs -> nativeBuildInputs
Likewise for propagatedBuildNativeInputs, etc.  "buildNativeInputs"
sounds like an imperative rather than a noun phrase.
2012-12-28 19:20:09 +01:00
Eelco Dolstra 5be0a9acd7 Rename hostDrv -> crossDrv, buildDrv -> nativeDrv
This is for consistency with terminology in stdenv (and the terms
"hostDrv" and "buildDrv" are not very intuitive, even if they're
consistent with GNU terminology).
2012-12-28 19:08:19 +01:00
Eelco Dolstra ccd44e84c8 Add a stdenv adapter ‘keepDebugInfo’ to make a debug build
This adapter causes the resulting binaries to have debug info and no
optimisations.  Example use (in all-packages.nix):

  foo = callPackage ./foo.nix {
    stdenv = keepDebugInfo stdenv;
  };
2012-10-31 13:46:51 +01:00
Eelco Dolstra c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00
Eelco Dolstra cfde88976b * Streamline the stdenv bootstrap and resulting closure by removing
some redundant builds (e.g., GMP was built three times).
* Updated GMP to 5.0.2.
* Updated PPL to 0.11.2.
* Remove ad hoc flags to build GCC's dependencies statically.
  Instead, use the ‘makeStaticLibraries’ stdenv adapter.
* Build GMP with C++ support by default.

svn path=/nixpkgs/branches/stdenv-updates/; revision=30891
2011-12-14 14:31:56 +00:00
Ludovic Courtès 4122bd643e validateLicenses: Warn about derivations lacking licensing information.
svn path=/nixpkgs/trunk/; revision=30496
2011-11-20 20:53:15 +00:00
Ludovic Courtès 2448161213 stdenv adapters: Use toString' instead of exprToString'.
svn path=/nixpkgs/trunk/; revision=30494
2011-11-20 20:42:05 +00:00
Shea Levy 94dbab27a3 Bootstrap clang with itself
svn path=/nixpkgs/trunk/; revision=29901
2011-10-19 17:11:26 +00:00
Eelco Dolstra 58a0e8fcdc * Typo.
svn path=/nixpkgs/trunk/; revision=27569
2011-07-01 09:50:34 +00:00
Eelco Dolstra 569d38ad69 * makeStaticBinaries: handle the case where configureFlags is
an array.

svn path=/nixpkgs/trunk/; revision=25641
2011-01-20 09:40:17 +00:00
Lluís Batlle i Rossell 0196bb720e Making the addCoverageInformation stdenv adapter better in the sense that it
does not override NIX_CFLAGS_COMPILE anymore in the mkDerivation parameter
attributes. This way, apacheHttpd can be built properly with coverage
information.
An indication of this problem came from the nixos tests.subversion failure.


svn path=/nixpkgs/branches/stdenv-updates/; revision=24938
2010-11-30 14:10:52 +00:00
Lluís Batlle i Rossell 46082f25f9 Updating from trunk
svn path=/nixpkgs/branches/stdenv-updates/; revision=23027
2010-08-07 20:14:04 +00:00
Yury G. Kudryashov 1aa8b54c41 Typos
svn path=/nixpkgs/trunk/; revision=23011
2010-08-06 20:23:35 +00:00
Lluís Batlle i Rossell f36f99e368 Making gcc cross-buildable, at least for glibc.
svn path=/nixpkgs/branches/stdenv-updates/; revision=20454
2010-03-06 21:41:01 +00:00
Lluís Batlle i Rossell 8a080a699e Fixing the cross build stdenv adapter so it tolerates buildInputs with 'null' elements.
svn path=/nixpkgs/trunk/; revision=20381
2010-03-04 14:44:38 +00:00
Lluís Batlle i Rossell fca769846a Adding a new special attribute for mkDerivation: crossAttrs. It sits next to
"meta" and "passthru", and these attributes will be appended to the usual
mkDerivation attributes only if the package is cross built.
This allows putting some of the cross-building logic in the mkDerivation
nix parameters, and not only in the final builder script, as it was until now.

svn path=/nixpkgs/trunk/; revision=20272
2010-02-27 17:35:42 +00:00
Eelco Dolstra 4430ce1952 * Fix splashutils.
svn path=/nixpkgs/branches/stdenv-updates/; revision=19662
2010-01-26 10:56:21 +00:00
Eelco Dolstra ed3ebb7c2c * libjpeg updated to version 8.
* libpng updated to 1.4.0.
* For libjpegStatic, use a stdenv adapter to build a static library.

svn path=/nixpkgs/branches/stdenv-updates/; revision=19605
2010-01-21 21:42:17 +00:00