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

'other' has different root #944

Closed
kthompson opened this issue Aug 4, 2020 · 4 comments
Closed

'other' has different root #944

kthompson opened this issue Aug 4, 2020 · 4 comments
Milestone

Comments

@kthompson
Copy link

kthompson commented Aug 4, 2020

adding a predefScript(on windows) at C:\Users\Kevin\.mill\ammonite\predefScript.sc and then running build from another volume ie

E:\code\work\test > mill resolve __

Results in 'other' has different root exception.

❯ mill resolve __
Compiling C:\Users\Kevin\.mill\ammonite\predefScript.sc
java.lang.IllegalArgumentException: 'other' has different root
  sun.nio.fs.WindowsPath.relativize(WindowsPath.java:404)
  sun.nio.fs.WindowsPath.relativize(WindowsPath.java:42)
  os.Path.relativeTo(Path.scala:456)
  mill.main.MainRunner$CustomCodeWrapper$.apply(MainRunner.scala:178)
  ammonite.interp.Preprocessor$.wrapCode(Preprocessor.scala:141)
  ammonite.interp.DefaultPreprocessor.$anonfun$transform$2(DefaultPreprocessor.scala:46)
  ammonite.util.Res$Success.map(Res.scala:67)
  ammonite.interp.DefaultPreprocessor.transform(DefaultPreprocessor.scala:42)
  ammonite.interp.Interpreter.compileRunBlock$1(Interpreter.scala:518)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$15(Interpreter.scala:568)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:565)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$12(Interpreter.scala:562)
  scala.Option.getOrElse(Option.scala:201)
  ammonite.interp.Interpreter.loop$1(Interpreter.scala:562)
  ammonite.interp.Interpreter.processAllScriptBlocks(Interpreter.scala:600)
  ammonite.interp.Interpreter.$anonfun$processModule$6(Interpreter.scala:395)
  ammonite.util.Catching.flatMap(Res.scala:115)
  ammonite.interp.Interpreter.$anonfun$processModule$5(Interpreter.scala:386)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.processModule(Interpreter.scala:376)
  ammonite.interp.Interpreter.$anonfun$initializePredef$3(Interpreter.scala:140)
  ammonite.interp.Interpreter.$anonfun$initializePredef$3$adapted(Interpreter.scala:140)
  ammonite.interp.PredefInitialization$.$anonfun$apply$2(PredefInitialization.scala:79)
  ammonite.util.Res$.$anonfun$fold$1(Res.scala:32)
  scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:168)
  scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:164)
  scala.collection.immutable.List.foldLeft(List.scala:79)
  ammonite.util.Res$.fold(Res.scala:30)
  ammonite.interp.PredefInitialization$.apply(PredefInitialization.scala:67)
  ammonite.interp.Interpreter.initializePredef(Interpreter.scala:142)
  ammonite.Main.$anonfun$instantiateInterpreter$1(Main.scala:189)
  scala.util.Either$RightProjection.flatMap(Either.scala:757)
  ammonite.Main.instantiateInterpreter(Main.scala:146)
  mill.main.MainRunner.$anonfun$runScript$2(MainRunner.scala:108)
  mill.main.RunScript$.runScript(RunScript.scala:43)
  mill.main.MainRunner.$anonfun$runScript$1(MainRunner.scala:115)
  mill.main.MainRunner.watchLoop2(MainRunner.scala:64)
  mill.main.MainRunnerFailed to connect to server
@lefou lefou added upstream The issue originates in an upstream dependency and removed upstream The issue originates in an upstream dependency labels Oct 15, 2021
@Huelse
Copy link

Huelse commented Nov 9, 2022

same problem in windows 10, which my project in D:\
run .\mill.bat version:

Compiling C:\Users\Max\.mill\ammonite\predefScript.sc
java.lang.IllegalArgumentException: 'other' has different root
...

@lefou
Copy link
Member

lefou commented Nov 9, 2022

We currently encode foreign modules with a relative path, but under Windows, path with different drive letters can't be made relative to each other. (I think predef scripts are handled as foreign modules.) We probably need to change the handling of foreign modules to also support absolute paths, in case they can't be made relative.

@lihaoyi
Copy link
Member

lihaoyi commented Apr 23, 2023

I think we can close this with #2377. Predef scripts are no longer supported, and the alternative meta-builds live in mill-build/build.sc in the same folder and are guaranteed to live in the same filesystem root

@lihaoyi lihaoyi closed this as completed Apr 23, 2023
@lefou
Copy link
Member

lefou commented Apr 23, 2023

Ok, let's close this one. But I think we still can't import external modules which live on other windows drives. We can open a new issue, once we have a reproducer.

@lefou lefou added this to the 0.11.0-M8 milestone Apr 23, 2023
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

4 participants