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

kapacitor: fix build of embedded libflux dependency with current rust #270233

Merged
merged 2 commits into from
Nov 27, 2023
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
16 changes: 16 additions & 0 deletions pkgs/servers/monitoring/kapacitor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ let
hash = "sha256-v9MUR+PcxAus91FiHYrMN9MbNOTWewh7MT6/t/QWQcM=";
};
patches = [
# This fixes a linting error due to an unneeded call to `.clone()`
# that gets enforced by a strict `deny(warnings)` build config.
# This is already fixed with newer versions of `libflux`, but it
# has been changed in a giant commit with a lot of autmated changes:
# https://github.com/influxdata/flux/commit/e7f7023848929e16ad5bd3b41d217847bd4fd72b#diff-96572e971d9e19b54290a434debbf7db054b21c9ce19035159542756ffb8ab87
#
# Can be removed as soon as kapacitor depends on a newer version of `libflux`, cf:
# https://github.com/influxdata/kapacitor/blob/v1.7.0/go.mod#L26
./fix-linting-error-on-unneeded-clone.patch

# https://github.com/influxdata/flux/pull/5273
# fix compile error with Rust 1.64
(fetchpatch {
Expand Down Expand Up @@ -82,6 +92,12 @@ buildGoModule rec {
rm server/server_test.go
'';

# Tests start http servers which need to bind to local addresses,
# but that fails in the Darwin sandbox by default unless this option is turned on
# Error is: panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
# See also https://github.com/NixOS/nix/pull/1646
__darwinAllowLocalNetworking = true;

meta = with lib; {
description = "Open source framework for processing, monitoring, and alerting on time series data";
homepage = "https://influxdata.com/time-series-platform/kapacitor/";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/flux-core/src/semantic/flatbuffers/types.rs b/flux-core/src/semantic/flatbuffers/types.rs
index c3eecf06..9baf4070 100644
--- a/flux-core/src/semantic/flatbuffers/types.rs
+++ b/flux-core/src/semantic/flatbuffers/types.rs
@@ -715,7 +715,7 @@ mod tests {

fn test_serde(expr: &'static str) {
// let want = parser::parse(expr).unwrap();
- let mut p = parser::Parser::new(expr.clone());
+ let mut p = parser::Parser::new(expr);

let typ_expr = p.parse_type_expression();
if let Err(err) = ast::check::check(ast::walk::Node::TypeExpression(&typ_expr)) {