DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.88k stars 251 forks source link

Stop storing mtime in hog files #606

Closed bmwiedemann closed 1 month ago

bmwiedemann commented 1 month ago

This allows for reproducible builds.

I could not even find where the timestamp value is used. Maybe it is write-only-data.

Pull Request Type

Description

While working on reproducible builds for openSUSE (sponsored by the NLnet NGI0 fund), I found that our descent3 package varied in every build because hog files embedded the current build time.

Also I could not even find where the timestamp value is used. Maybe it is write-only-data.

Related Issues

N/A

Screenshots (if applicable)

Without this patch, I got such a diff:

--- old /usr/share/descent3/d3-linux.hog (hex)
+++ new /usr/share/descent3/d3-linux.hog (hex)
@@ -1,19 +1,19 @@
 00000040  ff ff ff ff 41 49 47 61  6d 65 2e 73 6f 00 00 00  |....AIGame.so...|
 00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000060  00 00 00 00 00 00 00 00  00 00 00 00 60 65 02 00  |............`e..|
-00000070  5e 77 f1 66 61 69 67 61  6d 65 2e 73 74 72 00 00  |^w.faigame.str..|
+00000070  d3 e0 34 85 61 69 67 61  6d 65 2e 73 74 72 00 00  |..4.aigame.str..|
 00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000090  00 00 00 00 00 00 00 00  00 00 00 00 61 1c 00 00  |............a...|
 000000a0  85 dd e2 66 61 69 67 61  6d 65 32 2e 73 6f 00 00  |...faigame2.so..|
 000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 000000c0  00 00 00 00 00 00 00 00  00 00 00 00 c0 98 00 00  |................|
-000000d0  59 77 f1 66 41 49 47 61  6d 65 33 2e 73 6f 00 00  |Yw.fAIGame3.so..|
+000000d0  c8 e0 34 85 41 49 47 61  6d 65 33 2e 73 6f 00 00  |..4.AIGame3.so..|
 000000e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 000000f0  00 00 00 00 00 00 00 00  00 00 00 00 38 52 01 00  |............8R..|
-00000100  5c 77 f1 66 61 69 67 61  6d 65 34 2e 73 6f 00 00  |\w.faigame4.so..|
+00000100  cb e0 34 85 61 69 67 61  6d 65 34 2e 73 6f 00 00  |..4.aigame4.so..|
 00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 
 00000120  00 00 00 00 00 00 00 00  00 00 00 00 68 a3 00 00  |............h...| 
-00000130  5b 77 f1 66 41 49 47 41  4d 45 69 2e 53 54 52 00  |[w.fAIGAMEi.STR.|
+00000130  ce e0 34 85 41 49 47 41  4d 45 69 2e 53 54 52 00  |..4.AIGAMEi.STR.|
 00000140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000150  00 00 00 00 00 00 00 00  00 00 00 00 12 51 00 00  |.............Q..|
 00000160  85 dd e2 66 41 6e 61 72  63 68 79 2e 73 74 72 00  |...fAnarchy.str.|
@@ -25,9 +25,9 @@
 000001c0  85 dd e2 66 62 61 72 6e  65 79 2e 73 6f 00 00 00  |...fbarney.so...|
 000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 000001e0  00 00 00 00 00 00 00 00  00 00 00 00 30 6d 00 00  |............0m..|
-000001f0  5f 77 f1 66 42 61 74 74  65 72 69 65 73 49 6e 63  |_w.fBatteriesInc|
+000001f0  d5 e0 34 85 42 61 74 74  65 72 69 65 73 49 6e 63  |..4.BatteriesInc|
 00000200  6c 75 64 65 64 2e 73 6f  00 00 00 00 00 00 00 00  |luded.so........|
 00000210  00 00 00 00 00 00 00 00  00 00 00 00 78 ea 00 00  |............x...|
-00000220  60 77 f1 66 42 6f 73 73  43 61 6d 65 72 61 2e 73  |`w.fBossCamera.s|
+00000220  d7 e0 34 85 42 6f 73 73  43 61 6d 65 72 61 2e 73  |..4.BossCamera.s|
 00000230  6f 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |o...............|

--- old /usr/share/descent3/online/Direct TCP~IP.d3c (hex)
+++ new /usr/share/descent3/online/Direct TCP~IP.d3c (hex)
@@ -1,7 +1,7 @@
 00000040  ff ff ff ff 44 69 72 65  63 74 20 54 43 50 7e 49  |....Direct TCP~I|
 00000050  50 2e 73 6f 00 00 00 00  00 00 00 00 00 00 00 00  |P.so............|
 00000060  00 00 00 00 00 00 00 00  00 00 00 00 78 01 03 00  |............x...|
-00000070  9e 77 f1 66 6c 61 6e 63  6c 69 65 6e 74 2e 73 74  |.w.flanclient.st|
+00000070  46 e1 34 85 6c 61 6e 63  6c 69 65 6e 74 2e 73 74  |F.4.lanclient.st|
 00000080  72 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |r...............|
 00000090  00 00 00 00 00 00 00 00  00 00 00 00 e4 0a 00 00  |................|
 000000a0  85 dd e2 66 7f 45 4c 46  02 01 01 00 00 00 00 00  |...f.ELF........|

--- old /usr/share/descent3/online/Parallax Online.d3c (hex)
+++ new /usr/share/descent3/online/Parallax Online.d3c (hex)
@@ -1,6 +1,6 @@
 00000080  69 6e 65 2e 73 6f 00 00  00 00 00 00 00 00 00 00  |ine.so..........|
 00000090  00 00 00 00 00 00 00 00  00 00 00 00 c8 0e 04 00  |................|
-000000a0  9f 77 f1 66 70 78 6f 67  61 6d 65 2e 6f 67 66 00  |.w.fpxogame.ogf.|
+000000a0  51 e1 34 85 70 78 6f 67  61 6d 65 2e 6f 67 66 00  |Q.4.pxogame.ogf.|
 000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 000000c0  00 00 00 00 00 00 00 00  00 00 00 00 03 c3 01 00  |................|
 000000d0  85 dd e2 66 70 78 6f 6d  61 69 6e 2e 6f 67 66 00  |...fpxomain.ogf.|

Checklist

Additional Comments

winterheart commented 1 month ago

mtime indeed is unused in runtime, so I guess we can get rid of it for reproducible builds.