Fix file permissions affecting build reproducibility
File permissions affect reproducibility on different platforms and system settings (umask, etc.) KTI-1094
This commit is contained in:
committed by
Space Team
parent
2a80e70860
commit
c34ae23465
@@ -825,11 +825,6 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
fun CopySpec.setExecutablePermissions() {
|
||||
filesMatching("**/bin/*") { mode = 0b111101101 }
|
||||
filesMatching("**/bin/*.bat") { mode = 0b110100100 }
|
||||
}
|
||||
|
||||
val zipCompiler by task<Zip> {
|
||||
dependsOn(dist)
|
||||
destinationDirectory.set(file(distDir))
|
||||
@@ -837,7 +832,6 @@ val zipCompiler by task<Zip> {
|
||||
|
||||
from(distKotlinHomeDir)
|
||||
into("kotlinc")
|
||||
setExecutablePermissions()
|
||||
|
||||
doLast {
|
||||
logger.lifecycle("Compiler artifacts packed to ${archiveFile.get().asFile.absolutePath}")
|
||||
|
||||
@@ -236,6 +236,12 @@ fun Project.configureArtifacts() {
|
||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
val `rw-r--r--` = 0b110100100
|
||||
val `rwxr-xr-x` = 0b111101101
|
||||
fileMode = `rw-r--r--`
|
||||
dirMode = `rwxr-xr-x`
|
||||
filesMatching("**/bin/*") { mode = `rwxr-xr-x` }
|
||||
filesMatching("**/bin/*.bat") { mode = `rw-r--r--` }
|
||||
}
|
||||
|
||||
normalization {
|
||||
|
||||
Reference in New Issue
Block a user