Last active
August 4, 2023 20:54
-
-
Save positron96/8f92d0dd692e74a7a93e992ad709d239 to your computer and use it in GitHub Desktop.
Building vector.dev for Raspberry Pi 1 (and Rpi Zero) - Adding arm-unknown-linux-musleabihf target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector.dev does not come with armv6 target, so it cannot be installed to old RPi 1 or RPi Zero. | |
However, it can be compiled from source for that CPUJ architecture. I used `arm-unknown-linux-musleabihf`. | |
I use 0.31.0 version and followed this guide: https://vector.dev/docs/setup/installation/manual/from-source/#docker | |
Apply the following patch to the codebase, then you'll be able to do `make package-arm-unknown-linux-musleabihf | |
` to make a tar.gz or `make package-deb-arm-musl` to make a deb package. | |
Building vector consumes about 10Gb, and 10Gb more to build a deb. | |
I had to drop kafka support, as librdkafka was very stubborn and wanted to be compiled for armv7 target even when all the components were build for armv6. | |
I had linking issues concerning vfp3 functions, so I dropped the whole feature as I did not need it. | |
I am sure it can be fixed, but the easiest way was to just disable kafka support. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.cargo/config.toml b/.cargo/config.toml | |
index 2777301..12153cb 100644 | |
--- a/.cargo/config.toml | |
+++ b/.cargo/config.toml | |
@@ -22,6 +22,10 @@ rustflags = "-Lnative=/lib/native-libs" | |
[target.armv7-unknown-linux-musleabihf] | |
rustflags = "-Lnative=/lib/native-libs" | |
+[target.arm-unknown-linux-musleabihf] | |
+rustflags = "-Lnative=/lib/native-libs" | |
+ | |
+ | |
[target.x86_64-unknown-linux-gnu] | |
rustflags = ["-C", "link-args=-rdynamic"] | |
diff --git a/Cargo.toml b/Cargo.toml | |
index dd4227f..1a4eff4 100644 | |
--- a/Cargo.toml | |
+++ b/Cargo.toml | |
@@ -82,6 +82,10 @@ depends = "libc6 (>= 2.18)" | |
[package.metadata.deb.variants.aarch64-unknown-linux-musl] | |
depends = "" | |
+[package.metadata.deb.variants.arm-unknown-linux-musleabihf] | |
+depends = "" | |
+ | |
+ | |
[workspace] | |
members = [ | |
".", | |
@@ -401,6 +405,7 @@ target-aarch64-unknown-linux-gnu = ["api", "api-client", "enrichment-tables", "r | |
target-aarch64-unknown-linux-musl = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-dnstap", "transforms", "unix", "enterprise"] | |
target-armv7-unknown-linux-gnueabihf = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-dnstap", "transforms", "unix", "enterprise"] | |
target-armv7-unknown-linux-musleabihf = ["api", "api-client", "rdkafka?/cmake_build", "enrichment-tables", "sinks", "sources", "sources-dnstap", "transforms", "enterprise"] | |
+target-arm-unknown-linux-musleabihf = ["api", "api-client", "enrichment-tables", "sinks", "sources", "sources-dnstap", "transforms", "enterprise"] | |
target-x86_64-unknown-linux-gnu = ["api", "api-client", "rdkafka?/cmake_build", "enrichment-tables", "sinks", "sources", "sources-dnstap", "transforms", "unix", "rdkafka?/gssapi-vendored", "enterprise"] | |
target-x86_64-unknown-linux-musl = ["api", "api-client", "rdkafka?/cmake_build", "enrichment-tables", "sinks", "sources", "sources-dnstap", "transforms", "unix", "enterprise"] | |
# Does not currently build | |
@@ -477,7 +482,7 @@ sources-logs = [ | |
"sources-http_client", | |
"sources-internal_logs", | |
"sources-journald", | |
- "sources-kafka", | |
+# "sources-kafka", | |
"sources-kubernetes_logs", | |
"sources-logstash", | |
"sources-nats", | |
@@ -624,7 +629,7 @@ sinks-logs = [ | |
"sinks-http", | |
"sinks-humio", | |
"sinks-influxdb", | |
- "sinks-kafka", | |
+# "sinks-kafka", | |
"sinks-mezmo", | |
"sinks-loki", | |
"sinks-nats", | |
@@ -648,7 +653,7 @@ sinks-metrics = [ | |
"sinks-datadog_metrics", | |
"sinks-humio", | |
"sinks-influxdb", | |
- "sinks-kafka", | |
+# "sinks-kafka", | |
"sinks-prometheus", | |
"sinks-sematext", | |
"sinks-statsd", | |
diff --git a/Cross.toml b/Cross.toml | |
index 1b138c3..f11aba0 100644 | |
--- a/Cross.toml | |
+++ b/Cross.toml | |
@@ -28,3 +28,6 @@ image = "vector-cross-env:armv7-unknown-linux-gnueabihf" | |
[target.armv7-unknown-linux-musleabihf] | |
image = "vector-cross-env:armv7-unknown-linux-musleabihf" | |
+ | |
+[target.arm-unknown-linux-musleabihf] | |
+image = "vector-cross-env:arm-unknown-linux-musleabihf" | |
diff --git a/Makefile b/Makefile | |
index d988725..97dcdb1 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -527,11 +527,15 @@ package-armv7-unknown-linux-gnueabihf: target/artifacts/vector-${VERSION}-armv7- | |
package-armv7-unknown-linux-musleabihf: target/artifacts/vector-${VERSION}-armv7-unknown-linux-musleabihf.tar.gz ## Build an archive suitable for the `armv7-unknown-linux-musleabihf triple. | |
@echo "Output to ${<}." | |
+.PHONY: package-arm-unknown-linux-musleabihf | |
+package-arm-unknown-linux-musleabihf: target/artifacts/vector-${VERSION}-arm-unknown-linux-musleabihf.tar.gz | |
+ @echo "Output to ${<}." | |
+ | |
# debs | |
.PHONY: package-deb-x86_64-unknown-linux-gnu | |
package-deb-x86_64-unknown-linux-gnu: package-x86_64-unknown-linux-gnu ## Build the x86_64 GNU deb package | |
- $(CONTAINER_TOOL) run -v $(PWD):/git/vectordotdev/vector/ -e TARGET=x86_64-unknown-linux-gnu -e VECTOR_VERSION $(ENVIRONMENT_UPSTREAM) cargo vdev package deb | |
+ $(CONTAINER_TOOL) run -v $(PWD):/git/vectordotdev/vector/ -e TARGET=x86_64-unknown-linux-gnu -e VECTOR_VERSION $(ENVIRONMENT_UPSTREAM) cargo vdev package deb | |
.PHONY: package-deb-x86_64-unknown-linux-musl | |
package-deb-x86_64-unknown-linux-musl: package-x86_64-unknown-linux-musl ## Build the x86_64 GNU deb package | |
@@ -545,6 +549,10 @@ package-deb-aarch64: package-aarch64-unknown-linux-gnu ## Build the aarch64 deb | |
package-deb-armv7-gnu: package-armv7-unknown-linux-gnueabihf ## Build the armv7-unknown-linux-gnueabihf deb package | |
$(CONTAINER_TOOL) run -v $(PWD):/git/vectordotdev/vector/ -e TARGET=armv7-unknown-linux-gnueabihf -e VECTOR_VERSION $(ENVIRONMENT_UPSTREAM) cargo vdev package deb | |
+.PHONY: package-deb-arm-musl | |
+package-deb-arm-musl: package-arm-unknown-linux-musleabihf | |
+ $(CONTAINER_TOOL) run -v $(PWD):/git/vectordotdev/vector/ -e TARGET=arm-unknown-linux-musleabihf -e VECTOR_VERSION $(ENVIRONMENT_UPSTREAM) git config --global --add safe.directory /git/vectordotdev/vector && cargo vdev package deb | |
+ | |
# rpms | |
.PHONY: package-rpm-x86_64-unknown-linux-gnu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment