-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Fix bsp: getMillBuildClasspath return URI string #1325
Fix bsp: getMillBuildClasspath return URI string #1325
Conversation
getMillBuildClasspath is expect to return URI, otherwise IDEA bsp import will have `java.lang.IllegalArgumentException: Missing scheme` error on MacOS and `Java.net.URISyntaxException: Illegal character in opaque part at index 2: ...` on Windows
problem I mentioned at #1285 (comment)
@lefou @ScalaWilliam pls review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it seems this code isn't covered by any tests, I'd like to have at least one written "It works for me" from someone who really tested this locally, for each platform.
@@ -162,7 +162,7 @@ object ModuleUtils { | |||
val binarySource = | |||
if (sources) all.filter(url => isPathSourceJar(url)) | |||
else all.filter(url => !isPathSourceJar(url)) | |||
binarySource.filter(path => exists(path)).map(_.wrapped.toString) | |||
binarySource.filter(path => exists(path)).map(_.toNIO.toUri.toString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why we don't use a better return type here. At least, we should add some Scaladoc to line 126 to make it clear, that the returned String
s are meant to be URIs.
will try to add an ut for at least getMillBuildClasspath first, If it seems to take a long time to do, I'm happy to write "It works for me" to get this fix merged. |
My apologies, I did not get a chance to test this. |
hmmm,getMillBuildClasspath on |
test is running on a version like
It's impossiable to test, choose to leave a "It works for me on MacOS IDEA" comment... |
also worked for my Windows IDEA
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI failure is some flakiness in GitHub Actions, I reran the tests, which are now green.
I think the test issue(s) can be solved by propagating the freshly built jars into the test setup via forkEnv
and/or forkArgs
. We do this in other integration tests and it works. But I think it's too much to ask for in a bug fix PR and your "works for me" is better than what we have currently. We have lots of open building sites in our BSP story, and integration testing is a central part of it.
Your technical change looks good to me, but the Scaladoc needs to be moved before the start of the def
on line 126, not inside the def
. Otherwise, we're good to merge.
Had same issue on Linux (NixOS), ( Tested this PR by:
This did fix the error and I was able to import the project again; local retagging was to avoid attempting to fetch nonexistant versions of mill-contrib-{bloop, scoverage} (0.9.7-[n]-[local commit that isn't available elsewhere]) |
@fabianhjr would you mind if I add "works for @fabianhjr on Linux(NixOS)" ? |
Not at all, go ahead. Many thanks for the diagnosis and fix of this issue! UwU |
[skip ci]
Thanks you! |
When can we get this patch in a new version like 0.9.8? Since 0.9.7 of mill+bsp+IDEA is totally broken since this issue. |
You can start to use it right away. Just pick the latest snapshot-build version from https://github.com/com-lihaoyi/mill/releases (e.g. |
I'd like to get some other fixes into main branch before the next tag. |
Got it! Thank you! |
opps, seems that package from Arch Linux doesn't honor |
getMillBuildClasspath is expect to return URI, otherwise IDEA bsp import will have
java.lang.IllegalArgumentException: Missing scheme
error on MacOS andJava.net.URISyntaxException: Illegal character in opaque part at index 2: ...
on Windows