Skip to content
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

Implement the ability to devour only uncached derivations of a flake #10

Closed
wants to merge 9 commits into from
Closed

Conversation

ipetkov
Copy link
Contributor

@ipetkov ipetkov commented Sep 3, 2023

This PR adds the ability to use nix-build-uncached for building the derivations of a flake (instead of just nix build) which avoids the pitfall of having to download all derivations from the cache even if they're already present.

I also did a little bit of re-organization:

  • The previous flake.nix has been moved to devour/flake.nix
  • The top-level flake.nix now defines its own scripts as packages (this also allows one to actually consume the top level flake of this repo without having to rely on the version in nixpkgs)
  • The default behavior (present in nixpkgs) is now exposed as .#packages.${system}.devour-flake
  • The new, uncached-build behavior, is now exposed as .#packages.${system}.devour-flake-uncached
    • The scripts were separated out to more easily change behavior without having to parse all inputs and determine which flags are meant to be passed down to other nix invocations or are meant to modify the behavior of the devour logic

Fixes #9

Note: if/when this lands we can teach nixci how to use this new script when requested, but one step at a time 😁
EDIT: related to srid/nixci#19

Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/dcc36e45d054d7bb554c9cdab69093debd91a0b5' (2023-04-01)
  → 'github:hercules-ci/flake-parts/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca' (2023-09-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'github:NixOS/nixpkgs/e3652e0735fbec227f342712f180f4f21f0594f2?dir=lib' (2023-03-30)
  → 'github:NixOS/nixpkgs/3e52e76b70d5508f3cec70b882a29199f4d1ee85?dir=lib' (2023-08-31)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/2362848adf8def2866fabbffc50462e929d7fffb' (2023-04-21)
  → 'github:nixos/nixpkgs/e7f35e03abd06a2faef6684d0de813370e13bda8' (2023-09-02)
Copy link
Owner

Choose a reason for hiding this comment

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

Haven't had the time to look at this (and the other) PR in detail yet, but could you aim to minimize the diff in your PRs? It would make the review easier for me. For eg., there is no need to move the code to a new devour/flake.nix.

Refactors are good, but should happen on a PR of their own.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For eg., there is no need to move the code to a new devour/flake.nix.

I wanted the actual flake itself to be usable without having to go through what's in nixpkgs. As it stands today the stubbed flake = {} input makes it so it cannot be evaluated. By moving it to a separate directory the scripts can still reference it while they themselves being exposed by the actual repo flake.

Refactors are good, but should happen on a PR of their own.

There wasn't a good way for me to introduce the new build script and show an end-to-end working concept. I tried to keep each of the commits small and incremental so they're easier to review that way. If you'd prefer me to split things out into multiple PRs I can do that, but the content will end up being the same

Copy link
Owner

Choose a reason for hiding this comment

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

If you'd prefer me to split things out into multiple PRs I can do that, but the content will end up being the same

Yes. Every PR should do one thing, and one thing only. Even when you are updating flake.lock (0591b56), that should be a PR of its own.

Copy link
Contributor Author

@ipetkov ipetkov Sep 7, 2023

Choose a reason for hiding this comment

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

@srid
Copy link
Owner

srid commented Sep 7, 2023

Closing this in favour of the new PRs. Feel free to copy-paste the descriptions to the new PRs as appropriate.

@srid srid closed this Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow supporting nix-build-uncached
2 participants