From e3efe0d4e3bd759df81e399433804036cec7d72e Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Wed, 25 Dec 2024 13:40:09 +0100 Subject: [PATCH 1/2] influxdb2: fix libflux compile with Rust 1.83 Signed-off-by: Florian Brandes --- pkgs/servers/nosql/influxdb2/default.nix | 12 +++++++-- .../nosql/influxdb2/rust_lifetime.patch | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 pkgs/servers/nosql/influxdb2/rust_lifetime.patch diff --git a/pkgs/servers/nosql/influxdb2/default.nix b/pkgs/servers/nosql/influxdb2/default.nix index 56277135f041..61d4b8ec260b 100644 --- a/pkgs/servers/nosql/influxdb2/default.nix +++ b/pkgs/servers/nosql/influxdb2/default.nix @@ -50,7 +50,14 @@ let hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) ./fix-unsigned-char.patch + # https://github.com/influxdata/flux/pull/5516 + ./rust_lifetime.patch ]; + # Don't fail on missing code documentation + postPatch = '' + substituteInPlace flux-core/src/lib.rs \ + --replace-fail "deny(warnings, missing_docs))]" "deny(warnings))]" + ''; sourceRoot = "${src.name}/libflux"; cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; nativeBuildInputs = [ rustPlatform.bindgenHook ]; @@ -74,7 +81,6 @@ let install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib ''; }; - in buildGoModule { pname = "influxdb"; @@ -132,7 +138,9 @@ buildGoModule { "-X main.version=${version}" ]; - passthru.tests = { inherit (nixosTests) influxdb2; }; + passthru.tests = { + inherit (nixosTests) influxdb2; + }; meta = with lib; { description = "Open-source distributed time series database"; diff --git a/pkgs/servers/nosql/influxdb2/rust_lifetime.patch b/pkgs/servers/nosql/influxdb2/rust_lifetime.patch new file mode 100644 index 000000000000..7680f287e217 --- /dev/null +++ b/pkgs/servers/nosql/influxdb2/rust_lifetime.patch @@ -0,0 +1,26 @@ +diff --git a/flux-core/src/ast/walk/mod.rs b/flux-core/src/ast/walk/mod.rs +index 90f70ba6f7..a6966827e8 100644 +--- a/flux-core/src/ast/walk/mod.rs ++++ b/flux-core/src/ast/walk/mod.rs +@@ -180,7 +180,7 @@ impl<'a> Node<'a> { + + impl<'a> Node<'a> { + #[allow(missing_docs)] +- pub fn from_expr(expr: &'a Expression) -> Node { ++ pub fn from_expr(expr: &'a Expression) -> Node<'a> { + match expr { + Expression::Identifier(e) => Node::Identifier(e), + Expression::Array(e) => Node::ArrayExpr(e), +diff --git a/flux-core/src/parser/mod.rs b/flux-core/src/parser/mod.rs +index ac7d4b9a72..561c3a0ff6 100644 +--- a/flux-core/src/parser/mod.rs ++++ b/flux-core/src/parser/mod.rs +@@ -41,7 +41,7 @@ pub struct Parser<'input> { + + impl<'input> Parser<'input> { + /// Instantiates a new parser with the given string as input. +- pub fn new(src: &'input str) -> Parser { ++ pub fn new(src: &'input str) -> Parser<'input> { + let s = Scanner::new(src); + Parser { + s, From fc4e2d36f29655238a470e43c909ead69bc11931 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Wed, 25 Dec 2024 14:00:32 +0100 Subject: [PATCH 2/2] influxdb: fix build with Rust 1.83 Signed-off-by: Florian Brandes --- pkgs/servers/nosql/influxdb/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/nosql/influxdb/default.nix b/pkgs/servers/nosql/influxdb/default.nix index 030590dabe0c..efd6a31d3baa 100644 --- a/pkgs/servers/nosql/influxdb/default.nix +++ b/pkgs/servers/nosql/influxdb/default.nix @@ -34,7 +34,14 @@ let hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc="; }) ../influxdb2/fix-unsigned-char.patch + # https://github.com/influxdata/flux/pull/5516 + ../influxdb2/rust_lifetime.patch ]; + # Don't fail on missing code documentation + postPatch = '' + substituteInPlace flux-core/src/lib.rs \ + --replace-fail "deny(warnings, missing_docs))]" "deny(warnings))]" + ''; sourceRoot = "${src.name}/libflux"; cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA="; nativeBuildInputs = [ rustPlatform.bindgenHook ]; @@ -95,7 +102,9 @@ buildGoModule rec { excludedPackages = "test"; - passthru.tests = { inherit (nixosTests) influxdb; }; + passthru.tests = { + inherit (nixosTests) influxdb; + }; meta = with lib; { description = "Open-source distributed time series database";