Skip to content

Commit e0653fd

Browse files
authored
Revert "Update lib features (#1174)" (#1330)
This reverts commit 5806878.
1 parent c0fdee6 commit e0653fd

3 files changed

Lines changed: 30 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ jobs:
4141
needs: [linux]
4242
if: github.event_name == 'push' || inputs.Docker
4343
steps:
44-
- name: Install Cosign
45-
uses: sigstore/cosign-installer@v3
46-
4744
- name: Log In to GitHub Container Registry
4845
uses: docker/login-action@v3
4946
with:
@@ -85,8 +82,6 @@ jobs:
8582
echo "GHCR_DIGEST_SHA=$(cat GHCR_DIGEST_SHA)" | tee -a "${GITHUB_ENV}"
8683
docker buildx imagetools inspect --format '{{json .Manifest}}' index.docker.io/${{github.repository}}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json) | jq -r '.digest' > DOCKERHUB_DIGEST_SHA
8784
echo "DOCKERHUB_DIGEST_SHA=$(cat DOCKERHUB_DIGEST_SHA)" | tee -a "${GITHUB_ENV}"
88-
cosign sign --yes $(jq --arg GHCR_DIGEST_SHA "$(cat GHCR_DIGEST_SHA)" -cr '.target."docker-metadata-action".tags | map(select(startswith("ghcr.io/${{github.repository}}")) | . + "@" + $GHCR_DIGEST_SHA) | join(" ")' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json)
89-
cosign sign --yes $(jq --arg DOCKERHUB_DIGEST_SHA "$(cat DOCKERHUB_DIGEST_SHA)" -cr '.target."docker-metadata-action".tags | map(select(startswith("index.docker.io/${{github.repository}}")) | . + "@" + $DOCKERHUB_DIGEST_SHA) | join(" ")' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json)
9085
9186
- name: Attest GHCR
9287
uses: actions/attest-build-provenance@v2
@@ -339,7 +334,7 @@ jobs:
339334
run: |
340335
rustup target add ${{matrix.target}}
341336
# Get latest FoundationDB installer
342-
curl --retry 5 -Lso foundationdb.pkg "$(curl --retry 5 -Ls 'https://api.github.com/repos/apple/foundationdb/releases' | jq -r '.[] | select(.prerelease == false) | .assets[] | select(.name | test("${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}" + ".pkg")) | .browser_download_url' | head -n1)"
337+
curl -Lo foundationdb.pkg "https://glare.now.sh/apple/foundationdb/${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}.pkg"
343338
sudo installer -allowUntrusted -dumplog -pkg foundationdb.pkg -target /
344339
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise"
345340
mkdir -p artifacts
@@ -410,25 +405,16 @@ jobs:
410405
archive/**/*.tar.gz
411406
archive/**/*.zip
412407
413-
- name: Use cosign to sign existing artifacts
414-
uses: sigstore/gh-action-sigstore-python@v3.0.0
415-
with:
416-
inputs: |
417-
archive/**/*.tar.gz
418-
archive/**/*.zip
419-
420408
- name: Release
421409
uses: softprops/action-gh-release@v2
422410
with:
423411
files: |
424412
archive/**/*.tar.gz
425413
archive/**/*.zip
426-
archive/**/*.sigstore.json
427414
prerelease: ${{!startsWith(github.ref, 'refs/tags/') || null}}
428415
tag_name: ${{!startsWith(github.ref, 'refs/tags/') && 'nightly' || null}}
429416
append_body: true
430-
# TODO add instructions about using cosign to verify binary artifact
431417
body: |
432418
<hr />
433419
434-
### Check binary attestation at [here](${{ steps.attest.outputs.attestation-url }})
420+
## Check binary attestation at [here](${{ steps.attest.outputs.attestation-url }})

Dockerfile.build

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ ENV DEBIAN_FRONTEND="noninteractive" \
1414
TERM=xterm-256color
1515
# With zig, we only need libclang and make
1616
RUN \
17-
--mount=type=cache,target=/var/cache/apt,sharing=locked \
18-
--mount=type=cache,target=/var/lib/apt,sharing=locked \
19-
rm -f /etc/apt/apt.conf.d/docker-clean && \
20-
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
21-
apt-get update && \
22-
apt-get install -yq --no-install-recommends curl jq xz-utils make libclang-16-dev
17+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
18+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
19+
rm -f /etc/apt/apt.conf.d/docker-clean && \
20+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
21+
apt-get update && \
22+
apt-get install -yq --no-install-recommends curl jq xz-utils make libclang-16-dev
2323
# Install zig
24-
RUN \
25-
ZIG_VERSION=$(curl --retry 5 -sL "https://api.github.com/repos/ziglang/zig/releases/latest" | jq -r '.tag_name') && \
24+
RUN ZIG_VERSION=$(curl --retry 5 -sL "https://api.github.com/repos/ziglang/zig/releases/latest" | jq -r '.tag_name') && \
2625
[ ! -z "$ZIG_VERSION" ] && \
2726
curl --retry 5 -Ls "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | tar -J -x -C /usr/local && \
2827
ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
2928
# Install cargo-binstall
3029
RUN curl --retry 5 -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
30+
# Install FoundationDB
31+
# TODO According to https://github.com/apple/foundationdb/issues/11448#issuecomment-2417766293
32+
# Once FoundationDB v7.3.53 gets released, we should be able to build the aarch64-unknown-linux-gnu target.
33+
# The last command is for future build use, so if you are building on a native arm64 device, please use docker qemu.
34+
RUN curl --retry 5 -Lso /usr/lib/libfdb_c.so "$(curl --retry 5 -Ls 'https://api.github.com/repos/apple/foundationdb/releases' | jq --arg arch "$(uname -m)" -r '.[] | select(.prerelease == false) | .assets[] | select(.name | test("libfdb_c." + $arch + ".so")) | .browser_download_url' | head -n1)"
3135
# Install cargo-chef & sccache & cargo-zigbuild
3236
RUN cargo binstall --no-confirm cargo-chef sccache cargo-zigbuild
3337

