-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Avoid flushing caches when transitioning between --interactive and server-client mode #329
Comments
This can be seen via:
Flushing & re-compiling the build file caches propagate down to flushing & re-compiling all Mill task caches. Ideally we should need to do neither since neither the build files nor the build have changed |
Seems like the following additional files are included in the classpath signature scan as part of (
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunec.jar),
1513734819000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/nashorn.jar),
1513734819000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/cldrdata.jar),
1513734819000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/jfxrt.jar),
1513723243000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/dnsns.jar),
1513734819000L
),
(
Right(
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/localedata.jar
),
1513734819000L
),
(
Right(
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar
),
1513734819000L
),
(
Right(
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar
),
1513734819000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/jaccess.jar),
1513734819000L
),
(
Right(/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/zipfs.jar),
1513734819000L
),
(Right(/System/Library/Java/Extensions/MRJToolkit.jar), 1507352950000L), This files actually appear in both --interactive and server/client, but somehow appear twice in --interactive mode, causing Ammonite to think the classpath is different and busting caches |
Here's the difference between the classloaders of --- a/main/src/mill/main/RunScript.scala
+++ b/main/src/mill/main/RunScript.scala
@@ -39,6 +39,24 @@ object RunScript{
instantiateInterpreter match{
case Left((res, watched)) => (res, watched)
case Right(interp) =>
+ val mainThread = Thread.currentThread()
+ val allClassloaders = {
+ val all = mutable.Buffer.empty[ClassLoader]
+ var current = mainThread.getContextClassLoader
+ while(current != null){
+ all.append(current)
+ current = current.getParent
+ }
+ all
+ }
+
+ log.outputStream.println(pprint.apply(allClassloaders, height = 9999))
+ log.outputStream.println(pprint.apply(
+ allClassloaders
+ .collect{case cl: java.net.URLClassLoader => cl -> cl.getURLs.filter(_.getProtocol == "file")},
+ height = 9999
+ ))
+// log.outputStream.println(pprint.apply(SpecialClassLoader.initialClasspathSignature(mainThread.getContextClassLoader), height = 9999)) Interactive:
client/server:
In the client/server setup, the JDK jars seem to appear twice: once in |
Fixed by #342 |
Currently every time you switch, we go through a different code path to run Mill, and so caches get flushed and everything needs to be re-compiled. There is no reason for this to be the case so we should just fix it
The text was updated successfully, but these errors were encountered: