mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
CPP-31989 IJI-971 checking executable permissions for .snap
GitOrigin-RevId: c3407564db904a7c915f72a0df8614d4f91723a0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
afe509dba1
commit
bfebcb4443
@@ -10,6 +10,7 @@ RUN apt-get update && \
|
|||||||
zip \
|
zip \
|
||||||
unzip \
|
unzip \
|
||||||
libgl1-mesa-glx \
|
libgl1-mesa-glx \
|
||||||
|
squashfs-tools \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# Maven cache to reuse
|
# Maven cache to reuse
|
||||||
VOLUME /root/.m2
|
VOLUME /root/.m2
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ fun moveFile(source: Path, target: Path) {
|
|||||||
Files.move(source, target)
|
Files.move(source, target)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun moveFileToDir(file: Path, targetDir: Path) {
|
fun moveFileToDir(file: Path, targetDir: Path): Path {
|
||||||
Files.createDirectories(targetDir)
|
Files.createDirectories(targetDir)
|
||||||
Files.move(file, targetDir.resolve(file.fileName))
|
return Files.move(file, targetDir.resolve(file.fileName))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun copyFile(file: Path, target: Path) {
|
fun copyFile(file: Path, target: Path) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.nio.file.Path
|
|||||||
import java.nio.file.StandardCopyOption
|
import java.nio.file.StandardCopyOption
|
||||||
import java.nio.file.attribute.PosixFilePermissions
|
import java.nio.file.attribute.PosixFilePermissions
|
||||||
import kotlin.io.path.name
|
import kotlin.io.path.name
|
||||||
|
import kotlin.io.path.nameWithoutExtension
|
||||||
import kotlin.time.Duration.Companion.minutes
|
import kotlin.time.Duration.Companion.minutes
|
||||||
|
|
||||||
class LinuxDistributionBuilder(override val context: BuildContext,
|
class LinuxDistributionBuilder(override val context: BuildContext,
|
||||||
@@ -282,8 +283,9 @@ class LinuxDistributionBuilder(override val context: BuildContext,
|
|||||||
workingDir = snapDir,
|
workingDir = snapDir,
|
||||||
timeout = context.options.snapDockerBuildTimeoutMin.minutes,
|
timeout = context.options.snapDockerBuildTimeoutMin.minutes,
|
||||||
)
|
)
|
||||||
moveFileToDir(resultDir.resolve(snapArtifact), context.paths.artifactDir)
|
val snapArtifactPath = moveFileToDir(resultDir.resolve(snapArtifact), context.paths.artifactDir)
|
||||||
context.notifyArtifactBuilt(context.paths.artifactDir.resolve(snapArtifact))
|
context.notifyArtifactBuilt(snapArtifactPath)
|
||||||
|
checkExecutablePermissions(unSquashSnap(snapArtifactPath), root = "", includeRuntime = true, arch = arch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,6 +334,15 @@ class LinuxDistributionBuilder(override val context: BuildContext,
|
|||||||
|
|
||||||
copyInspectScript(context, distBinDir)
|
copyInspectScript(context, distBinDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun unSquashSnap(snap: Path): Path {
|
||||||
|
val unSquashed = context.paths.tempDir.resolve("unSquashed-${snap.nameWithoutExtension}")
|
||||||
|
NioFiles.deleteRecursively(unSquashed)
|
||||||
|
Files.createDirectories(unSquashed)
|
||||||
|
runProcess(listOf("unsquashfs", "$snap"), workingDir = unSquashed, inheritOut = true)
|
||||||
|
return unSquashed.resolve("squashfs-root")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val NO_JBR_SUFFIX = "-no-jbr"
|
private const val NO_JBR_SUFFIX = "-no-jbr"
|
||||||
|
|||||||
Reference in New Issue
Block a user