about summary refs log tree commit diff
path: root/pkgs/top-level/splice.nix
AgeCommit message (Collapse)AuthorFilesLines
2024-05-01generateSplicesForMkScope: Support dot in attribute pathJohn Ericson1-8/+14
Only the list form supports the full domain of possible attribute names.
2023-08-14lib.customisation: add uncurried form of makeScopeWithSplicingAdam Joseph1-0/+1
Deeply-curried functions are pretty error-prone in untyped languages like Nix. This is a particularly bad case because `top-level/splice.nix` *also* declares a makeScopeWithSplicing, but it takes *two fewer arguments*. Let's add a version that uses attrset-passing form, to provide some minimal level of sanity-checking. This also provides defaults for keep and extra (these are often unneeded by the user).
2023-08-05treewide: fix some comments (#247365)Jan Malakhovski1-4/+4
* pkgs/top-level/splice.nix: fix broken comment * stdenv: use a value that actually works in the comment there
2023-07-28Revert "lib.customisation: uncurry makeScopeWithSplicing"Silvan Mosberger1-1/+1
2023-07-27lib.customisation: uncurry makeScopeWithSplicingAdam Joseph1-1/+1
Deeply-curried functions are pretty error-prone in untyped languages like Nix. This is a particularly bad case because `top-level/splice.nix` *also* declares a makeScopeWithSplicing, but it takes *two fewer arguments*. Let's switch to attrset-passing form, to provide some minimal level of sanity-checking.
2023-06-22splice.nix: finish nativeDrv,crossDrv removalArtturin1-3/+0
2022-12-25splice.nix: add convenience functionsArtturin1-0/+18
2022-12-24splice.nix: run nixpkgs-fmtArtturin1-79/+99
the file was a bit hard to read
2022-11-19splice.nix: start deprecating nativeDrv and crossDrvArtturin1-11/+6
2021-12-02top-level: add depsHostHost splicingRyan Burns1-3/+3
This was originally made to throw because pkgsHostHost was unimplemented. Now that we have the full range of pkgs*, we can add this normally.
2019-03-24top-level: Create `pkgs{Build,Host,Target}{Build,Host,Target}`John Ericson1-11/+12
This is needed to avoid confusing and repeated boilerplate for `fooForTarget`. The vast majority of use-cases can still use `buildPackages or `targetPackages`, which are now defined in terms of these.
2018-10-11xorg: don't splice scope attributes into main package setAndrew Childs1-1/+3
2018-10-11__splicedPackages: Don't include xorgJohn Ericson1-18/+14
For historical reasons, callPackage has the xorg packages in scope. This unstable building block is more versatile without the xorg hack baked in.
2018-08-30treewide: Remove usage of remaining redundant platform compatability stuffJohn Ericson1-4/+4
Want to get this out of here for 18.09, so it can be deprecated thereafter.
2018-07-09haskell infra: Fix built-time overridesJohn Ericson1-1/+1
These should all come from `buildHaskellPackages`
2018-07-09Haskell infra: Do callPackage splicingJohn Ericson1-0/+4
2018-07-09top-level: Expose `splicePackages` for `newScope` usersJohn Ericson1-26/+40
Otherwise extra packages in scope can't be made to work for cross. As much as I think splicing is an evil trick, I think it's best to do this and at least have it work consistently for now. It would seems simpler to expose a `newScopeWithSplicing`, but there's a few attrs (like `buildPackages` or `buildHaskellPackages`) that shouldn't be spliced. Users should instead splice, override the splicing on those packages, and apply `newScope` to that.
2018-07-09make-derivation: Don't add host-suffix to fixed-output derivations namesWill Dietz1-7/+2
Not only does the suffix unnecessarily reduce sharing, but it also breaks unpacker setup hooks (e.g. that of `unzip`) which identify interesting tarballs using the file extension. This also means we can get rid of the splicing hacks for fetchers.
2017-12-30top-level: Splice in more package sets for new types of depsJohn Ericson1-16/+53
This is done in preparation for the next commit where, among other changes, I add support for the new `dep*` attributes.
2017-12-10top-level: Fix splicing, againJohn Ericson1-10/+9
2017-12-09top-level: Fix splicing in the presence of evaluation errorsJohn Ericson1-3/+6
- No more `or {}`, this was misleading at best since those values wouldn't be used unless the attr they are defined from was present anyways. - `tryEval` for get outputs. This ensures that if some derivations fail, they won't take out the others. This benefited from the `or {}` before, but that was never good enough. `tryEval` is strictly better.
2017-11-05Rename `__targetPackages` to `targetPackages`John Ericson1-1/+1
2017-09-29Revert "Merge branch 'improved-make-overridable' of ↵Shea Levy1-4/+0
git://github.com/ElvishJerricco/nixpkgs" This reverts commit c3af1210b4c5d7ef380e75add463b37574fdcc8b, reversing changes made to 49f175cd0c80a39e1d05fc687c4a2a40e0aba58c.
2017-09-29Revert "Avoid polluting lib namespace unncessarily"Shea Levy1-1/+1
Reverting #27319 This reverts commit 01a3f0b8aabdb321b15dc7cc0e2287ce8232f797.
2017-09-28Avoid polluting lib namespace unncessarilyShea Levy1-1/+1
2017-09-28Merge branch 'improved-make-overridable' of ↵Shea Levy1-0/+4
git://github.com/ElvishJerricco/nixpkgs
2017-09-19stdenv: Also splice unlisted default "out" outputJohn Ericson1-2/+3
Otherwise, some cross builds will use the wrong type of dep. This won't affect native builds, and perhaps no extant cross buids either.
2017-07-14Added `self` views of the interface in `makeExtensibleWithInterface`Will Fancher1-2/+2
Fixing the `overrideScope` in `haskellpackages`.
2017-07-12Added `callPackageWithSelfWith` and `callPackageWithSelf`Will Fancher1-0/+4
2017-04-23top-level: Introduce targetPackages and a "double link fold"John Ericson1-1/+1
Each bootstrapping stage ought to just depend on the previous stage, but poorly-written compilers break this elegence. This provides an easy-enough way to depend on the next stage: targetPackages. PLEASE DO NOT USE IT UNLESS YOU MUST! I'm hoping someday in a pleasant future I can revert this commit :)
2017-04-23top-level: Do not splice `pkgs`, `buildPackages` or `*Platform`John Ericson1-1/+5
- `pkgs` is self-similar, and thus already spliced - `buildPackages` is an ingredient of splicing and should be kept as is - The platforms are not packages or package sets and couldn't be spliced There's probably other things that shouldn't be spliced too. The best long- term solution is simply to stop splicing altogether.
2017-01-25top-level: no more need to expose `splicedPackages`John Ericson1-2/+0
This was just done temporarily on the last cross-overhauling PR for testing purposes.
2017-01-24top-level: Only splice as needed for performanceJohn Ericson1-2/+9
2017-01-24top-level: Introduce `buildPackages` for resolving build-time depsJohn Ericson1-0/+76
[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