From 005c08d4f60c54e3558612f8c924853905b82be2 Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Sun, 16 Jun 2024 16:52:19 +0100 Subject: [PATCH] postgresqlPackages.pgvecto-rs: fix build failure on rust 1.78 --- .../0002-std-detect-use-upstream.diff | 25 +++++++++++++++++++ .../sql/postgresql/ext/pgvecto-rs/Cargo.lock | 2 +- .../sql/postgresql/ext/pgvecto-rs/default.nix | 6 ++++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 pkgs/servers/sql/postgresql/ext/pgvecto-rs/0002-std-detect-use-upstream.diff diff --git a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/0002-std-detect-use-upstream.diff b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/0002-std-detect-use-upstream.diff new file mode 100644 index 0000000000000..bd20cf6619a71 --- /dev/null +++ b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/0002-std-detect-use-upstream.diff @@ -0,0 +1,25 @@ +diff --git a/Cargo.lock b/Cargo.lock +index a52b978..092bc1d 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -2788,7 +2788,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] + name = "std_detect" + version = "0.1.5" +-source = "git+https://github.com/tensorchord/stdarch.git?branch=avx512fp16#db0cdbc9b02074bfddabfd23a4a681f21640eada" ++source = "git+https://github.com/rust-lang/stdarch.git?branch=master#d2b1a070afc72d9ba4df80e055109ede5fc0a81f" + dependencies = [ + "cfg-if", + "libc", +diff --git a/crates/detect/Cargo.toml b/crates/detect/Cargo.toml +index b3ac782..c671c6a 100644 +--- a/crates/detect/Cargo.toml ++++ b/crates/detect/Cargo.toml +@@ -4,6 +4,6 @@ version.workspace = true + edition.workspace = true + + [dependencies] +-std_detect = { git = "https://github.com/tensorchord/stdarch.git", branch = "avx512fp16" } ++std_detect = { git = "https://github.com/rust-lang/stdarch.git", branch = "master" } + ctor = "0.2.6" + rustix.workspace = true diff --git a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/Cargo.lock b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/Cargo.lock index a52b9787460e5..092bc1d2e31c8 100644 --- a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/Cargo.lock +++ b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/Cargo.lock @@ -2788,7 +2788,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "std_detect" version = "0.1.5" -source = "git+https://github.com/tensorchord/stdarch.git?branch=avx512fp16#db0cdbc9b02074bfddabfd23a4a681f21640eada" +source = "git+https://github.com/rust-lang/stdarch.git?branch=master#d2b1a070afc72d9ba4df80e055109ede5fc0a81f" dependencies = [ "cfg-if", "libc", diff --git a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix index 9cbf6ae442e4e..0041c555362bf 100644 --- a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix +++ b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix @@ -44,6 +44,10 @@ in src = ./0001-read-clang-flags-from-environment.diff; clang = lib.getExe clang; }) + # Fix build failure on rustc 1.78 due to missing feature flag. + # Can (likely) be removed when pgvecto-rs 0.3.0 is released. + # See https://github.com/NixOS/nixpkgs/issues/320131 + ./0002-std-detect-use-upstream.diff ]; src = fetchFromGitHub { @@ -59,7 +63,7 @@ in lockFile = ./Cargo.lock; outputHashes = { "openai_api_rust-0.1.8" = "sha256-os5Y8KIWXJEYEcNzzT57wFPpEXdZ2Uy9W3j5+hJhhR4="; - "std_detect-0.1.5" = "sha256-RwWejfqyGOaeU9zWM4fbb/hiO1wMpxYPKEjLO0rtRmU="; + "std_detect-0.1.5" = "sha256-Rsy8N0pTJ/3AIHjRyeOeyY7Q9Ho46ZcDmJFurCbRxiQ="; }; };