Skip to content

Commit 75e2698

Browse files
authored
Reproducible builds: ensure unix permissions are reproducible (#2819)
Zip and tar files contain the unix file/directory permissions for the included zip/tar entries. The "default" values for those can differ depending on the platform those are built on. This change ensures `755` for directories and owner/group/other=read+write for files. The "executable" bit isn't forcefully set in case the archived file _is_ an executable.
1 parent a004aae commit 75e2698

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build-logic/src/main/kotlin/polaris-reproducible.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,15 @@
2222
tasks.withType<AbstractArchiveTask>().configureEach {
2323
isPreserveFileTimestamps = false
2424
isReproducibleFileOrder = true
25+
26+
dirPermissions { unix("755") }
27+
filePermissions {
28+
// do not force the "execute" bit in case the file _is_ executable
29+
user.read = true
30+
user.write = true
31+
group.read = true
32+
group.write = false
33+
other.read = true
34+
other.write = false
35+
}
2536
}

0 commit comments

Comments
 (0)