@@ -51,31 +55,24 @@ ARG BUILD_ENV
5155
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
5256
# Install toolchain and specify some env variables
5357
RUN \
54-
rustup set profile minimal && \
55-
rustup target add ${TARGET} && \
56-
mkdir -p artifact && \
57-
touch /env-cargo && \
58-
if [ ! -z "${BUILD_ENV}" ]; then \
59-
echo "export ${BUILD_ENV}" >> /env-cargo; \
60-
echo "Setting up ${BUILD_ENV}"; \
61-
fi && \
62-
if [[ "${TARGET}" == *gnu ]]; then \
63-
echo "export FDB_ARCH=${TARGET%%-*}" >> /env-cargo; \
64-
fi
65-
# Install FoundationDB
66-
RUN \
67-
source /env-cargo && \
68-
if [ ! -z "${FDB_ARCH}" ]; then \
69-
curl --retry 5 -Lso /usr/lib/libfdb_c.so "$(curl --retry 5 -Ls 'https://api.github.com/repos/apple/foundationdb/releases' | jq --arg FDB_ARCH "$FDB_ARCH" -r '.[] | select(.prerelease == false) | .assets[] | select(.name | test("libfdb_c." + $FDB_ARCH + ".so")) | .browser_download_url' | head -n1)"; \
70-
fi
58+
rustup set profile minimal && \
59+
rustup target add ${TARGET} && \
60+
mkdir -p artifact && \
61+
touch /env-cargo && \
62+
if [ ! -z "${BUILD_ENV}" ]; then \
63+
echo "export ${BUILD_ENV}" >> /env-cargo; \
64+
echo "Setting up ${BUILD_ENV}"; \
65+
fi
7166
# Cargo-chef Cache layer
7267
RUN \
7368
--mount=type=secret,id=ACTIONS_CACHE_URL,env=ACTIONS_CACHE_URL \
7469
--mount=type=secret,id=ACTIONS_RUNTIME_TOKEN,env=ACTIONS_RUNTIME_TOKEN \
7570
--mount=type=cache,target=/usr/local/cargo/registry \
7671
--mount=type=cache,target=/usr/local/cargo/git \
72+
# TODO According to https://github.com/apple/foundationdb/issues/11448#issuecomment-2417766293
73+
# Once FoundationDB v7.3.53 gets released, we should be able to build the aarch64-unknown-linux-gnu target.
7774
source /env-cargo && \
78-
if [ ! -z "${FDB_ARCH}" ]; then \
75+
if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ]; then \
7976
RUSTFLAGS="-L /usr/lib" cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise"; \
8077
fi
8178
RUN \
@@ -90,14 +87,16 @@ RUN \
9087
COPY . .
9188
ENV RUSTC_WRAPPER="sccache" \
9289
SCCACHE_GHA_ENABLED=true
93-
# Build FoundationDB version
90+
# Build foundationdb version
9491
RUN \
9592
--mount=type=secret,id=ACTIONS_CACHE_URL,env=ACTIONS_CACHE_URL \
9693
--mount=type=secret,id=ACTIONS_RUNTIME_TOKEN,env=ACTIONS_RUNTIME_TOKEN \
9794
--mount=type=cache,target=/usr/local/cargo/registry \
9895
--mount=type=cache,target=/usr/local/cargo/git \
96+
# TODO According to https://github.com/apple/foundationdb/issues/11448#issuecomment-2417766293
97+
# Once FoundationDB v7.3.53 gets released, we should be able to build the aarch64-unknown-linux-gnu target.
9998
source /env-cargo && \
100-
if [ ! -z "${FDB_ARCH}" ]; then \
99+
if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ]; then \
101100
RUSTFLAGS="-L /usr/lib" cargo zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise"; \
102101
mv /app/target/${TARGET}/release/stalwart-mail /app/artifact/stalwart-mail-foundationdb; \
103102
fi

crates/store/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ utils = { path = "../utils" }
99
nlp = { path = "../nlp" }
1010
trc = { path = "../trc" }
1111
rocksdb = { version = "0.23", optional = true, features = ["multi-threaded-cf"] }
12-
foundationdb = { version = "0.9.2", features = ["embedded-fdb-include", "fdb-7_3"], optional = true }
12+
foundationdb = { version = "0.9.0", features = ["embedded-fdb-include", "fdb-7_1"], optional = true }
1313
rusqlite = { version = "0.32", features = ["bundled"], optional = true }
1414
rust-s3 = { version = "=0.35.0-alpha.2", default-features = false, features = ["tokio-rustls-tls", "no-verify-ssl"], optional = true }
1515
azure_core = { version = "0.21.0", optional = true }

0 commit comments

Comments
 (0)