Skip to content

Commit 6bc76b8

Browse files
authored
Merge pull request #323 from serokell/update-deps
Update deps
2 parents 5829cec + 3adb9c1 commit 6bc76b8

File tree

9 files changed

+737
-480
lines changed

9 files changed

+737
-480
lines changed

Cargo.lock

Lines changed: 648 additions & 389 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,23 @@ edition = "2018"
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
clap = { version = "3.0.0-beta.2", features = [ "wrap_help" ] }
15-
dirs = "5.0.1"
14+
clap = { version = "4", features = [ "wrap_help", "derive" ] }
15+
dirs = "6"
1616
flexi_logger = "0.16"
17-
fork = "0.1"
18-
futures-util = "0.3.6"
17+
fork = "0.2"
18+
futures-util = "0.3.31"
1919
log = "0.4"
2020
merge = "0.1.0"
21-
notify = "5.1.0"
21+
notify = "8.0"
2222
rnix = "0.8"
23-
serde = { version = "1.0.104", features = [ "derive" ] }
24-
serde_json = "1.0.48"
23+
serde = { version = "1.0.219", features = [ "derive" ] }
24+
serde_json = "1.0.140"
2525
signal-hook = "0.3"
26-
thiserror = "1.0"
27-
tokio = { version = "1.9.0", features = [ "process", "macros", "sync", "rt-multi-thread", "fs", "time", "io-util" ] }
28-
toml = "0.5"
29-
whoami = "0.9.0"
26+
thiserror = "2.0"
27+
tokio = { version = "1.44.0", features = [ "process", "macros", "sync", "rt-multi-thread", "fs", "time", "io-util" ] }
28+
toml = "0.8"
29+
whoami = "1.6"
3030
yn = "0.1"
31-
32-
# smol_str is required by rnix, but 0.1.17 doesn't build on rustc
33-
# 1.45.2 (shipped in nixos-20.09); it requires rustc 1.46.0. See
34-
# <https://github.com/serokell/deploy-rs/issues/27>:
35-
smol_str = "=0.1.16"
3631
rpassword = "7.3.1"
3732

3833

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
};
1717

