Skip to content

update flake and rust dependencies #317

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 7 commits into
base: master
Choose a base branch
from

Conversation

Chaostheorie
Copy link
Contributor

This is a naive update with minor adjustments for new APIs. Most changes are clap related because their macro naming has changed.

@Chaostheorie
Copy link
Contributor Author

The only skipped dependency is rnix, it had a few breaking API changes that likely require a bigger refactor. I can try to tackle this in the new few days.

@Chaostheorie
Copy link
Contributor Author

Chaostheorie commented Mar 27, 2025

This also now contains a minor fix for #307 and #287, if required, this can be split into its own PR

@Chaostheorie
Copy link
Contributor Author

Tested the PR locally, works fine. No regression appears to be present.

This a naive update with minor adjustements for new APIs. Most changes
are clap related because their macro naming has changed.
Extend ast handling for nodename with dots, see serokell#307
@Chaostheorie
Copy link
Contributor Author

After an hour on a builder, nixos vm test failed, seems like activation CLI needs some more work:

vm-test-run-options-overriding> client # thread 'tokio-runtime-worker' panicked at /build/source/src/deploy.rs:493:37:
vm-test-run-options-overriding> client # called `Result::unwrap()` on an `Err` value: ()

Copy link
Contributor

@weriomat weriomat left a comment

Choose a reason for hiding this comment

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

Hey, I have debugged the issue with the tests.
Since you bumped the nixpkgs version, this commit removes the switch-to-configuration script by default.
We should enable this option in the common config because the test VMs need to have the new rust script in path (since they cannot fetch it while being run)

Copy link
Contributor

@weriomat weriomat left a comment

Choose a reason for hiding this comment

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

The overlay outputs seems to be deprecated as well in favor of overlays.default

weriomat added 2 commits May 13, 2025 16:49
…loys

[This](NixOS/nixpkgs@4cfbbb3)
commit has disabled the option by default, but we need the
`switch-to-configuration` binary in order to successfully deploy to the
server
Fix tests + overlays output
@weriomat
Copy link
Contributor

weriomat commented Jun 2, 2025

@rvem the build failures for on the automatic-updates branch are also fixed here :) Thus a review from you would be appreciated.

@rvem
Copy link
Member

rvem commented Jun 2, 2025

Yeah, I just noticed that after introducing the same fixes there 😅

@rvem rvem self-requested a review June 2, 2025 09:50
@@ -16,9 +16,8 @@
};

outputs = { self, nixpkgs, utils, ... }@inputs:
rec {
overlay = final: prev: let
Copy link
Member

Choose a reason for hiding this comment

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

Can we preserve the overlay output for the sake of backward compatibility?
Just leave it as overlay = overlays.default

Copy link
Member

@rvem rvem Jun 2, 2025

Choose a reason for hiding this comment

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

Perhaps, with a warning, saying that this output will be removed in the future

@@ -231,6 +231,7 @@ pub fn parse_flake(flake: &str) -> Result<DeployFlake, ParseFlakeError> {

Some(c.into_token().unwrap().text().to_string())
}
(NODE_SELECT, _) => Some(entry.into_node().unwrap().text().to_string()),
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test case with the node that has . in the name?

Copy link
Member

@rvem rvem Jun 2, 2025

Choose a reason for hiding this comment

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

Hmm, I tried, to add local.server to the node attrset and deploy it with deploy -s .#local.server, and got

vm-test-run-node-name-with-dot> client #        error: attribute 'profiles' missing
vm-test-run-node-name-with-dot> client #        at «string»:7:40:
vm-test-run-node-name-with-dot> client #             6|                             profiles = {
vm-test-run-node-name-with-dot> client #             7|                               inherit (deploy.nodes."local".profiles) "server";
vm-test-run-node-name-with-dot> client #              |                                        ^
vm-test-run-node-name-with-dot> client #             8|                             };

See 24977dc

Copy link
Contributor

Choose a reason for hiding this comment

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

When I took a look at the issue at hand, deploy-rs parses the flake uri as <path>#<node>.<profile> and therefore it is not accepted (take a look at the tests for this function). In this case we try to deploy the node local with the profile server. The README contains examples for this issue. If you try to deploy local.server as the node you have to use .#"local.server" as specified in the README. Therefore, it is not accepted by design.

Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion 0c2b81d should be reverted

Copy link
Member

@rvem rvem left a comment

Choose a reason for hiding this comment

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

Changes except for 0c2b81d look good to me.
Dotted node names seem to be trickier, thus I propose to deal with it in a separate PR

@rvem rvem mentioned this pull request Jun 5, 2025
philipcristiano added a commit to philipcristiano/nixos-cluster-config that referenced this pull request Jun 18, 2025
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.

3 participants