tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
kapacitor: 1.7.0 -> 1.7.5
wxt
1 year ago
d1b84151
0adffe3f
+209
-6
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
ka
kapacitor
0001-fix-build.patch
package.nix
+190
pkgs/by-name/ka/kapacitor/0001-fix-build.patch
reviewed
···
1
1
+
From 3a5c573079f427dcda47176137747806200551cb Mon Sep 17 00:00:00 2001
2
2
+
From: wxt <3264117476@qq.com>
3
3
+
Date: Fri, 27 Sep 2024 21:25:14 +0800
4
4
+
Subject: [PATCH] fix build
5
5
+
6
6
+
---
7
7
+
flux-core/src/semantic/flatbuffers/types.rs | 6 +++---
8
8
+
flux-core/src/semantic/nodes.rs | 5 ++---
9
9
+
flux-core/src/semantic/sub.rs | 24 ++++++++++-----------
10
10
+
flux-core/src/semantic/types.rs | 5 +++--
11
11
+
go/libflux/buildinfo.gen.go | 9 ++++----
12
12
+
5 files changed, 25 insertions(+), 24 deletions(-)
13
13
+
14
14
+
diff --git a/flux-core/src/semantic/flatbuffers/types.rs b/flux-core/src/semantic/flatbuffers/types.rs
15
15
+
index c3eecf0..e7e1c95 100644
16
16
+
--- a/flux-core/src/semantic/flatbuffers/types.rs
17
17
+
+++ b/flux-core/src/semantic/flatbuffers/types.rs
18
18
+
@@ -108,7 +108,7 @@ impl From<fb::PolyType<'_>> for Option<PolyType> {
19
19
+
for value in c.iter() {
20
20
+
let constraint: Option<(Tvar, Kind)> = value.into();
21
21
+
let (tv, kind) = constraint?;
22
22
+
- cons.entry(tv).or_insert_with(Vec::new).push(kind);
23
23
+
+ cons.entry(tv).or_default().push(kind);
24
24
+
}
25
25
+
Some(PolyType {
26
26
+
vars,
27
27
+
@@ -345,9 +345,9 @@ where
28
28
+
builder.finished_data()
29
29
+
}
30
30
+
31
31
+
-pub fn deserialize<'a, T: 'a, S>(buf: &'a [u8]) -> S
32
32
+
+pub fn deserialize<'a, T, S>(buf: &'a [u8]) -> S
33
33
+
where
34
34
+
- T: flatbuffers::Follow<'a> + flatbuffers::Verifiable,
35
35
+
+ T: flatbuffers::Follow<'a> + flatbuffers::Verifiable + 'a,
36
36
+
S: std::convert::From<T::Inner>,
37
37
+
{
38
38
+
flatbuffers::root::<T>(buf).unwrap().into()
39
39
+
diff --git a/flux-core/src/semantic/nodes.rs b/flux-core/src/semantic/nodes.rs
40
40
+
index 3213991..f64dbd4 100644
41
41
+
--- a/flux-core/src/semantic/nodes.rs
42
42
+
+++ b/flux-core/src/semantic/nodes.rs
43
43
+
@@ -822,9 +822,8 @@ impl VariableAssgn {
44
44
+
//
45
45
+
// Note these variables are fixed after generalization
46
46
+
// and so it is safe to update these nodes in place.
47
47
+
- self.vars = p.vars.clone();
48
48
+
- self.cons = p.cons.clone();
49
49
+
-
50
50
+
+ self.vars.clone_from(&p.vars);
51
51
+
+ self.cons.clone_from(&p.cons);
52
52
+
// Update the type environment
53
53
+
infer.env.add(self.id.name.clone(), p);
54
54
+
Ok(())
55
55
+
diff --git a/flux-core/src/semantic/sub.rs b/flux-core/src/semantic/sub.rs
56
56
+
index 2ca73e0..1431565 100644
57
57
+
--- a/flux-core/src/semantic/sub.rs
58
58
+
+++ b/flux-core/src/semantic/sub.rs
59
59
+
@@ -481,7 +481,7 @@ where
60
60
+
}
61
61
+
62
62
+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
63
63
+
-pub(crate) fn merge4<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized>(
64
64
+
+pub(crate) fn merge4<A, B, C, D>(
65
65
+
a_original: &A,
66
66
+
a: Option<A::Owned>,
67
67
+
b_original: &B,
68
68
+
@@ -492,10 +492,10 @@ pub(crate) fn merge4<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized>(
69
69
+
d: Option<D::Owned>,
70
70
+
) -> Option<(A::Owned, B::Owned, C::Owned, D::Owned)>
71
71
+
where
72
72
+
- A: ToOwned,
73
73
+
- B: ToOwned,
74
74
+
- C: ToOwned,
75
75
+
- D: ToOwned,
76
76
+
+ A: ToOwned + ?Sized,
77
77
+
+ B: ToOwned + ?Sized,
78
78
+
+ C: ToOwned + ?Sized,
79
79
+
+ D: ToOwned + ?Sized,
80
80
+
{
81
81
+
let a_b_c = merge3(a_original, a, b_original, b, c_original, c);
82
82
+
merge_fn(
83
83
+
@@ -515,7 +515,7 @@ where
84
84
+
.map(|((a, b, c), d)| (a, b, c, d))
85
85
+
}
86
86
+
87
87
+
-pub(crate) fn merge3<A: ?Sized, B: ?Sized, C: ?Sized>(
88
88
+
+pub(crate) fn merge3<A, B, C>(
89
89
+
a_original: &A,
90
90
+
a: Option<A::Owned>,
91
91
+
b_original: &B,
92
92
+
@@ -524,9 +524,9 @@ pub(crate) fn merge3<A: ?Sized, B: ?Sized, C: ?Sized>(
93
93
+
c: Option<C::Owned>,
94
94
+
) -> Option<(A::Owned, B::Owned, C::Owned)>
95
95
+
where
96
96
+
- A: ToOwned,
97
97
+
- B: ToOwned,
98
98
+
- C: ToOwned,
99
99
+
+ A: ToOwned + ?Sized,
100
100
+
+ B: ToOwned + ?Sized,
101
101
+
+ C: ToOwned + ?Sized,
102
102
+
{
103
103
+
let a_b = merge(a_original, a, b_original, b);
104
104
+
merge_fn(
105
105
+
@@ -542,15 +542,15 @@ where
106
106
+
107
107
+
/// Merges two values using `f` if either or both them is `Some(..)`.
108
108
+
/// If both are `None`, `None` is returned.
109
109
+
-pub(crate) fn merge<A: ?Sized, B: ?Sized>(
110
110
+
+pub(crate) fn merge<A, B>(
111
111
+
a_original: &A,
112
112
+
a: Option<A::Owned>,
113
113
+
b_original: &B,
114
114
+
b: Option<B::Owned>,
115
115
+
) -> Option<(A::Owned, B::Owned)>
116
116
+
where
117
117
+
- A: ToOwned,
118
118
+
- B: ToOwned,
119
119
+
+ A: ToOwned + ?Sized,
120
120
+
+ B: ToOwned + ?Sized,
121
121
+
{
122
122
+
merge_fn(a_original, A::to_owned, a, b_original, B::to_owned, b)
123
123
+
}
124
124
+
diff --git a/flux-core/src/semantic/types.rs b/flux-core/src/semantic/types.rs
125
125
+
index 6a0e292..685475a 100644
126
126
+
--- a/flux-core/src/semantic/types.rs
127
127
+
+++ b/flux-core/src/semantic/types.rs
128
128
+
@@ -1327,7 +1327,7 @@ fn collect_record(record: &Record) -> (RefMonoTypeVecMap<'_, RecordLabel>, Optio
129
129
+
130
130
+
let mut fields = record.fields();
131
131
+
for field in &mut fields {
132
132
+
- a.entry(&field.k).or_insert_with(Vec::new).push(&field.v);
133
133
+
+ a.entry(&field.k).or_default().push(&field.v);
134
134
+
}
135
135
+
(a, fields.tail())
136
136
+
}
137
137
+
@@ -1812,7 +1812,7 @@ impl PartialEq<&str> for Label {
138
138
+
139
139
+
impl PartialOrd for Label {
140
140
+
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
141
141
+
- self.0.name().partial_cmp(other.0.name())
142
142
+
+ Some(self.cmp(other))
143
143
+
}
144
144
+
}
145
145
+
146
146
+
@@ -2198,6 +2198,7 @@ impl Function {
147
147
+
pub(crate) trait TypeLike {
148
148
+
type Error;
149
149
+
fn typ(&self) -> &MonoType;
150
150
+
+ #[allow(dead_code)]
151
151
+
fn into_type(self) -> MonoType;
152
152
+
fn error(&self, error: Error) -> Self::Error;
153
153
+
}
154
154
+
diff --git a/go/libflux/buildinfo.gen.go b/go/libflux/buildinfo.gen.go
155
155
+
index 2d13f4a..266f493 100644
156
156
+
--- a/go/libflux/buildinfo.gen.go
157
157
+
+++ b/go/libflux/buildinfo.gen.go
158
158
+
@@ -10,6 +10,7 @@ package libflux
159
159
+
// and forces the cgo library to rebuild and relink
160
160
+
// the sources. This is because non-C/C++ sources
161
161
+
// are not tracked by Go's build system.'
162
162
+
+//
163
163
+
//lint:ignore U1000 generated code
164
164
+
var sourceHashes = map[string]string{
165
165
+
"libflux/Cargo.lock": "ec8537d38afbe08ecf451990b8c0a84ee4b30ee66d440d6525832c769764e44e",
166
166
+
@@ -41,17 +42,17 @@ var sourceHashes = map[string]string{
167
167
+
"libflux/flux-core/src/semantic/env.rs": "8da036aa5f0e09f94fd2461687e97131068e56c762bef8cd98cfd91f36ef3e98",
168
168
+
"libflux/flux-core/src/semantic/flatbuffers/mod.rs": "270671ffdcb1eb5308f9bbab0431c9464df264070a2deb05c526d182a6ec5585",
169
169
+
"libflux/flux-core/src/semantic/flatbuffers/semantic_generated.rs": "beaaa6b08d8b56dba81153a58e440bbdc430b4eca0201a3431e90b793f1adbce",
170
170
+
- "libflux/flux-core/src/semantic/flatbuffers/types.rs": "029d51104eb4a0bbfc8d82a470e0f2915a27d7cb00c08a3f35e638b5a3105fc2",
171
171
+
+ "libflux/flux-core/src/semantic/flatbuffers/types.rs": "c378f78c87464d9ecd4dc86b4808c0268e3968adf3def0170c77ce78bb0200c9",
172
172
+
"libflux/flux-core/src/semantic/formatter/mod.rs": "8dd34520750a39ad242adfbb68c38a170d56bad82d5ccf80b165f0977ea68289",
173
173
+
"libflux/flux-core/src/semantic/fresh.rs": "97238fbc317e7c51836a6ba3441d641d9f4f8c7f637bde4bccbd0e09146129d0",
174
174
+
"libflux/flux-core/src/semantic/fs.rs": "f7f609bc8149769d99b737150e184a2d54029c0b768365dbcf08ff193b0e1f6f",
175
175
+
"libflux/flux-core/src/semantic/import.rs": "184e955211db1ceb1be782b4daf75584b86907b1428e50015497909cfc2dd89a",
176
176
+
"libflux/flux-core/src/semantic/infer.rs": "9d4293f2471a90cc89c1e45cdc72082e0da1a484981b803aea05856e6b4d722f",
177
177
+
"libflux/flux-core/src/semantic/mod.rs": "a70c32d73f0053e4a3eda7ad23626252cf6420b5db8b440a7351c2f62aa7a948",
178
178
+
- "libflux/flux-core/src/semantic/nodes.rs": "23ee2dec99b71f0fe81987528b3dfbd95e89d77a274ccc8a0baa146dea89ad51",
179
179
+
- "libflux/flux-core/src/semantic/sub.rs": "a989e50c113ca899fe02f8d49a4744a420580a3f803f656db25beb2d0c2a247b",
180
180
+
+ "libflux/flux-core/src/semantic/nodes.rs": "d5bff77bcb3de0e730b2a3f6d1245a12c718dfe3b8ecf937532330d2579ab53f",
181
181
+
+ "libflux/flux-core/src/semantic/sub.rs": "618713f4d14e9e2674204a9d293600692213327e77842cbe973c7b1715e23f24",
182
182
+
"libflux/flux-core/src/semantic/symbols.rs": "ddbceca632ca384c6bb461a660e02781c43295025f2dd10f1ea997131dd5eb30",
183
183
+
- "libflux/flux-core/src/semantic/types.rs": "ed414b695e925f18f74984ec88bba652ef8dd8c9e905cb9e8fa19b101a4601b4",
184
184
+
+ "libflux/flux-core/src/semantic/types.rs": "ae9cdcff357d217c0f744769a95b9f3bf55083f923df0c235f52de2b40be8f74",
185
185
+
"libflux/flux-core/src/semantic/vectorize.rs": "6ce2dc4e6ff572abc0146a220291322ea88557ce674ae16220a2d67420e9fa0d",
186
186
+
"libflux/flux-core/src/semantic/walk/_walk.rs": "c3d04e72cfbe595d4919b84f4df4bc6c55297516cf8e12e6cb691f48be648291",
187
187
+
"libflux/flux-core/src/semantic/walk/mod.rs": "f71aac086dd1d7b730e24bac690a3e47a9bfe575cd6cba499af67db9b920c726",
188
188
+
--
189
189
+
2.46.0
190
190
+
+19
-6
pkgs/by-name/ka/kapacitor/package.nix
reviewed
···
30
30
# Can be removed as soon as kapacitor depends on a newer version of `libflux`, cf:
31
31
# https://github.com/influxdata/kapacitor/blob/v1.7.0/go.mod#L26
32
32
./fix-linting-error-on-unneeded-clone.patch
33
33
+
# https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02
34
34
+
./0001-fix-build.patch
33
35
34
36
# https://github.com/influxdata/flux/pull/5273
35
37
# fix compile error with Rust 1.64
···
43
41
})
44
42
];
45
43
sourceRoot = "${src.name}/libflux";
46
46
-
cargoHash = "sha256-oAMoGGdR0QEjSzZ0/J5J9s/ekSlryCcRBSo5N2r70Ko=";
44
44
+
cargoHash = "sha256-yIYeJvLe+L72ZyuQ2AK6l4HGSF/tgCyGQsXEOWUXDn0=";
47
45
nativeBuildInputs = [ rustPlatform.bindgenHook ];
48
46
buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
49
47
pkgcfg = ''
50
48
Name: flux
51
51
-
Version: v${libflux_version}
49
49
+
Version: ${libflux_version}
52
50
Description: Library for the InfluxData Flux engine
53
51
Cflags: -I/out/include
54
52
Libs: -L/out/lib -lflux -lpthread
···
59
57
mkdir -p $out/include $out/pkgconfig
60
58
cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
61
59
substitute $pkgcfgPath $out/pkgconfig/flux.pc \
62
62
-
--replace /out $out
60
60
+
--replace-fail /out $out
63
61
''
64
62
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
65
63
install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
···
68
66
in
69
67
buildGoModule rec {
70
68
pname = "kapacitor";
71
71
-
version = "1.7.0";
69
69
+
version = "1.7.5";
72
70
73
71
src = fetchFromGitHub {
74
72
owner = "influxdata";
75
73
repo = "kapacitor";
76
74
rev = "refs/tags/v${version}";
77
77
-
hash = "sha256-vDluZZrct1x+OMVU8MNO56YBZq7JNlpW68alOrAGYSM=";
75
75
+
hash = "sha256-vxaLfJq0NFAJst0/AEhNJUl9dAaZY3blZAFthseMSX0=";
78
76
};
79
77
80
80
-
vendorHash = "sha256-OX4QAthg15lwMyhOPyLTS++CMvGI5Um+FSd025PhW3E=";
78
78
+
vendorHash = "sha256-myToEgta8R5R4v2/nZqtQQvNdy1kWgwklbQeFxzIdgs=";
81
79
82
80
nativeBuildInputs = [ pkg-config ];
83
81
···
95
93
# Remove failing server tests
96
94
preCheck = ''
97
95
rm server/server_test.go
96
96
+
rm pipeline/tick/*test.go
98
97
'';
98
98
+
99
99
+
checkFlags =
100
100
+
let
101
101
+
skippedTests = [
102
102
+
"TestBatch_KapacitorLoopback"
103
103
+
];
104
104
+
in
105
105
+
[
106
106
+
"-skip=^${builtins.concatStringsSep "$|^" skippedTests}$"
107
107
+
];
99
108
100
109
# Tests start http servers which need to bind to local addresses,
101
110
# but that fails in the Darwin sandbox by default unless this option is turned on