Skip to content

JdepsMerger doesn't support worker_sandboxing #591

@Bencodes

Description

@Bencodes

With worker sandboxing enabled depsMerger#readJarOwnerFromManifest fails with a NoSuchFileException while attempting to read manifest information form JARs that aren't linked to the sandbox.

It can be reproduced by building with --worker_sandboxing=true and the below kt_toolchain:

define_kt_toolchain(
    name = "kotlin_toolchain",
	...
    experimental_reduce_classpath_mode = "KOTLINBUILDER_REDUCED",
    experimental_report_unused_deps = "error",
    experimental_strict_kotlin_deps = "error",
	...
)
SEVERE: ERROR: unexpected exception
java.io.UncheckedIOException
        at io.bazel.kotlin.builder.tasks.jvm.JdepsMerger$Companion.readJarOwnerFromManifest(JdepsMerger.kt:56)
        at io.bazel.kotlin.builder.tasks.jvm.JdepsMerger$Companion.merge(JdepsMerger.kt:107)
        at io.bazel.kotlin.builder.tasks.jvm.JdepsMerger.execute(JdepsMerger.kt:146)
        at io.bazel.kotlin.builder.tasks.MergeJdeps.invoke(MergeJdeps.kt:28)
        at io.bazel.worker.PersistentWorker$compileWork$2$result$1.invoke(PersistentWorker.kt:101)
        at io.bazel.worker.PersistentWorker$compileWork$2$result$1.invoke(PersistentWorker.kt:99)
        at io.bazel.worker.WorkerContext$TaskContext.resultOf(WorkerContext.kt:125)
        at io.bazel.worker.WorkerContext.doTask(WorkerContext.kt:153)
        at io.bazel.worker.PersistentWorker$compileWork$2.invokeSuspend(PersistentWorker.kt:99)
        at io.bazel.worker.PersistentWorker$compileWork$2.invoke(PersistentWorker.kt)
        at io.bazel.worker.PersistentWorker$compileWork$2.invoke(PersistentWorker.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
        at io.bazel.worker.PersistentWorker.compileWork(PersistentWorker.kt:98)
        at io.bazel.worker.PersistentWorker.access$compileWork(PersistentWorker.kt:57)
        at io.bazel.worker.PersistentWorker$start$1$1$1$1$2$1.invokeSuspend(PersistentWorker.kt:76)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: java.nio.file.NoSuchFileException: bazel-out/darwin_arm64-fastbuild/bin/external/maven/...../artifactory/virtual-maven-android/org/jetbrains/annotations/17.0.0/header_annotations-17.0.0.jar
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
        at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
        at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
        at java.base/java.nio.file.Files.readAttributes(Files.java:1764)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1273)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:747)
        at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:864)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:262)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:191)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:348)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:319)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:285)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions