From 541458b4644b92a981727b7e40419024907cbdbc Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Fri, 14 Jun 2024 01:50:34 -0500 Subject: [PATCH 1/3] influxdb2: 2.7.1 -> 2.7.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New patch addresses issues with Rust 1.78 until `influxdb2` updates `flux >= v0.195.0`. Removes `no-deny-warnings.patch` and previous Rust version patch as they are not needed anymore. Co-authored-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com> --- pkgs/servers/nosql/influxdb2/default.nix | 24 +++++++++---------- .../nosql/influxdb2/no-deny-warnings.patch | 10 -------- 2 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 pkgs/servers/nosql/influxdb2/no-deny-warnings.patch diff --git a/pkgs/servers/nosql/influxdb2/default.nix b/pkgs/servers/nosql/influxdb2/default.nix index 46dddd6eca3a..2fcb078a9a83 100644 --- a/pkgs/servers/nosql/influxdb2/default.nix +++ b/pkgs/servers/nosql/influxdb2/default.nix @@ -13,15 +13,15 @@ }: let - version = "2.7.1"; - ui_version = "OSS-v${version}"; - libflux_version = "0.193.0"; + version = "2.7.6"; + ui_version = "OSS-v2.7.1"; + libflux_version = "0.194.5"; src = fetchFromGitHub { owner = "influxdata"; repo = "influxdb"; rev = "v${version}"; - hash = "sha256-JWu4V2k8ItbzBa421EtzgMVlDznoDdGjIhfDSaZ0j6c="; + hash = "sha256-0gqFUIV0ETdVuVmC+SwoKsO6OkoT/s+qKO1f8fkaZj4="; }; ui = fetchurl { @@ -36,21 +36,21 @@ let owner = "influxdata"; repo = "flux"; rev = "v${libflux_version}"; - hash = "sha256-gx6vnGOFu35wasLl7X/73eDsE0/50cAzjmBjZ+H2Ne4="; + hash = "sha256-XHT/+JMu5q1cPjZT2x/OKEPgxFJcnjrQKqn8w9/Mb3s="; }; patches = [ - # Fix build with recent rust versions + # Fix build on Rust 1.78 (included after v0.195.0) (fetchpatch { - url = "https://github.com/influxdata/flux/commit/6dc8054cfeec4b65b5c7ae786d633240868b8589.patch"; + name = "fix-build-on-rust-1.78.patch"; + url = "https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02.patch"; stripLen = 2; extraPrefix = ""; - excludes = [ "rust-toolchain.toml" ]; - hash = "sha256-w3z+Z26Xhy9TNICyNhc8XiWNSpdLA23ADI4K/AOMYhg="; + excludes = [ ]; + hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) - ./no-deny-warnings.patch ]; sourceRoot = "${src.name}/libflux"; - cargoSha256 = "sha256-MoI5nxLGA/3pduZ+vgmSG3lm3Nx58SP+6WXQl2pX9Lc="; + cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; nativeBuildInputs = [ rustPlatform.bindgenHook ]; buildInputs = lib.optional stdenv.isDarwin libiconv; pkgcfg = '' @@ -78,7 +78,7 @@ in buildGoModule { nativeBuildInputs = [ go-bindata pkg-config perl ]; - vendorHash = "sha256-5b1WRq3JndkOkKBhMzGZnSyBDY5Lk0UGe/WGHQJp0CQ="; + vendorHash = "sha256-3Vf8BCrOwliXrH+gmZ4RJ1YBEbqL0Szx2prW3ie9CNg="; subPackages = [ "cmd/influxd" "cmd/telemetryd" ]; PKG_CONFIG_PATH = "${flux}/pkgconfig"; diff --git a/pkgs/servers/nosql/influxdb2/no-deny-warnings.patch b/pkgs/servers/nosql/influxdb2/no-deny-warnings.patch deleted file mode 100644 index 3000ccad8256..000000000000 --- a/pkgs/servers/nosql/influxdb2/no-deny-warnings.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/flux/src/lib.rs b/flux/src/lib.rs -index 3fdf4071..a4c02277 100644 ---- a/flux/src/lib.rs -+++ b/flux/src/lib.rs -@@ -1,5 +1,3 @@ --#![cfg_attr(feature = "strict", deny(warnings, missing_docs))] -- - //! This module provides the public facing API for Flux's Go runtime, including formatting, - //! parsing, and standard library analysis. - use std::sync::Arc; From 746c18462587129dec96052dfde42c2bc53c3754 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Sat, 15 Jun 2024 13:26:47 -0500 Subject: [PATCH 2/3] influxdb: 1.10.5 -> 1.10.7 New patch addresses issues with Rust 1.78 until `influxdb` updates `flux >= v0.195.0`. --- pkgs/servers/nosql/influxdb/default.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/servers/nosql/influxdb/default.nix b/pkgs/servers/nosql/influxdb/default.nix index 83a0dc0da83d..7f0091f1bee3 100644 --- a/pkgs/servers/nosql/influxdb/default.nix +++ b/pkgs/servers/nosql/influxdb/default.nix @@ -1,9 +1,9 @@ { lib, buildGoModule, fetchFromGitHub, stdenv, pkg-config, rustPlatform, libiconv, fetchpatch, nixosTests }: let - libflux_version = "0.188.0"; + libflux_version = "0.194.5"; - # This is copied from influxdb2 with flux version matching the needed by thi + # This is copied from influxdb2 with the required flux version flux = rustPlatform.buildRustPackage rec { pname = "libflux"; version = "v${libflux_version}"; @@ -11,21 +11,21 @@ let owner = "influxdata"; repo = "flux"; rev = "v${libflux_version}"; - hash = "sha256-4Z6Vfdyh0zimQlE47plSIjTWBYiju0Qu09M+MgMQOL4="; + hash = "sha256-XHT/+JMu5q1cPjZT2x/OKEPgxFJcnjrQKqn8w9/Mb3s="; }; patches = [ - # https://github.com/influxdata/flux/pull/5440 - # fix compile error with Rust 1.72.0 + # Fix build on Rust 1.78 (included after v0.195.0) (fetchpatch { - url = "https://github.com/influxdata/flux/commit/8d1d6c8b485eb7e15b6a5f57762d1f766b17defd.patch"; + name = "fix-build-on-rust-1.78.patch"; + url = "https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02.patch"; stripLen = 2; extraPrefix = ""; - hash = "sha256-BDBmGKsC2RWMyObDm7dPwFq/3cVIdBKF8ZVaCL+uftw="; - includes = [ "flux/src/lib.rs" ]; + excludes = [ ]; + hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) ]; sourceRoot = "${src.name}/libflux"; - cargoHash = "sha256-925U9weBOvMuyApsTOjtQxik3nqT2UpK+DPM64opc7c="; + cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; nativeBuildInputs = [ rustPlatform.bindgenHook ]; buildInputs = lib.optional stdenv.isDarwin libiconv; pkgcfg = '' @@ -48,16 +48,16 @@ let in buildGoModule rec { pname = "influxdb"; - version = "1.10.5"; + version = "1.10.7"; src = fetchFromGitHub { owner = "influxdata"; repo = pname; rev = "v${version}"; - hash = "sha256-FvKGNqy27q6/X2DI/joJXfGVrax6hQcNcx5nJDeSLm0="; + hash = "sha256-Aibu3yG/D1501Hr2F2qsGvjig14tbEAI+MBfqbxlpg8="; }; - vendorHash = "sha256-1jeZBVmNOxF5NPlTKg+YRw6VqIIZDcT3snnoMLX3y4g="; + vendorHash = "sha256-AA6uj7PgXjC+IK2ZSwRnYpHS4MFScOROO1BpP+s33IU="; nativeBuildInputs = [ pkg-config ]; From d7aecd3cb0073633628806fc1ee215b69f3384a0 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Sat, 15 Jun 2024 23:56:05 -0500 Subject: [PATCH 3/3] {influxdb, influxdb2}: fix build on aarch64-linux An inadvertent reliance on `char` being signed crept into `libflux`; this patch specifies a signed 8-bit type for the literal and then explicitly casts to the appropriate platform `c_char` type. --- pkgs/servers/nosql/influxdb/default.nix | 1 + pkgs/servers/nosql/influxdb2/default.nix | 1 + .../servers/nosql/influxdb2/fix-unsigned-char.patch | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 pkgs/servers/nosql/influxdb2/fix-unsigned-char.patch diff --git a/pkgs/servers/nosql/influxdb/default.nix b/pkgs/servers/nosql/influxdb/default.nix index 7f0091f1bee3..739fab6f8119 100644 --- a/pkgs/servers/nosql/influxdb/default.nix +++ b/pkgs/servers/nosql/influxdb/default.nix @@ -23,6 +23,7 @@ let excludes = [ ]; hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) + ../influxdb2/fix-unsigned-char.patch ]; sourceRoot = "${src.name}/libflux"; cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; diff --git a/pkgs/servers/nosql/influxdb2/default.nix b/pkgs/servers/nosql/influxdb2/default.nix index 2fcb078a9a83..81333a9f1ec3 100644 --- a/pkgs/servers/nosql/influxdb2/default.nix +++ b/pkgs/servers/nosql/influxdb2/default.nix @@ -48,6 +48,7 @@ let excludes = [ ]; hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) + ./fix-unsigned-char.patch ]; sourceRoot = "${src.name}/libflux"; cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; diff --git a/pkgs/servers/nosql/influxdb2/fix-unsigned-char.patch b/pkgs/servers/nosql/influxdb2/fix-unsigned-char.patch new file mode 100644 index 000000000000..173e5b30e5ee --- /dev/null +++ b/pkgs/servers/nosql/influxdb2/fix-unsigned-char.patch @@ -0,0 +1,13 @@ +diff --git a/flux/src/cffi.rs b/flux/src/cffi.rs +index ba18e3d5..0c1badf8 100644 +--- a/flux/src/cffi.rs ++++ b/flux/src/cffi.rs +@@ -1149,7 +1149,7 @@ from(bucket: v.bucket) + fn parse_with_invalid_utf8() { + let cfname = CString::new("foo.flux").unwrap(); + let cfname_ptr: *const c_char = cfname.as_ptr(); +- let v: Vec = vec![-61, 0]; ++ let v: Vec = vec![-61i8 as c_char, 0]; + let csrc: *const c_char = &v[0]; + // Safety: both pointers are valid + let pkg = unsafe { flux_parse(cfname_ptr, csrc) };