Add assemblyUnzipDirectory to AssemblyOption to use a different directory for unzipping jars#448
Add assemblyUnzipDirectory to AssemblyOption to use a different directory for unzipping jars#448er1c wants to merge 3 commits intosbt:developfrom
Conversation
2d95c13 to
ab273c1
Compare
ab273c1 to
b405013
Compare
4a48749 to
a90a692
Compare
|
Found one issue with the hardlinks, one of my assumptions of the caches being on the same devices is flawed :) This either needs to be caught and then just copied, or have a toggle earlier up to see if hardlink is supported |
b96e5b2 to
fb40f47
Compare
|
Got some corner case that I need to figure out: |
b7c0a0b to
c7afabd
Compare
114ad3f to
264ca8e
Compare
| if (!assemblyUnzipDir.exists) IO.createDirectory(assemblyUnzipDir) | ||
| if (assemblyDir.isDefined && !assemblyDir.get.exists) IO.createDirectory(assemblyDir.get) | ||
|
|
||
| state.locked(assemblyUnzipDir / "sbt-assembly.lock") { |
There was a problem hiding this comment.
I really didn't want to add a lock here (I originally tried locking on individual jar file), but this seemed to be the only reliable place to put it in a very complex project.
| hash = sha1name(jar) + "_" + sha1content(jar) + "_" + sha1rules(jarRules) | ||
| jarOutputDir = (assemblyDir.getOrElse(assemblyUnzipDir) / hash).getCanonicalFile | ||
| } yield { | ||
| // TODO: Canonical path might be problematic if mount points inside docker are different |
There was a problem hiding this comment.
This is a problem, if say you have a /home/packer/.cache/sbt that then gets mounted into a docker container as /home/docker/.cache/sbt and then get something like:
~/.cache/sbt/v1/assembly/dependencies $ cat fdf034b77ea4c96874cbd087f89a92d9c6169839_66a4cd59bc0daa39b67b0b5e496cee078b835d51_c3c65759ec2815d6ff9909c6e810928dba1ad3a0.jarName
/home/docker/.cache/coursier/cache/http/nexus-aws.dot-data.net/repository/maven-public/org/typelevel/spire-macros_2.12/0.17.0-M1/spire-macros_2.12-0.17.0-M1.jar
Trying to decide/figure out if there is an easy way to canonicalize based upon what the current cache directories are, rather fan full absolute path.
There was a problem hiding this comment.
I think its safer to keep this in there, rather than do any canonicalization
build.sbt
Outdated
| case "2.12" => "1.2.8" | ||
| } | ||
| } | ||
| Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala" |
There was a problem hiding this comment.
Why is Contraband dropped here?
There was a problem hiding this comment.
It's not used anymore, I can add it back, I had a question earlier about whether it should be used or not. I'll ping you a link
| log.debug("Merging files...") | ||
| log.info("Merging files...") |
There was a problem hiding this comment.
Could we put this back to debug?
264ca8e to
aa5aad2
Compare
…ectory for unzipping jars * Add assemblyCacheDependency task to unzip jar dependencies as a separate task
aa5aad2 to
f9e57eb
Compare
Adding as a draft for just reference for now
This is a draft implementation for #445
TODO