-
Notifications
You must be signed in to change notification settings - Fork 100
Add split-receipt command that splits receipt into phase 1 and 2 uninstallation flows
#1278
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
Conversation
ff31e02 to
a87c3ab
Compare
dc38e40 to
445188e
Compare
a87c3ab to
863f371
Compare
863f371 to
c047153
Compare
src/action/common/configure_determinate_nixd_init_service/mod.rs
Outdated
Show resolved
Hide resolved
… going to create / use
…installation flows
c047153 to
ae85929
Compare
…ssing fields plist::Value does not implement Eq, so we need to wrap it in something that does, I think, probably
src/cli/subcommand/split_receipt.rs
Outdated
| match serde_json::from_str::<InstallPlan>(&install_receipt_string) | ||
| .ok() | ||
| .and_then(|plan| { | ||
| if plan.check_compatible().is_ok() { | ||
| Some(plan) | ||
| } else { | ||
| None | ||
| } | ||
| }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not a huge fan of non-trivial expressions as match statement, would be nice to see this split out in a separate let, then match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in e43ca23
| let action_json = serde_json::to_string(action).with_context(|| { | ||
| format!("serde_json::to_string'ing {action_tag} json to extract real type") | ||
| })?; | ||
| let action_unjson: StatefulAction<T> = | ||
| serde_json::from_str(&action_json).with_context(|| { | ||
| format!("serde_json::from_str'ing {action_tag} json to extract real type") | ||
| })?; | ||
|
|
||
| Ok(action_unjson) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Is there no way to get action_tag from T? It seems weird that we pass the type-to-deserialize to as a Type (T) and also pass action_tag. I was surprised to see that, but the understand it's just used for the log message. It feels redundant though if there's some compile/runtime-way to get a human readable name of T.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in e5ce505
Description
Depends on #1277.This will make it easier to reinstall Nix with a newer version of the nix-installer (which, as it happens, also makes it easier to install Determinate on top of an existing Nix installation without having to completely nuke your
/nix).Checklist
cargo fmtnix buildnix flake checkValidating with
install.determinate.systemsIf a maintainer has added the
upload to s3label to this PR, it will become available for installation viainstall.determinate.systems:TODO: