Skip to content

Commit 474e954

Browse files
committed
chore: Update bootstrap daemon hash for release.
Also add `--release` flag to the update script so it can easily patch the version change in to have a local reproducible build.
1 parent bdb86a5 commit 474e954

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/release.patch

other/bootstrap_daemon/docker/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RUN ["apk", "--no-cache", "add",\
1212
"linux-headers",\
1313
"musl-dev",\
1414
"ninja",\
15+
"patch",\
1516
"python3"]
1617

1718
WORKDIR /src/c-toxcore
@@ -32,6 +33,12 @@ COPY toxencryptsave toxencryptsave
3233
COPY third_party third_party
3334
COPY CMakeLists.txt so.version ./
3435
COPY other/bootstrap_daemon/CMakeLists.txt other/bootstrap_daemon/CMakeLists.txt
36+
# Copy the patch if it exists (glob prevents failure if missing)
37+
COPY other/bootstrap_daemon/docker/release.patc[h] other/bootstrap_daemon/docker/
38+
39+
RUN if [ -f other/bootstrap_daemon/docker/release.patch ] && [ -s other/bootstrap_daemon/docker/release.patch ]; then \
40+
patch -p1 < other/bootstrap_daemon/docker/release.patch; \
41+
fi
3542

3643
RUN CC=clang cmake -B_build -H. \
3744
-GNinja \

other/bootstrap_daemon/docker/Dockerfile.dockerignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
# Very selectively add files to the image, because we may have random stuff
22
# lying around. In particular, we don't need to rebuild the docker image when
33
# toxav changes or the Dockerfile changes down from the build.
4+
#
5+
# LC_ALL=C sort -u
46
**/*
7+
!CMakeLists.txt
58
!cmake/*
9+
!other/DHT_bootstrap.c
10+
!other/bootstrap_daemon/CMakeLists.txt
611
!other/bootstrap_daemon/bash-completion/*
712
!other/bootstrap_daemon/docker/get-nodes.py
13+
!other/bootstrap_daemon/docker/release.patch
814
!other/bootstrap_daemon/docker/tox-bootstrapd.sha256
915
!other/bootstrap_daemon/src/*
1016
!other/bootstrap_daemon/tox-bootstrapd.conf
1117
!other/bootstrap_node_packets.[ch]
12-
!other/DHT_bootstrap.c
1318
!other/pkgconfig/*
1419
!other/rpm/*
20+
!so.version
21+
!testing/CMakeLists.txt
1522
!testing/misc_tools.[ch]
23+
!third_party/cmp/cmp.[ch]
1624
!toxcore/**/*
1725
!toxencryptsave/**/*
18-
!third_party/cmp/cmp.[ch]
19-
!CMakeLists.txt
20-
!so.version
21-
!other/bootstrap_daemon/CMakeLists.txt
22-
!testing/CMakeLists.txt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a586163b323c1ca71e2ea138f0c45cb5df03217cc391e0c1439d9cd1200816f2 /usr/local/bin/tox-bootstrapd
1+
070fff35be4775cf94b1a3036590f455d8e0e394128f22a15d5b1ed61566b61f /usr/local/bin/tox-bootstrapd

other/bootstrap_daemon/docker/update-sha256

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
set -eux
44

5+
PATCH_FILE="other/bootstrap_daemon/docker/release.patch"
6+
trap 'rm -f "$PATCH_FILE"' EXIT
7+
8+
RELEASE=0
9+
while [[ $# -gt 0 ]]; do
10+
case $1 in
11+
--release)
12+
RELEASE=1
13+
shift
14+
;;
15+
*)
16+
echo "Unknown option $1"
17+
exit 1
18+
;;
19+
esac
20+
done
21+
22+
if [[ $RELEASE -eq 1 ]]; then
23+
git fetch upstream
24+
RELEASE_BRANCH=$(git branch -r | grep "upstream/release/" | sort -V | tail -n1 | sed 's/^[[:space:]]*//' || true)
25+
if [[ -n "$RELEASE_BRANCH" ]]; then
26+
echo "Generating release patch from $RELEASE_BRANCH"
27+
git diff "HEAD..$RELEASE_BRANCH" -- toxcore/tox.h CMakeLists.txt >"$PATCH_FILE"
28+
else
29+
echo "No release branch found in upstream"
30+
fi
31+
fi
32+
533
docker_build() {
634
DOCKER_BUILDKIT=1 docker build --progress=plain -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node .
735
}

0 commit comments

Comments
 (0)