Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt clean assembly fails #503

Open
frozenwizard opened this issue Sep 5, 2023 · 0 comments
Open

sbt clean assembly fails #503

frozenwizard opened this issue Sep 5, 2023 · 0 comments

Comments

@frozenwizard
Copy link

So I've recently upgraded to scala 3.3.0 and updated sbt-assembly to the latest version. I have the following configured for the assembly option as I want it in an assembly dir under target/ and to have the git sha on it.

assembly / assemblyOutputPath := file(s"target/assembly/${name.value}-${version.value}.jar")

When I run "sbt clean assembly" it fails with the following:

sbt clean assembly
[info] welcome to sbt 1.9.4 (Amazon.com Inc. Java 17.0.5)
[info] loading settings for project my-project from plugins.sbt ...
[info] loading project definition from /path/to/project/project
[info] loading settings for project rootProject from build.sbt ...
[info] set current project to my-project (in build file:/path/to/projet)
[success] Total time: 0 s, completed Sep 5, 2023, 10:50:36 AM
[info] compiling 13 Scala sources to /path/to/project/target/scala-3.3.0/classes ...
[info] 25 file(s) merged using strategy 'Rename' (Run the task at debug level to see the details)
[info] 214 file(s) merged using strategy 'Discard' (Run the task at debug level to see the details)
[error] java.nio.file.NoSuchFileException:  /path/to/project/target/assembly/project-name-41204ad1ad3bcc7abcc10ee1137d5b5d0e089609-SNAPSHOT.jar
[error] 	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
[error] 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
[error] 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[error] 	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
[error] 	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
[error] 	at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
[error] 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:162)
[error] 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125)
[error] 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:106)
[error] 	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:339)
[error] 	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288)
[error] 	at sbtassembly.Assembly$.$anonfun$jarFileSystemResource$1(Assembly.scala:70)
[error] 	at sbt.io.Using$$anon$2.open(Using.scala:79)
[error] 	at sbt.io.Using.apply(Using.scala:26)
[error] 	at sbtassembly.Assembly$.createJar(Assembly.scala:536)
[error] 	at sbtassembly.Assembly$.$anonfun$assemble$45(Assembly.scala:351)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] 	at sbtassembly.Assembly$.timed$1(Assembly.scala:228)
[error] 	at sbtassembly.Assembly$.$anonfun$assemble$35(Assembly.scala:349)
[error] 	at sbtassembly.Assembly$.$anonfun$cachedAssembly$2(Assembly.scala:523)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:74)
[error] 	at sbtassembly.Assembly$.cachedAssembly(Assembly.scala:527)
[error] 	at sbtassembly.Assembly$.assemble(Assembly.scala:414)
[error] 	at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:196)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] 	at sbt.Execute.work(Execute.scala:292)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:833)
[error] (assembly) java.nio.file.NoSuchFileException: /path/to/project/target/assembly/project-name-41204ad1ad3bcc7abcc10ee1137d5b5d0e089609-SNAPSHOT.jar
[error] Total time: 16 s, completed Sep 5, 2023, 10:50:52 AM

If I run

sbt clean
sbt assembly

There is no issue. I can also delete the target dir and just run sbt assembly and it has no issue. It only seems to be an issue in conjunction with clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant