summary refs log tree commit diff
path: root/pkgs/build-support
Commit message (Collapse)AuthorAge
* mirrors.nix: Use HTTPS in maven mirrorsJonas Schürmann2020-01-20
| | | | | Since 2020-01-15, the maven central repository does no longer support HTTP. See https://blog.sonatype.com/central-repository-moving-to-https for details.
* Merge pull request #76831 from mbrgm/docker-slimMario Rodas2020-01-18
|\ | | | | docker-slim: init at 1.26.1
| * docker-slim: init at 1.26.1Marius Bergmann2020-01-03
| | | | | | | | | | Co-authored-by: Mario Rodas <marsam@users.noreply.github.com> Co-authored-by: Oleksii Filonenko <brightone@protonmail.com>
* | rustPlatform.buildRustPackage: cleaner output on verifyCargoDeps (#77567)Benjamin Hipple2020-01-12
| | | | | | | | | | | | When this fails, the user may want to copy-paste the path to the "bad" Cargo.lock file to inspect. The trailing `.` on `$cargoDeps.` gets caught in most terminal copy-pastes. Since half the lines already don't have it, this removes it from all of them for consistent output.
* | dockerTools.buildLayeredImage: fix typo in commentsAntoine Eiche2020-01-11
| |
* | Merge pull request #75911 from Simspace/parallel-docker-buildlayeredimagelewo2020-01-11
|\ \ | | | | | | when building a layered docker image, ignore it if tar encounters cha…
| * | dockerTools.buildLayeredImage: fix building layered images in parallelRichard Wallace2019-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when tar'ing store paths into layered archives when building layered images, don't use the absolute nix store path so that tar won't complain if something new is added to the nix store when building the final docker image, ignore any file changes tar detects in the layers. they are all immutable and the only thing that might change is the number of hard links due to store optimization
* | | buildRustCrate: slight "rewording" and reformattingAndreas Rammhold2020-01-07
| | | | | | | | | | | | | | | There is no point in reinventinb builtins through `filterAttrs` or the like. Lets just stick to what we already have in our toolbelt.
* | | buildRustCrate: add `buildTests` flag to tell rustc to build tests instead ↵Andreas Rammhold2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of binaries This helps us instruct rustc to build tests instead of binaries. The actual build will then ONLY produce test executables. This is a first step towards having rust crate tests within nixpkgs. We default back to only a single output in test cases since that is the only reasonable thing to do here. Producing libraries or binaries in addition to tests would theoretically be feasible but usually generates different dependency trees. It is very common to have some libraries in `[dev-depdendencies]` within Cargo.toml just for your tests. To not start mixing things up going with a dedicated derivation for the test build sounds like the best choice for now. To use this you must provide a proper test dependency chain to `buildRustCrate` (as you would usually do with your non-test inputs). And then set the `buildTests` attribute to `true`. The derivation will then contain all tests that were built in `$out/tests`. All common test patterns and directories should be supported and tested by this change. Below is an example how you would run a single test from the derivation. This commit contains some more examples in the `buildRustCrateTests` attribute set that might be helpful. ``` let drv = buildRustCrate { … buildTests true; }; in runCommand "test-my-crate" {} '' touch $out exec ${drv}/tests/my-test '' ```
* | | buildRustCrate: fixup usage of `builtins.filterSource`Andreas Rammhold2020-01-07
| | | | | | | | | | | | | | | | | | While unifying most of the lib function calls I accidentially changed the filterSource functions as well. Since there were no tests I ended up forgetting about this case (even thought I ran into it…).
* | | Merge pull request #75563 from andir/cleanup-buildRustCrateAndreas Rammhold2020-01-02
|\ \ \ | | | | | | | | Cleanup buildRustCrate expression
| * | | buildRustCrate: move common build functions to a dedicated fileAndreas Rammhold2019-12-12
| | | | | | | | | | | | | | | | | | | | This means we aren't rebuilding hat file for each crate we are building and the buildPhase expression is a lot easier to comprehent.
| * | | buildRustCrate: deduplicate dependency override codeAndreas Rammhold2019-12-12
| | | | | | | | | | | | | | | | | | | | | | | | The previous lines were only different in the kind of dependencies but otherwise exactly the same. It makes the entire thing a bit more readable by moving this into a function that takes care of this.
| * | | buildRustCrate: use less bash for the build scriptAndreas Rammhold2019-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can get rid of a bunch of workarounds that were in the build script before by just passing on the `crateBin` attribute. Before we converted the list of attributes to a string only to convert it back in bash during the build phase. We can do the entire looping through builds in Nix and thus need no conversion and parsing of attributes over and over again. The big part that still remains bash is the heuristic that cargo introduced and that we can't do at eval time.
| * | | buildRustCrate: reflow the way `extraRustcOpts` is constructedAndreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | This should make it more obvious that we have three parts to it and not just one long gibberish string that makes up all of it.
| * | | buildRustCrate: rename `makeDeps` function to `mkRustcDepArgs`Andreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | This should carry the function better then `makeDeps` as it isn't producing deps but the rustc arguments required to link against those.
| * | | buildRustCrate: document and cleanup the symbol seedingAndreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | | | | | That code had been in the derivation for a while but no explanation was given why that is needed. It might be helpful to our future selfs to document why things are done the way they are.
| * | | buildRustCrate: use tr instead of sed (it reads a bit nicer)Andreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | I already have a few changes in here that will trigger rebuilds so I might as well do that substitution now.
| * | | buildRustCrate: move the color loggign & remove some runtime checksAndreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The expression is already long and confusing enough without the color stuff sprinkled in. Moving it to a dedicated file makes sense. I switched a bit of the color support code to pure Nix since there wasn't much point in doing that in bash while we can just do it in Nix.
| * | | buildRustCrate: builtins -> lib where possibleAndreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | | | | | | | | | We can just use `lib` instead of `builtins` in all cases but the `hashString` case. Also changed a few lines to make use of some optional helpers from lib.
* | | | Merge pull request #74090 from obsidiansystems/ghcjs-cross-without-ccJohn Ericson2019-12-30
|\ \ \ \ | | | | | | | | | | stdenv, haskell: bonafied GHCJS cross compilation without stdenv.cc
| * \ \ \ Merge remote-tracking branch 'upstream/master' into ghcjs-cross-without-ccJohn Ericson2019-11-25
| |\ \ \ \
| * | | | | stdenv: Introduce hasCC attributeJohn Ericson2019-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | treewide: fix *FlagsRobin Gloster2019-12-30
| |_|_|_|/ |/| | | |
* | | | | rustPlatform.fetchcargo: exposeAlyssa Ross2019-12-23
| | | | |
* | | | | rustPlatform: forward unpackPhase to fetchcargoAlyssa Ross2019-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | If a custom unpackPhase is used for the package, it needs to also be used for fetchcargo so the same source is available for vendoring.
* | | | | rustPlatform: forward fetchcargo args to stdenvAlyssa Ross2019-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most stdenv wrappers already work like this -- it allows greater customisation. We just have to be careful to remove arguments we're using that shouldn't be passed to stdenv. I've been conservative here, because fetchcargo checksums shouldn't change lightly.
* | | | | Merge master into staging-nextFrederik Rietdijk2019-12-19
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merge pull request #75781 from ↵Graham Christensen2019-12-17
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | grahamc/dockertools/remove-implementation-detail-layers dockertools.buildLayeredImage: remove implementation detail layers
| | * | | | dockerTools.buildLayeredImage: Exclude top level implementation detail layersGraham Christensen2019-12-16
| | | | | |
| | * | | | dockerTools.buildLayeredImage: prepare to exclude some pathsGraham Christensen2019-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without changing behavior, since this code is fiddly, make it possible to add a filtering step before packaging individual paths.
| | * | | | dockerTools.buildLayeredImage: pass a list of closures to mkManyPureLayers ↵Graham Christensen2019-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | so it can exclude the top-most level Before, every docker image had three extra layers: 1. A `closure` layer which is an internal implementation detail of calculating the closure of the container 2. a `name-config.json` layer which is the images' run-time configuration, and has no business being *in* the image as a layer. 3. a "bulk-layers" layer which is again and implementation detail around collecting the image's closure. None of these layers need to be in the final product.
| | * | | | dockerTools.buildLayeredImage: tweak formatting on contentsEnvGraham Christensen2019-12-16
| | | | | |
* | | | | | Merge master into staging-nextFrederik Rietdijk2019-12-17
|\| | | | |
| * | | | | Merge pull request #74862 from alyssais/fetchgittilesMichael Raskin2019-12-17
| |\ \ \ \ \ | | | | | | | | | | | | | | fetchFromGitiles: init
| | * | | | | fetchFromGitiles: initAlyssa Ross2019-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has the same motivation as fetchFromGitHub/fetchFromGitLab -- it's cheaper to download a tarball of a single revision than it is to download a whole history. I could have gone with domain/group/repo, like fetchFromGitLab, but it would have made implementation more difficult, and this syntax means it's a drop-in replacement for fetchgit, so I decided it wasn't worth it.
* | | | | | | Merge master into staging-nextFrederik Rietdijk2019-12-16
|\| | | | | |
| * | | | | | Merge pull request #75779 from grahamc/dockertools/fixup-max-layersGraham Christensen2019-12-16
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | dockerTools.buildLayeredImage: update maxlayers from 24 to 100 to match documentation
| | * | | | | | dockerTools.buildLayeredImage: update maxlayers from 24 to 100 to match ↵Graham Christensen2019-12-16
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | documentation mkManyPureLayers already was changed, and this function was not updated.
| * / | | | | docker examples: Drop unneeded contents listGraham Christensen2019-12-16
| |/ / / / /
| * | | | | buildSkawarePackage: pass through extra argsAlyssa Ross2019-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows things like hooks other than postInstall to be passed through to mkDerivation, which is very useful when customising or debugging a package.
* | | | | | Merge branch 'staging-next' into stagingJan Tojnar2019-12-14
|\| | | | |
| * | | | | Merge branch 'master' into staging-nextJan Tojnar2019-12-14
| |\ \ \ \ \
| | * | | | | WriteHaskell: Strip binariesChuck2019-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the size of Hello World [1] from 3.06 MiB to 678 KiB. [1] As measured by nix-shell -p 'writers.writeHaskellBin "hello" {} "main = putStrLn \"hello\""' --run 'ls -l `which hello`'
| * | | | | | Merge master into staging-nextFrederik Rietdijk2019-12-13
| |\| | | | |
| | * | | | | Merge pull request #75181 from wamserma/fix-modules-shrunkAndreas Rammhold2019-12-12
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | | modules-shrunk: preserve module priorities from build
| | | * | | | modules-shrunk: preserve module priorities from buildMarkus S. Wamser2019-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | depmod looks for files modules.order and modules.builtin which are generated at kernel build time but were previously not passed to the modules-shrunk derivation
* | | | | | | Merge pull request #75450 from KoviRobi/fix-wrap-gapps-hook-shell-quotingworldofpeace2019-12-10
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | wrapGAppsHook: don't add empty variables (see also #75443)
| * | | | | | wrapGAppsHook: don't add empty variablesKovacsics Robert2019-12-10
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding empty variables can lead to this problem: ```diff wrapProgram \ ./pye_menu_shell \ --prefix PATH : /nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/bin:/nix/store/b3l3niilvqcxcsbxmd6sgqk1dy1rk81c-pye-menu-1.0/bin:/nix/store/y8j1cfj8d9r5rbbxc22w7hnfjw5f4fd3-cairo-1.16.0-dev/bin:/nix/store/6mg7lfbdh9pgx7pbxr3544qqbrigdl1q-freetype-2.10.1-dev/bin:/nix/store/gpszqcy0xi0lavbbjdq82zkkjp3jbp2a-bzip2-1.0.6.0.1-bin/bin:/nix/store/031c5pk5lzabgmpqpyd46hzi625as6bp-libpng-apng-1.6.37-dev/bin:/nix/store/f8kl7kmpv130aw9zm542p74a3hg0yc13-fontconfig-2.12.6-bin/bin:/nix/store/bqp30vkncmm222mjvwggz0s7p318sflj-expat-2.2.7-dev/bin:/nix/store/w57xa8g4s4aviwmqwgra7m5hwj2b005m-glib-2.60.7-dev/bin:/nix/store/v5d4966ahvfir2hwpv003022f3pb7vik-gettext-0.19.8.1/bin:/nix/store/qpvxhl1jr0fxnrx9idnpdagqs00m5m2z-glib-2.60.7/bin \ --set PYTHONNOUSERSITE true \ --set GDK_PIXBUF_MODULE_FILE /nix/store/7ddlakx6xjczqbfs80xjd14f30fzadws-gdk-pixbuf-2.38.1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \ --prefix XDG_DATA_DIRS : /nix/store/0snjc1qg89zqn3v35l9d55xrykh9nj5c-gtk+3-3.24.10/share/gsettings-schemas/gtk+3-3.24.10:/nix/store/b41z51vdv11n6df8ki5vj8dynxw98f9l-gsettings-desktop-schemas-3.32.0/share/gsettings-schemas/gsettings-desktop-schemas-3.32.0:/nix/store/0snjc1qg89zqn3v35l9d55xrykh9nj5c-gtk+3-3.24.10/share/gsettings-schemas/gtk+3-3.24.10 \ - --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : \ + --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "" \ --prefix GI_TYPELIB_PATH : /nix/store/0snjc1qg89zqn3v35l9d55xrykh9nj5c-gtk+3-3.24.10/lib/girepository-1.0:/nix/store/z29l5xaaxh1s0697mcldj71ab0zshry1-librsvg-2.44.15/lib/girepository-1.0:/nix/store/pija1xzm7izxfb5m2hvhvlwp1l38ffxa-gobject-introspection-1.60.2/lib/girepository-1.0 \ - --prefix GRL_PLUGIN_PATH : + --prefix GRL_PLUGIN_PATH : "" ``` Where the diff is to highlight the problem: we don't have a valid value for GST_PLUGIN_SYSTEM_PATH_1_0 or GRL_PLUGIN_PATH, and instead of passing the empy string, the empty string gets unquoted somewhere, so we end up passing no arguments, thus the parser in wrapProgram takes --prefix as the argument of GST_PLUGIN_SYSTEM_PATH_1_0, and then GI_TYPELIB_PATH is missing it's --prefix so wrapProgram complains/dies. The easiest change is to not add empty arguments to the wrapper
* | | | | | Merge staging-next into stagingFrederik Rietdijk2019-12-10
|\| | | | |