Skip to content

Commit d3848d7

Browse files
ipetkovseanmonstar
andauthored
Fix Nix builds and update the lock file (#641)
* Fix clippy warnings * Fix doc example * Clean up tonic-web usage It looks like `tonic_web::enable` was removed with the 0.13.x release so this code hasn't actually compiled for a long time. The doc and code examples all use a custom cors layer so whatever heavy lifting the 0.12 method was doing doesn't seem necessary anymore * ci: run clippy with all features enabled Features are additive so this should be safe to lint them all together (and avoid the combinatorics of using cargo-hack) * ci: run all crate tests in one invocation 1. We've already committed our lockfile so there's no need to test the API/subscriber crates individually (if we want to test with the latest available versions we should be running a `cargo update` in CI, so this change remains compatible with the previous behavior) 2. Also enable some non-default feature flags to ensure they are being tested * Fix nix builds * flake.lock: Update Flake lock file updates: • Updated input 'flake-utils': 'github:numtide/flake-utils/cfacdce06f30d2b68473a46042957675eebb3401' (2023-04-11) → 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b' (2024-11-13) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8' (2024-02-11) → 'github:NixOS/nixpkgs/e9f00bd893984bc8ce46c895c3bf7cac95331127' (2025-09-28) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/8dfbe2dffc28c1a18a29ffa34d5d0b269622b158' (2024-02-13) → 'github:oxalica/rust-overlay/be3b8843a2be2411500f6c052876119485e957a2' (2025-09-29) • Removed input 'rust-overlay/flake-utils' * flake: drop non-existent override --------- Co-authored-by: Sean McArthur <[email protected]>
1 parent 4238e73 commit d3848d7

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

flake.lock

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

flake.nix

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
url = "github:oxalica/rust-overlay";
99
inputs = {
1010
nixpkgs.follows = "nixpkgs";
11-
flake-utils.follows = "flake-utils";
1211
};
1312
};
1413
};
@@ -66,12 +65,32 @@
6665
pname = cargoTOML.package.name;
6766
version = cargoTOML.package.version;
6867

69-
nativeBuildInputs = [ protobuf ];
68+
nativeBuildInputs = [
69+
installShellFiles
70+
protobuf
71+
];
72+
73+
RUSTFLAGS = "--cfg tokio_unstable";
7074

7175
inherit src;
7276

7377
cargoLock = { lockFile = "${src}/Cargo.lock"; };
7478

79+
checkFlags = [
80+
# tests depend upon git repository at test execution time
81+
"--skip bootstrap"
82+
"--skip config::tests::args_example_changed"
83+
"--skip config::tests::toml_example_changed"
84+
"--skip cli_tests"
85+
];
86+
87+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
88+
installShellCompletion --cmd tokio-console \
89+
--bash <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion bash) \
90+
--fish <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion fish) \
91+
--zsh <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion zsh)
92+
'';
93+
7594
meta = {
7695
inherit (cargoTOML.package) description homepage license;
7796
maintainers = cargoTOML.package.authors;
@@ -84,8 +103,7 @@
84103
devShell = with pkgs;
85104
mkShell {
86105
name = "tokio-console-env";
87-
buildInputs = tokio-console.buildInputs ++ lib.optional stdenv.isDarwin libiconv;
88-
nativeBuildInputs = tokio-console.nativeBuildInputs;
106+
inputsFrom = [ tokio-console ];
89107
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
90108
CARGO_TERM_COLOR = "always";
91109
RUST_BACKTRACE = "full";
@@ -105,5 +123,8 @@
105123
inherit tokio-console;
106124
default = self.packages.${system}.tokio-console;
107125
};
126+
checks = {
127+
inherit tokio-console;
128+
};
108129
});
109130
}

0 commit comments

Comments
 (0)