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

build: bump Alpine version to 3.21 #2074

Open
wants to merge 27 commits into
base: v2.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ef11e7d
build: bump Alpine version to 3.20
lklimek Aug 23, 2024
e010d64
fix: sccache cache conflict between alpine versions
lklimek Aug 23, 2024
74dd270
fix: cache conflict of /target between alpine versions
lklimek Aug 23, 2024
6a641f2
Merge branch 'v1.2-dev' into build/docker-alpine-3.20
lklimek Aug 30, 2024
272fc38
chore: switch to alpine 3.21
lklimek Dec 17, 2024
b269799
Merge remote-tracking branch 'origin/v1.9-dev' into build/docker-alpi…
lklimek Dec 17, 2024
5a5bd7b
chore: update Alpine to 3.21
lklimek Dec 17, 2024
5ed0015
build: update rocksdb 8.10.2 to 9.8.4
lklimek Dec 17, 2024
6839bdf
build: update wasm-bindgen-cli to 0.2.99
lklimek Dec 17, 2024
9b94e8e
build: update wasm-bindgen-cli to 0.2.99
lklimek Dec 17, 2024
a27cdb3
build: bump wasm-bindgen-futures to 0.4.49
lklimek Dec 17, 2024
7475b09
chore(wasm-dpp): fix build
lklimek Dec 17, 2024
03bd084
Merge branch 'deps/wasm-bindgen-0.2.99' into build/docker-alpine-3.20
lklimek Dec 17, 2024
b14bb5b
revert: rocksdb back to 8.10.2
lklimek Dec 17, 2024
df7064d
Merge remote-tracking branch 'origin/master' into build/docker-alpine…
lklimek Jan 29, 2025
ef009ac
build!: optimize for x86-64-v3 cpu microarchitecture (Haswell+) (#2374)
lklimek Dec 18, 2024
c5898ab
fit: trying to fix clang: error: unsupported option '-march=' for tar…
lklimek Jan 29, 2025
497d60a
build: downgrade clang and llvm to 18
lklimek Jan 29, 2025
89ef666
chore: clang 18 continued
lklimek Jan 29, 2025
deb43ac
fix: wasm32 does not build
lklimek Jan 30, 2025
4054ecf
chore: build rocksdb in 1 thread
lklimek Jan 30, 2025
11a932d
chore: remove redundant CARGO_BUILD_PROFILE
lklimek Jan 30, 2025
de8af22
chore: rocksdb -j1 again
lklimek Jan 30, 2025
a10fff7
chore: self-review
lklimek Jan 30, 2025
1bd61b3
chore: disable sccache
lklimek Jan 30, 2025
323fbaf
Revert "chore: disable sccache"
lklimek Jan 30, 2025
f257845
Merge remote-tracking branch 'origin/v2.0-dev' into build/docker-alpi…
lklimek Jan 30, 2025
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
5 changes: 4 additions & 1 deletion .cargo/config-release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
rustflags = ["-C", "target-feature=-crt-static"]

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]
rustflags = ["-C", "target-feature=-crt-static", "-C", "target-cpu=x86-64-v3"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=-crt-static", "-C", "target-cpu=x86-64-v3"]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
19 changes: 18 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@
rustflags = ["-C", "target-feature=-crt-static", "--cfg", "tokio_unstable"]

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static", "--cfg", "tokio_unstable"]
rustflags = [
"-C",
"target-feature=-crt-static",
"--cfg",
"tokio_unstable",
"-C",
"target-cpu=x86-64",
]

[target.x86_64-unknown-linux-gnu]
rustflags = [
"-C",
"target-feature=-crt-static",
"--cfg",
"tokio_unstable",
"-C",
"target-cpu=x86-64",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
Expand Down
52 changes: 39 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# conflicts in case of parallel compilation.
# 3. Configuration variables are shared between runs using /root/env file.

ARG ALPINE_VERSION=3.18
ARG ALPINE_VERSION=3.21
lklimek marked this conversation as resolved.
Show resolved Hide resolved

# deps-${RUSTC_WRAPPER:-base}
# If one of SCCACHE_GHA_ENABLED, SCCACHE_BUCKET, SCCACHE_MEMCACHED is set, then deps-sccache is used, otherwise deps-base
Expand All @@ -70,12 +70,13 @@ RUN apk add --no-cache \
bash \
binutils \
ca-certificates \
clang-static clang-dev \
clang18-static clang18-dev \
cmake \
curl \
git \
libc-dev \
linux-headers \
llvm-static llvm-dev \
llvm18-static llvm18-dev \
openssl-dev \
snappy-static snappy-dev \
perl \
Expand Down Expand Up @@ -114,9 +115,28 @@ RUN TOOLCHAIN_VERSION="$(grep channel rust-toolchain.toml | awk '{print $3}' | t
ONBUILD ENV HOME=/root
ONBUILD ENV CARGO_HOME=$HOME/.cargo

# Configure Rust toolchain
ONBUILD ARG CARGO_BUILD_PROFILE=dev

# Configure Rust toolchain and C / C++ compiler
RUN <<EOS
# It doesn't sharing PATH between stages, so we need "source $HOME/.cargo/env" everywhere
RUN echo 'source $HOME/.cargo/env' >> /root/env
echo 'source $HOME/.cargo/env' >> /root/env

# Enable gcc / g++ optimizations
if [[ "$TARGETARCH" == "amd64" ]] ; then
if [[ "${CARGO_BUILD_PROFILE}" == "release" ]] ; then
echo "export CFLAGS=-march=x86-64-v3" >> /root/env
echo "export CXXFLAGS=-march=x86-64-v3" >> /root/env
echo "export PORTABLE=x86-64-v3" >> /root/env
else
echo "export CFLAGS=-march=x86-64" >> /root/env
echo "export CXXFLAGS=-march=x86-64" >> /root/env
echo "export PORTABLE=x86-64" >> /root/env
fi
else
echo "export PORTABLE=1" >> /root/env
fi
EOS

# Install protoc - protobuf compiler
# The one shipped with Alpine does not work
Expand All @@ -129,7 +149,15 @@ RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else e
ln -s /opt/protoc/bin/protoc /usr/bin/

# Switch to clang
RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc
# Note that CC / CXX can be updated later on (eg. when configuring sccache)
RUN rm /usr/bin/cc && \
ln -sf /usr/bin/clang-18 /usr/bin/clang && \
ln -sf /usr/bin/clang++-18 /usr/bin/clang++ && \
ln -s /usr/bin/clang /usr/bin/cc
RUN <<EOS
echo "export CXX='clang++'" >> /root/env
echo "export CC='clang'" >> /root/env
EOS

ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
Expand Down Expand Up @@ -258,14 +286,15 @@ WORKDIR /tmp/rocksdb
# sccache -s
# EOS

# Select whether we want dev or release
# This variable will be also visibe in next stages
ONBUILD ARG CARGO_BUILD_PROFILE=dev

lklimek marked this conversation as resolved.
Show resolved Hide resolved
RUN --mount=type=secret,id=AWS <<EOS
set -ex -o pipefail
git clone https://github.com/facebook/rocksdb.git -b v9.9.3 --depth 1 .
source /root/env

# Support any CPU architecture
export PORTABLE=1

make -j$(nproc) static_lib
mkdir -p /opt/rocksdb/usr/local/lib
cp librocksdb.a /opt/rocksdb/usr/local/lib/
Expand Down Expand Up @@ -320,10 +349,6 @@ RUN --mount=type=secret,id=AWS \
--no-track \
--no-confirm


# Select whether we want dev or release
ONBUILD ARG CARGO_BUILD_PROFILE=dev

#
# Rust build planner to speed up builds
#
Expand Down Expand Up @@ -465,6 +490,7 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
# Remove /platform to reduce layer size
rm -rf /platform


#
# STAGE: BUILD JAVASCRIPT INTERMEDIATE IMAGE
#
Expand Down
4 changes: 4 additions & 0 deletions packages/rs-drive-abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ grovedbg = ["drive/grovedbg"]
[[bin]]
name = "drive-abci"
path = "src/main.rs"


[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
Loading