1818
outputs = { self, nixpkgs, utils, ... }@inputs:
19-
rec {
20-
overlay = final: prev: let
21-
system = final.stdenv.hostPlatform.system;
19+
{
20+
overlays.default = final: prev: let
2221
darwinOptions = final.lib.optionalAttrs final.stdenv.isDarwin {
2322
buildInputs = with final.darwin.apple_sdk.frameworks; [
2423
SystemConfiguration
@@ -151,7 +150,6 @@
151150
};
152151
};
153152
};
154-
overlays.default = overlay;
155153
} //
156154
utils.lib.eachSystem (utils.lib.defaultSystems ++ ["aarch64-darwin"]) (system:
157155
let
@@ -166,22 +164,20 @@
166164
};
167165
in
168166
{
169-
defaultPackage = self.packages."${system}".deploy-rs;
170167
packages.default = self.packages."${system}".deploy-rs;
171168
packages.deploy-rs = pkgs.deploy-rs.deploy-rs;
172169

173-
defaultApp = self.apps."${system}".deploy-rs;
174170
apps.default = self.apps."${system}".deploy-rs;
175171
apps.deploy-rs = {
176172
type = "app";
177173
program = "${self.packages."${system}".default}/bin/deploy";
178174
};
179175

180-
devShell = pkgs.mkShell {
176+
devShells.default = pkgs.mkShell {
181177
inputsFrom = [ self.packages.${system}.deploy-rs ];
182178
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
183179
buildInputs = with pkgs; [
184-
nixUnstable
180+
nix
185181
cargo
186182
rustc
187183
rust-analyzer

nix/tests/common.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
};
1616
};
1717

18+
# The "nixos-test-profile" profile disables the `switch-to-configuration` script by default
19+
system.switch.enable = true;
20+
1821
virtualisation.graphics = false;
1922
virtualisation.memorySize = 1536;
2023
boot.loader.grub.enable = false;

nix/tests/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
{ pkgs , inputs , ... }:
66
let
7-
inherit (pkgs) system lib;
7+
inherit (pkgs) lib;
88

99
inherit (import "${pkgs.path}/nixos/tests/ssh-keys.nix" pkgs) snakeOilPrivateKey;
1010

1111
# Include all build dependencies to be able to build profiles offline
12-
allDrvOutputs = pkg: pkgs.runCommand "allDrvOutputs" { refs = pkgs.writeReferencesToFile pkg.drvPath; } ''
12+
allDrvOutputs = pkg: pkgs.runCommand "allDrvOutputs" { refs = pkgs.writeClosure pkg.drvPath; } ''
1313
touch $out
1414
while read ref; do
1515
case $ref in

src/bin/activate.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use signal_hook::{consts::signal::SIGHUP, iterator::Signals};
88

9-
use clap::Clap;
9+
use clap::Parser;
1010

1111
use tokio::fs;
1212
use tokio::process::Command;
@@ -25,99 +25,99 @@ use thiserror::Error;
2525
use log::{debug, error, info, warn};
2626

2727
/// Remote activation utility for deploy-rs
28-
#[derive(Clap, Debug)]
29-
#[clap(version = "1.0", author = "Serokell <https://serokell.io/>")]
28+
#[derive(Parser, Debug)]
29+
#[command(version = "1.0", author = "Serokell <https://serokell.io/>")]
3030
struct Opts {
3131
/// Print debug logs to output
32-
#[clap(short, long)]
32+
#[arg(short, long)]
3333
debug_logs: bool,
3434
/// Directory to print logs to
35-
#[clap(long)]
35+
#[arg(long)]
3636
log_dir: Option<String>,
3737

38-
#[clap(subcommand)]
38+
#[command(subcommand)]
3939
subcmd: SubCommand,
4040
}
4141

42-
#[derive(Clap, Debug)]
42+
#[derive(Parser, Debug)]
4343
enum SubCommand {
4444
Activate(ActivateOpts),
4545
Wait(WaitOpts),
4646
Revoke(RevokeOpts),
4747
}
4848

4949
/// Activate a profile
50-
#[derive(Clap, Debug)]
51-
#[clap(group(
50+
#[derive(Parser, Debug)]
51+
#[command(group(
5252
clap::ArgGroup::new("profile")
5353
.required(true)
5454
.multiple(false)
55-
.args(&["profile-path","profile-user"])
55+
.args(&["profile_path","profile_user"])
5656
))]
5757
struct ActivateOpts {
5858
/// The closure to activate
5959
closure: String,
6060
/// The profile path to install into
61-
#[clap(long)]
61+
#[arg(long)]
6262
profile_path: Option<String>,
6363
/// The profile user if explicit profile path is not specified
64-
#[clap(long, requires = "profile-name")]
64+
#[arg(long, requires = "profile_name")]
6565
profile_user: Option<String>,
6666
/// The profile name
67-
#[clap(long, requires = "profile-user")]
67+
#[arg(long, requires = "profile_user")]
6868
profile_name: Option<String>,
6969

7070
/// Maximum time to wait for confirmation after activation
71-
#[clap(long)]
71+
#[arg(long)]
7272
confirm_timeout: u16,
7373

7474
/// Wait for confirmation after deployment and rollback if not confirmed
75-
#[clap(long)]
75+
#[arg(long)]
7676
magic_rollback: bool,
7777

7878
/// Auto rollback if failure
79-
#[clap(long)]
79+
#[arg(long)]
8080
auto_rollback: bool,
8181

8282
/// Show what will be activated on the machines
83-
#[clap(long)]
83+
#[arg(long)]
8484
dry_activate: bool,
8585

8686
/// Don't activate, but update the boot loader to boot into the new profile
87-
#[clap(long)]
87+
#[arg(long)]
8888
boot: bool,
8989

9090
/// Path for any temporary files that may be needed during activation
91-
#[clap(long)]
91+
#[arg(long)]
9292
temp_path: PathBuf,
9393
}
9494

9595
/// Wait for profile activation
96-
#[derive(Clap, Debug)]
96+
#[derive(Parser, Debug)]
9797
struct WaitOpts {
9898
/// The closure to wait for
9999
closure: String,
100100

101101
/// Path for any temporary files that may be needed during activation
102-
#[clap(long)]
102+
#[arg(long)]
103103
temp_path: PathBuf,
104104

105105
/// Timeout to wait for activation
106-
#[clap(long)]
106+
#[arg(long)]
107107
activation_timeout: Option<u16>,
108108
}
109109

110110
/// Revoke profile activation
111-
#[derive(Clap, Debug)]
111+
#[derive(Parser, Debug)]
112112
struct RevokeOpts {
113113
/// The profile path to install into
114-
#[clap(long)]
114+
#[arg(long)]
115115
profile_path: Option<String>,
116116
/// The profile user if explicit profile path is not specified
117-
#[clap(long, requires = "profile-name")]
117+
#[arg(long, requires = "profile_name")]
118118
profile_user: Option<String>,
119119
/// The profile name
120-
#[clap(long, requires = "profile-user")]
120+
#[arg(long, requires = "profile_user")]
121121
profile_name: Option<String>,
122122
}
123123

0 commit comments

Comments
 (0)