Skip to content

Commit 311d7ea

Browse files
committed
Remove post-build patching and reproducible builds
This is an effort to avoid suspicious byte patterns. With timestamped code signing reproducible builds are obsolete.
1 parent 95c334c commit 311d7ea

6 files changed

Lines changed: 3 additions & 307 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ jobs:
7979
key: resources-${{ github.run_id }}-${{ github.run_attempt }}
8080
- name: Install NASM
8181
uses: ilammy/setup-nasm@v1
82-
- name: Download GoDevTools and Ducible
82+
- name: Download GoDevTools
8383
run: |
8484
Invoke-WebRequest http://godevtool.com/Golink.zip -OutFile golink.zip
8585
Invoke-WebRequest http://godevtool.com/Gorc.zip -OutFile gorc.zip
86-
Invoke-WebRequest https://github.com/jasonwhite/ducible/releases/download/v1.2.2/ducible-windows-Win32-Release.zip -OutFile ducible.zip
8786
unzip golink.zip GoLink.exe
8887
unzip gorc.zip GoRC.exe
89-
unzip ducible.zip ducible.exe
9088
- name: Assemble Ninja.dll
9189
shell: cmd
9290
run: make build/Ninja.dll

Makefile

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ c := \xA9
2828
include $(META)
2929
export VERSION := $(VBASE).$(VMAJOR).$(VMINOR)
3030
export PATH := $(subst ;;,;,$(PATH);$(shell getGnuWin32Path))
31-
export BUILD_TIME:=$(shell getCommitTime)
32-
export BUILD_TIME_UNIX:=$(shell getCommitTime unix)
33-
ifneq ($(BUILD_TIME),)
34-
$(info Build time is set to $(BUILD_TIME))
35-
else
36-
$(info Warning: No build time is set. Build will not be reproducible!)
37-
endif
3831

3932
# Directories
4033
BUILDDIR := build/
@@ -67,12 +60,10 @@ RCCOMP := gorc
6760
GETBINLIST := $(call FixPath,./getBinList)$(SCRIPTEXT)
6861
EXTRACTSYM := $(call FixPath,./extractSymbols)$(SCRIPTEXT)
6962
VERIFYSIZE := $(call FixPath,./verifySize)$(SCRIPTEXT)
70-
PATCHREPRO := $(call FixPath,./patchBuildBytes)$(SCRIPTEXT)
71-
SETFILETIME := $(call FixPath,./setTimestamps)$(SCRIPTEXT)
7263
CODESIGN := $(call FixPath,./signCode)$(SCRIPTEXT)
7364

7465
FLAGS_C := -I$(SRCDIR)
75-
FLAGS_A := -f win32 --reproducible $(FLAGS_C)
66+
FLAGS_A := -f win32 $(FLAGS_C)
7667
FLAGS_L := /dll /entry DllMain /largeaddressaware /nxcompat /dynamicbase /ni
7768
FLAGS_RC := /ni
7869
FLAGS_N := -X"SetCompress force" -X"SetCompressor /FINAL /SOLID lzma" -X"SetCompressorDictSize 8" -X"SetDatablockOptimize on"
@@ -241,19 +232,16 @@ relink : cleanDLL all
241232

242233
# Build dependencies
243234
$(SETUP) : $(LOADER) $(TARGET) LICENSE $(SETUPSCR) $(SETUPINI)
244-
$(SETFILETIME) $(call FixPath,$^)
245235
$(NSIS) $(FLAGS_N) $(SETUPSCR)
246236

247237
$(LOADER) : $(LOADER_OBJ) $(TARGET)
248238
@$(call mkdir,$(BUILDDIR))
249239
$(LINKER) $(FLAGS_L) /fo $(call FixPath,$@) $^ $(LOADER_SYSDEP)
250-
$(PATCHREPRO) $(call FixPath,$@)
251240
$(CODESIGN) $(call FixPath,$@)
252241

253242
$(TARGET) : $(OBJ) $(RSC)
254243
@$(call mkdir,$(BUILDDIR))
255244
$(LINKER) $(FLAGS_L) /fo $(call FixPath,$@) $^ $(SYSDEP)
256-
$(PATCHREPRO) $(call FixPath,$@)
257245
$(CODESIGN) $(call FixPath,$@)
258246

259247
$(LOADER_OBJ) : $(LOADER_SRC)
@@ -264,10 +252,8 @@ $(OBJ) : $(SRCDLL) $(CONTENT) $(IKLG)
264252
@$(call mkdir,$(BINDIR))
265253
$(NASM) $(FLAGS_A) -o $@ $<
266254

267-
# Overwrite MemoryFlags (0x36 WORD) in the RES Header which sometimes varies across builds on different machines
268255
$(RSC) : $(RC)
269256
$(RCCOMP) $(FLAGS_RC) /fo $@ /r $^
270-
ECHO -n 0000 | xxd -r -p | dd of=$@ bs=1 seek=54 count=2 conv=notrunc status=none
271257

272258
$(CONTENT) : $(BINARIES_G1) $(BINARIES_G112) $(BINARIES_G130) $(BINARIES_G2)
273259
$(GETBINLIST) $(call FixPath,$@) $(SRCDIR)

getCommitTime.bat

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

patchBuildBytes.bat

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

setTimestamps.bat

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

src/inc/macros.inc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
%defstr NINJA_WEBSITE %!NINJA_WEBSITE
1515
%define IKARUS_VERSION %!IKARUS_VERSION
1616
%define LEGO_N_VERSION %!LEGO_N_VERSION
17-
%ifenv BUILD_TIME
18-
%defstr BUILD_TIME %!BUILD_TIME
19-
%else
20-
%strcat BUILD_TIME __UTC_DATE__, ' ',__UTC_TIME__
21-
%endif
17+
%strcat BUILD_TIME __UTC_DATE__, ' ',__UTC_TIME__
2218

2319
%define MAX_VDF_TIME 0x7F9FBF7D ; 2043-12-23 23:59:58
2420
%if GOTHIC_BASE_VERSION == 1

0 commit comments

Comments
 (0)