Skip to content

Commit e8e0bfb

Browse files
committed
Revert "feat: Add building and publishing of *.deb packages (#18615)"
This reverts commit fe10c07.
1 parent 17a806c commit e8e0bfb

File tree

8 files changed

+46
-132
lines changed

8 files changed

+46
-132
lines changed

.github/workflows/release-reproducible.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,12 @@ jobs:
4040
username: ${{ github.actor }}
4141
password: ${{ secrets.GITHUB_TOKEN }}
4242

43-
- name: Extract Rust version from Cargo.toml
44-
id: rust_version
45-
run: |
46-
RUST_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "reth") | .rust_version' || echo "1")
47-
echo "RUST_VERSION=$RUST_VERSION" >> $GITHUB_OUTPUT
48-
4943
- name: Build and push reproducible image
5044
uses: docker/build-push-action@v6
5145
with:
5246
context: .
5347
file: ./Dockerfile.reproducible
5448
push: true
55-
build-args: |
56-
RUST_VERSION=${{ steps.rust_version.outputs.RUST_VERSION }}
5749
tags: |
5850
${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}:${{ needs.extract-version.outputs.VERSION }}
5951
${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}:latest

.github/workflows/release.yml

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ env:
2222
CARGO_TERM_COLOR: always
2323
DOCKER_IMAGE_NAME_URL: https://ghcr.io/${{ github.repository_owner }}/reth
2424
DOCKER_OP_IMAGE_NAME_URL: https://ghcr.io/${{ github.repository_owner }}/op-reth
25-
DEB_SUPPORTED_TARGETS: x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu riscv64gc-unknown-linux-gnu
2625

2726
jobs:
2827
dry-run:
@@ -74,10 +73,6 @@ jobs:
7473
os: ubuntu-24.04
7574
profile: maxperf
7675
allow_fail: false
77-
- target: x86_64-unknown-linux-gnu
78-
os: ubuntu-24.04
79-
profile: reproducible
80-
allow_fail: false
8176
- target: aarch64-unknown-linux-gnu
8277
os: ubuntu-24.04
8378
profile: maxperf
@@ -124,34 +119,12 @@ jobs:
124119
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
125120
126121
- name: Build Reth
127-
if: ${{ !(matrix.build.binary == 'op-reth' && matrix.configs.profile == 'reproducible') }}
128-
run: |
129-
if [[ "${{ matrix.build.binary }}" == "reth" && "${{ matrix.configs.profile }}" == "reproducible" ]]; then
130-
make build-reth-reproducible
131-
else
132-
make PROFILE=${{ matrix.configs.profile }} ${{ matrix.build.command }}-${{ matrix.configs.target }}
133-
fi
134-
135-
- name: Build Reth deb package
136-
if: ${{ matrix.build.binary == 'reth' && contains(env.DEB_SUPPORTED_TARGETS, matrix.configs.target) }}
137-
run: make build-deb-${{ matrix.configs.target }} PROFILE=${{ matrix.configs.profile }} VERSION=${{ needs.extract-version.outputs.VERSION }}
138-
122+
run: make PROFILE=${{ matrix.configs.profile }} ${{ matrix.build.command }}-${{ matrix.configs.target }}
139123
- name: Move binary
140124
run: |
141125
mkdir artifacts
142126
[[ "${{ matrix.configs.target }}" == *windows* ]] && ext=".exe"
143-
144-
# Handle reproducible builds which always target x86_64-unknown-linux-gnu
145-
if [[ "${{ matrix.build.binary }}" == "reth" && "${{ matrix.configs.profile }}" == "reproducible" ]]; then
146-
mv "target/x86_64-unknown-linux-gnu/${{ matrix.configs.profile }}/${{ matrix.build.binary }}${ext}" ./artifacts
147-
else
148-
mv "target/${{ matrix.configs.target }}/${{ matrix.configs.profile }}/${{ matrix.build.binary }}${ext}" ./artifacts
149-
fi
150-
151-
# Move deb packages if they exist
152-
if [[ "${{ matrix.build.binary }}" == "reth" && "${{ env.DEB_SUPPORTED_TARGETS }}" == *"${{ matrix.configs.target }}"* ]]; then
153-
mv "target/${{ matrix.configs.target }}/${{ matrix.configs.profile }}/${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb" ./artifacts
154-
fi
127+
mv "target/${{ matrix.configs.target }}/${{ matrix.configs.profile }}/${{ matrix.build.binary }}${ext}" ./artifacts
155128
156129
- name: Configure GPG and create artifacts
157130
env:
@@ -161,12 +134,9 @@ jobs:
161134
export GPG_TTY=$(tty)
162135
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --batch --import
163136
cd artifacts
164-
tar -czf ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz ${{ matrix.build.binary }}*[!.deb]
137+
tar -czf ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz ${{ matrix.build.binary }}*
165138
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz
166-
if [[ -f "${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb" ]]; then
167-
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb
168-
fi
169-
mv *tar.gz* *.deb* ..
139+
mv *tar.gz* ..
170140
shell: bash
171141

172142
- name: Upload artifact
@@ -183,20 +153,6 @@ jobs:
183153
name: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz.asc
184154
path: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz.asc
185155

186-
- name: Upload deb package
187-
if: ${{ github.event.inputs.dry_run != 'true' && matrix.build.binary == 'reth' && contains(env.DEB_SUPPORTED_TARGETS, matrix.configs.target) }}
188-
uses: actions/upload-artifact@v4
189-
with:
190-
name: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb
191-
path: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb
192-
193-
- name: Upload deb package signature
194-
if: ${{ github.event.inputs.dry_run != 'true' && matrix.build.binary == 'reth' && contains(env.DEB_SUPPORTED_TARGETS, matrix.configs.target) }}
195-
uses: actions/upload-artifact@v4
196-
with:
197-
name: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb.asc
198-
path: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}-${{ matrix.configs.profile }}.deb.asc
199-
200156
draft-release:
201157
name: draft release
202158
runs-on: ubuntu-latest

.github/workflows/reproducible-build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,24 @@ jobs:
1515
- uses: dtolnay/rust-toolchain@stable
1616
with:
1717
target: x86_64-unknown-linux-gnu
18+
- name: Install cross main
19+
run: |
20+
cargo install cross --git https://github.com/cross-rs/cross
1821
- name: Install cargo-cache
1922
run: |
2023
cargo install cargo-cache
24+
- uses: Swatinem/rust-cache@v2
25+
with:
26+
cache-on-failure: true
2127
- name: Build Reth
2228
run: |
23-
make build-reth-reproducible
24-
mv target/x86_64-unknown-linux-gnu/reproducible/reth reth-build-1
29+
make build-reproducible
30+
mv target/x86_64-unknown-linux-gnu/release/reth reth-build-1
2531
- name: Clean cache
2632
run: make clean && cargo cache -a
2733
- name: Build Reth again
2834
run: |
29-
make build-reth-reproducible
30-
mv target/x86_64-unknown-linux-gnu/reproducible/reth reth-build-2
35+
make build-reproducible
36+
mv target/x86_64-unknown-linux-gnu/release/reth reth-build-2
3137
- name: Compare binaries
3238
run: cmp reth-build-1 reth-build-2

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,6 @@ inherits = "release"
325325
lto = "fat"
326326
codegen-units = 1
327327

328-
[profile.reproducible]
329-
inherits = "release"
330-
panic = "abort"
331-
codegen-units = 1
332-
incremental = false
333-
334328
[workspace.dependencies]
335329
# reth
336330
op-reth = { path = "crates/optimism/bin" }

Dockerfile.reproducible

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
ARG RUST_VERSION=1
1+
# Use the Rust 1.88 image based on Debian Bookworm
2+
FROM rust:1.88-bookworm AS builder
23

3-
FROM rust:$RUST_VERSION-bookworm AS builder
4-
5-
RUN apt-get update && apt-get install -y \
6-
git \
7-
libclang-dev=1:14.0-55.7~deb12u1
4+
# Install specific version of libclang-dev
5+
RUN apt-get update && apt-get install -y libclang-dev=1:14.0-55.7~deb12u1
86

97
# Copy the project to the container
108
COPY ./ /app
119
WORKDIR /app
1210

13-
RUN make build-reth-reproducible
14-
RUN mv /app/target/x86_64-unknown-linux-gnu/reproducible/reth /reth
11+
# Build the project with the reproducible settings
12+
RUN make build-reproducible
13+
14+
RUN mv /app/target/x86_64-unknown-linux-gnu/release/reth /reth
1515

1616
# Create a minimal final image with just the binary
1717
FROM gcr.io/distroless/cc-debian12:nonroot-6755e21ccd99ddead6edc8106ba03888cbeed41a

Makefile

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,34 @@ install-op: ## Build and install the op-reth binary under `$(CARGO_HOME)/bin`.
6464
build: ## Build the reth binary into `target` directory.
6565
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"
6666

67-
.PHONY: build-reth
68-
build-reth: ## Build the reth binary (alias for build target).
69-
$(MAKE) build
70-
7167
# Environment variables for reproducible builds
68+
# Initialize RUSTFLAGS
69+
RUST_BUILD_FLAGS =
70+
# Enable static linking to ensure reproducibility across builds
71+
RUST_BUILD_FLAGS += --C target-feature=+crt-static
72+
# Set the linker to use static libgcc to ensure reproducibility across builds
73+
RUST_BUILD_FLAGS += -C link-arg=-static-libgcc
74+
# Remove build ID from the binary to ensure reproducibility across builds
75+
RUST_BUILD_FLAGS += -C link-arg=-Wl,--build-id=none
76+
# Remove metadata hash from symbol names to ensure reproducible builds
77+
RUST_BUILD_FLAGS += -C metadata=''
7278
# Set timestamp from last git commit for reproducible builds
7379
SOURCE_DATE ?= $(shell git log -1 --pretty=%ct)
74-
75-
# `reproducible` only supports reth on x86_64-unknown-linux-gnu
76-
build-%-reproducible:
77-
@if [ "$*" != "reth" ]; then \
78-
echo "Error: Reproducible builds are only supported for reth, not $*"; \
79-
exit 1; \
80-
fi
80+
# Disable incremental compilation to avoid non-deterministic artifacts
81+
CARGO_INCREMENTAL_VAL = 0
82+
# Set C locale for consistent string handling and sorting
83+
LOCALE_VAL = C
84+
# Set UTC timezone for consistent time handling across builds
85+
TZ_VAL = UTC
86+
87+
.PHONY: build-reproducible
88+
build-reproducible: ## Build the reth binary into `target` directory with reproducible builds. Only works for x86_64-unknown-linux-gnu currently
8189
SOURCE_DATE_EPOCH=$(SOURCE_DATE) \
82-
RUSTFLAGS="-C symbol-mangling-version=v0 -C strip=none -C link-arg=-Wl,--build-id=none -C metadata='' --remap-path-prefix $$(pwd)=." \
83-
LC_ALL=C \
84-
TZ=UTC \
85-
cargo build --bin reth --features "$(FEATURES)" --profile "reproducible" --locked --target x86_64-unknown-linux-gnu
90+
RUSTFLAGS="${RUST_BUILD_FLAGS} --remap-path-prefix $$(pwd)=." \
91+
CARGO_INCREMENTAL=${CARGO_INCREMENTAL_VAL} \
92+
LC_ALL=${LOCALE_VAL} \
93+
TZ=${TZ_VAL} \
94+
cargo build --bin reth --features "$(FEATURES)" --profile "release" --locked --target x86_64-unknown-linux-gnu
8695

8796
.PHONY: build-debug
8897
build-debug: ## Build the reth binary into `target/debug` directory.
@@ -146,22 +155,6 @@ op-build-x86_64-apple-darwin:
146155
op-build-aarch64-apple-darwin:
147156
$(MAKE) op-build-native-aarch64-apple-darwin
148157

149-
build-deb-%:
150-
@case "$*" in \
151-
x86_64-unknown-linux-gnu|aarch64-unknown-linux-gnu|riscv64gc-unknown-linux-gnu) \
152-
echo "Building debian package for $*"; \
153-
;; \
154-
*) \
155-
echo "Error: Debian packages are only supported for x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, and riscv64gc-unknown-linux-gnu, not $*"; \
156-
exit 1; \
157-
;; \
158-
esac
159-
cargo install [email protected] --locked
160-
cargo deb --profile $(PROFILE) --no-build --no-dbgsym --no-strip \
161-
--target $* \
162-
$(if $(VERSION),--deb-version "1~$(VERSION)") \
163-
$(if $(VERSION),--output "target/$*/$(PROFILE)/reth-$(VERSION)-$*-$(PROFILE).deb")
164-
165158
# Create a `.tar.gz` containing a binary for a specific target.
166159
define tarball_release_binary
167160
cp $(CARGO_TARGET_DIR)/$(1)/$(PROFILE)/$(2) $(BIN_DIR)/$(2)

bin/reth/Cargo.toml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,6 @@ repository.workspace = true
99
description = "Reth node implementation"
1010
default-run = "reth"
1111

12-
[package.metadata.deb]
13-
maintainer = "reth team"
14-
depends = "$auto"
15-
section = "network"
16-
priority = "optional"
17-
maintainer-scripts = "../../pkg/reth/debian/"
18-
assets = [
19-
"$auto",
20-
["../../README.md", "usr/share/doc/reth/", "644"],
21-
["../../LICENSE-APACHE", "usr/share/doc/reth/", "644"],
22-
["../../LICENSE-MIT", "usr/share/doc/reth/", "644"],
23-
]
24-
systemd-units = { enable = false, start = false, unit-name = "reth", unit-scripts = "../../pkg/reth/debian" }
25-
2612
[lints]
2713
workspace = true
2814

pkg/reth/debian/reth.service

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)