loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[CHORE] Support reproducible builds' (#4970) from gusted/forgejo-reproducible-builds into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4970
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Radosław Piliszek <radek@piliszek.it>

Gusted 5b81cab0 9111eb34

+22 -1
+1 -1
Dockerfile
··· 36 36 RUN make clean 37 37 RUN make frontend 38 38 RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini 39 - RUN make RELEASE_VERSION=$RELEASE_VERSION go-check generate-backend static-executable && xx-verify gitea 39 + RUN make RELEASE_VERSION=$RELEASE_VERSION GOFLAGS="-trimpath" LDFLAGS="-buildid=" go-check generate-backend static-executable && xx-verify gitea 40 40 41 41 # Copy local files 42 42 COPY docker/root /tmp/local
+21
Makefile
··· 268 268 @echo " - tidy run go mod tidy" 269 269 @echo " - test[\#TestSpecificName] run unit test" 270 270 @echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite" 271 + @echo " - reproduce-build\#version build a reproducible binary for the specified release version" 271 272 272 273 ### 273 274 # Check system and environment requirements ··· 889 890 .PHONY: release-docs 890 891 release-docs: | $(DIST_DIRS) docs 891 892 tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs . 893 + 894 + .PHONY: reproduce-build 895 + reproduce-build: 896 + # Start building the Dockerfile with the RELEASE_VERSION tag set. GOPROXY is set 897 + # for convience, because the default of the Dockerfile is `direct` which can be 898 + # quite slow. 899 + @docker build --build-arg="RELEASE_VERSION=$(RELEASE_VERSION)" --build-arg="GOPROXY=$(shell $(GO) env GOPROXY)" --tag "forgejo-reproducibility" . 900 + @id=$$(docker create forgejo-reproducibility); \ 901 + docker cp $$id:/app/gitea/gitea ./forgejo; \ 902 + docker rm -v $$id; \ 903 + docker image rm forgejo-reproducibility:latest 904 + 905 + .PHONY: reproduce-build\#% 906 + reproduce-build\#%: 907 + @git switch -d "$*" 908 + # All the current variables are based on information before the git checkout happened. 909 + # Call the makefile again, so these variables are correct and can be used for building 910 + # a reproducible binary. Always execute git switch -, to go back to the previous branch. 911 + @make reproduce-build; \ 912 + (code=$$?; git switch -; exit $${code}) 892 913 893 914 ### 894 915 # Dependency management