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

GenIdea: Illegal char <:> #3203

Closed
He-Pin opened this issue Jun 11, 2024 · 3 comments · Fixed by #4052
Closed

GenIdea: Illegal char <:> #3203

He-Pin opened this issue Jun 11, 2024 · 3 comments · Fixed by #4052

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Jun 11, 2024

Bug:
: is not a valid file name on Windows.

[build.sc] [1/1] mill.idea.GenIdea.idea > [7/9] sources.super.mill.scalalib.JavaModule.sources   
Writing 1201 IDEA project files to C:\Users\hepin\IdeaProjects\mill\.idea ...
1 targets failed
mill.idea.GenIdea.idea java.nio.file.InvalidPathException: Illegal char <:> at index 32: mill_modules/dummy.io.chris-kipp:mill-scip_mill0.11_2.13:0.3.7.iml
    java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
    java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
    java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
    java.base/java.nio.file.Path.resolve(Path.java:516)
    os.Path.$div(Path.scala:501)
    mill.idea.GenIdeaImpl.$anonfun$run$3(GenIdeaImpl.scala:48)
    mill.idea.GenIdeaImpl.$anonfun$run$3$adapted(GenIdeaImpl.scala:46)
    scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
    scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
    scala.collection.AbstractIterable.foreach(Iterable.scala:933)
    scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
    mill.idea.GenIdeaImpl.run(GenIdeaImpl.scala:46)
PS C:\Users\hepin\IdeaProjects\mill>

How to reprodouce.

Checkout mill and run mill mill.idea.GenIdea/idea

@lefou
Copy link
Member

lefou commented Jun 11, 2024

Thanks for the report. Looks like we also need to mask illegal characters in cross values.

As a work around, you can skip the dummy modules.

--- a/build.sc
+++ b/build.sc
@@ -1987,6 +1987,7 @@ implicit object DepSegment extends Cross.ToSegments[Dep]({ dep =>
  */
 object dummy extends Cross[DependencyFetchDummy](dummyDeps)
 trait DependencyFetchDummy extends ScalaModule with Cross.Module[Dep] {
+  def skipIdea = true
   def scalaVersion = Deps.scalaVersion
   def compileIvyDeps = Agg(crossValue)
 }

@lefou lefou changed the title Illegal char <:> GenIdea: Illegal char <:> Jun 11, 2024
@He-Pin
Copy link
Contributor Author

He-Pin commented Jun 11, 2024

I'm using Windows 11😂

@lihaoyi lihaoyi closed this as completed in 9be9754 Dec 1, 2024
@lefou lefou added this to the 0.12.4 milestone Dec 1, 2024
jodersky pushed a commit to jodersky/mill that referenced this issue Jan 14, 2025
…Idea on windows (com-lihaoyi#4052)

Fixes com-lihaoyi#2161, fixes
com-lihaoyi#3203, parts of
com-lihaoyi#4050

For now I just merged the two files unchanged except for tweaking the
comment to refer to the `Original Project page`. We can continue to
evolve the scripts post-merge. We already had a copy in `ci/mill.bat`
that I removed, and changed the github actions to point at the top-level
version, and integrated the new `mill.bat` into the doc-site download
instructions and example zips

The changes to the `mill`/`mill.bat` scripts should be covered by the
existing integration and bootstrap tests



This is enough to make Mill's own codebase importable to IntelliJ on
Windows
@lefou
Copy link
Member

lefou commented Jan 19, 2025

Looks like #4052 is only fixing the use side of this problem. Hence the new duplicate reported in #4371.

https://github.com/com-lihaoyi/mill/pull/4052/files#diff-2b601da62851663bf0f9429195310d82df029448cc2f404c421798601585fb10R683-R685

Instead, we need to mask all cross values when materializing their cache locations.

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

Successfully merging a pull request may close this issue.

2 participants