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

Influxdb{2}: fix build with Rust1.83 compat #368122

Merged
merged 2 commits into from
Dec 27, 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
11 changes: 10 additions & 1 deletion pkgs/servers/nosql/influxdb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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";
Expand Down
12 changes: 10 additions & 2 deletions pkgs/servers/nosql/influxdb2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand All @@ -74,7 +81,6 @@ let
install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
'';
};

in
buildGoModule {
pname = "influxdb";
Expand Down Expand Up @@ -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";
Expand Down
26 changes: 26 additions & 0 deletions pkgs/servers/nosql/influxdb2/rust_lifetime.patch
Original file line number Diff line number Diff line change
@@ -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,
Loading