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

quickwit: fix compilation with rust 1.80 #345219

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkgs/servers/search/quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkgs/servers/search/quickwit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ rustPlatform.buildRustPackage rec {
};
};

cargoPatches =[
./update-time-for-rust-1.80.patch
];

CARGO_PROFILE_RELEASE_LTO = "fat";
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";

Expand Down
28 changes: 28 additions & 0 deletions pkgs/servers/search/quickwit/update-time-for-rust-1.80.patch
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need the patch here, we can just update the lock file directly

Copy link
Contributor Author

@zimward zimward Sep 29, 2024

Choose a reason for hiding this comment

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

i tried to do so first but it then failed stating something along the lines of "mismatch between source Cargo.lock and provided Cargo.lock"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the exact error message:

Validating consistency between /build/source/quickwit/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
8228c8228
< version = "0.3.34"
---
> version = "0.3.36"
8230c8230
< checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
---
> checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
8261c8261
< version = "0.2.17"
---
> version = "0.2.18"
8263c8263
< checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
---
> checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"

ERROR: cargoHash or cargoSha256 is out of date

Cargo.lock is not the same in /build/cargo-vendor-dir

To fix the issue:
1. Set cargoHash/cargoSha256 to an empty string: `cargoHash = "";`
2. Build the derivation and wait for it to fail with a hash mismatch
3. Copy the "got: sha256-..." value back into the cargoHash field
   You should have: cargoHash = "sha256-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=";

Copy link
Member

Choose a reason for hiding this comment

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

🤔 I think I had a similar problem when fixing wezterm. I think it got suggested to me to copy the already vendored Cargo.lock in postPatch to the normal location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will look into it. Thanks for the pointer.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/Cargo.lock b/Cargo.lock
index db5e22e6..6d48db37 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8225,9 +8225,9 @@ dependencies = [

[[package]]
name = "time"
-version = "0.3.34"
+version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
@@ -8258,9 +8258,9 @@ dependencies = [

[[package]]
name = "time-macros"
-version = "0.2.17"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",