Skip to content

First class cross #13073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

First class cross #13073

wants to merge 3 commits into from

Conversation

roberth
Copy link
Member

@roberth roberth commented Apr 24, 2025

Motivation

Cross packaging shouldn't depend on having and using overlay.

This PR makes it possible to cross-compile without using any overlays whatsoever.

The three helper functions could perhaps be moved to Nixpkgs lib. cc @Ericson2314

See also commit messages.

Context

  • The packaging problems in hydra and flake.lock: Update Nixpkgs #13010 motivated me to try improve this again.

  • This must have been my third attempt at this. I had previously got stuck on a Nixpkgs quirk; see comment at fixup =.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@roberth roberth requested a review from Ericson2314 April 24, 2025 00:12
@roberth roberth requested a review from edolstra as a code owner April 24, 2025 00:12
@roberth roberth force-pushed the first-class-splicing branch from d2c4405 to 281f6a8 Compare April 24, 2025 00:17
@roberth roberth added the build-problem Nix fails to compile or test; also improvements to build process label Apr 24, 2025
flake.nix Outdated
) (renameSplicesFrom "pkgs" pkgs);
nixDependenciesSplices = mapSplices (
pkgs': (packageSetsFor (args // { pkgs = pkgs'; })).nixDependencies
) (renameSplicesFrom "pkgs" pkgs);

# A new scope, so that we can use `callPackage` to inject our own interdependencies
# without "polluting" the top level "`pkgs`" attrset.
# This also has the benefit of providing us with a distinct set of packages
# we can iterate over.
# The `2` suffix is here because otherwise it interferes with `nixVersions.latest`, which is used in daemon compat tests.
Copy link
Contributor

@xokdvium xokdvium Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is now stale, right?

# The 2 suffix is here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks. It's not in overlayFor, but here it is stale. The rest of the flake could perhaps move away from using overlayFor as a vehicle for storing its stuff, but that's somewhat of a large change for later.

roberth added 3 commits April 25, 2025 18:36
This was carefully refactored by inlining some Nixpkgs definitions
like `generateSplicesForMkScope`, so the memoization properties
should remain the same.
Users can access these through the `lib.makeComponents` return value,
so it's helpful to briefly explain some of them.

This doesn't replace `meta.description`, but supplements it.
(TODO: improve `meta.description`)
We should keep users' pkgs tidy.
@roberth roberth force-pushed the first-class-splicing branch from 281f6a8 to d2227af Compare April 25, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem Nix fails to compile or test; also improvements to build process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants