fix: target-cpu=native works again, apply to ARM builds also

This commit is contained in:
Jeff Bencin
2024-03-06 16:51:56 -05:00
parent 0e9cf5dc1b
commit 8ff05eb946
3 changed files with 5 additions and 6 deletions

View File

@@ -2,12 +2,11 @@
stacks-node = "run --package stacks-node --"
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
# For x86_64 CPUs, default to `native` and override in CI for release builds
# This makes it slightly faster for users running locally built binaries.
# Default to `native`
# This makes it slightly faster for running tests and locally built binaries.
# This can cause trouble when building "portable" binaries, such as for docker,
# so disable it with the "portable" feature.
# TODO: Same for other targets?
[target.'cfg(all(target_arch = "x86_64", not(feature = portable))']
[target.'cfg(not(feature = "portable"))']
rustflags = ["-Ctarget-cpu=native"]
# Needed by perf to generate flamegraphs.

View File

@@ -12,7 +12,7 @@ RUN apk add --no-cache musl-dev
RUN mkdir /out
RUN cd testnet/stacks-node && cargo build --features monitoring_prom,slog_json --release
RUN cd testnet/stacks-node && cargo build --features monitoring_prom,slog_json,portable --release
RUN cp target/release/stacks-node /out

View File

@@ -10,7 +10,7 @@ COPY . .
RUN mkdir /out
RUN cd testnet/stacks-node && cargo build --features monitoring_prom,slog_json --release
RUN cd testnet/stacks-node && cargo build --features monitoring_prom,slog_json,portable --release
RUN cp target/release/stacks-node /out