-
Notifications
You must be signed in to change notification settings - Fork 441
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
Project cannot be synced when gradle init script path contains white spaces #2692
Comments
I think it's not because of the Anyway, @CsCherrYY is now working on it. |
So is this a duplicate of eclipse-jdtls/eclipse.jdt.ls#2222 ? Error looks different but whitespace in the path was exactly the issue in that one. If so, let's just mark this as a duplicate of that and close, because it will be in the next release. @tthornton3-chwy , if you try a vscode-java pre-release version, does it solve the issue ? |
@rgrunber unfortunately no, I am currently on the pre-release version ( |
@rgrunber The issue can't be reproduced in VS Code 1.10.0 but can in the master and pre-release version. |
It's a buildship bug, see: eclipse/buildship#1207. @rgrunber Maybe we have to temporary copy the init scripts to system temp folder in case of the path containing spaces? |
That might be a possible workaround (since often, the tempdir path doesn't contain spaces). I tried intentionally placing a space on the path to the init script on Linux and it seemed to work for me. Might this be Windows / MacOS specific ? Also how does this line up with @snjeza's mention of it working on in the release but not in the pre-release ? |
maybe, you can just follow the steps I just pasted in the buildship issue to see if we can reproduce it in Linux systems. It might help Gradle guys find the root cause of this problem, note: directly editing global settings works well, editing project specific settings in eclipse might encounter this issue.
Yes, I can confirm that in the last release version (1.10.0), the extension have errors mentioned in #2222 in logs, but not in problems panel, while in the pre-release version if classpath updated, the error in this issue will shown in the problems panel. Both of the two versions can import the project successfully, but seems to have issues updating classpath for affected projects (Android and protobuf) |
Copy to the temp folder might have another problem, it will generate a lot of init scripts in the temp folder. At least on Windows, the |
Well, I just sort out the story. 1.10.0#2222 shows some errors caused by spaces in URIs. These errors will not affect the import & synchorize process since we have a fallback mechanism, see: https://github.com/eclipse/eclipse.jdt.ls/blob/1058840b2e442486ddd7e7d117db9e2db7533a32/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java#L599-L617 when 1.11.2022092604#2234 fixes #2222 and sends correct arguments to buildship SolutionI suggested to follow the previous fallback mechanism and do not send arguments within spaces to buildship until eclipse/buildship#1207 got solved. I will create a PR later. |
FWIW, I'm able to reproduce. It's just that the failures are hidden in the logs : (script path was
I've merged the suggested workaround, but can someone test @snjeza's proposal for fixing things on Windows, regarding the init scripts not being removed ? |
I'll do it. |
hi, i reported the #2700 issue which has been closed,but it still have exception when upgrading to v1.11.2022092704 on macos,following log:
|
I guess the fix is not contained in |
Ok I've tested it and have some new findings. @snjeza's proposal can make the JVM be terminated normally and thus the temp files will be deleted after the LS exists. But the removal of those temp files causes new problems. After reloading the window and projects are imported, if manually trigger a reload project request, the server will get a Since the build instance is cached, the argument inside this build instance contains the path of the init scripts which have been deleted actually. Then at The operation will fail due to the init script does not exist. A temporary workaround for this situation could be: (See https://github.com/eclipse/eclipse.jdt.ls/pull/2249/files)
At least this can make sure the things will work fine. But after this release I think we need to do some follow-up actions including:
|
Thank you all again for looking into this, I appreciate the time and effort here. Sorry about the can of worms haha. I can confirm what @jdneo said above about the latest release-- the paths used now in the |
@tthornton3-chwy Try running the command |
You're right, cleared things out on the latest version, and now we're good! Thanks for the help and quick support on this. I'm happy to close this out as the issue has been resolved, or keep it open to capture the thread about what ya'll are thinking for next steps on this, whatever you want! |
Thank you @tthornton3-chwy. I'm closing this one since the issue has been resolved :) |
Good evening vscode-java team! Hope all is well.
When I set generatesMetadataFilesAtProjectRoot to true and refresh the project,
org.eclipse.buildship.core.prefs
gets updated to includearguments=--init-script /Users/[...me]/Library/Application Support/Code - Insiders/User/globalStorage/redhat.java[...]
, etc. These scripts seem to be injecting some plugins and doing some setup stuff, which is totally cool, and things seem okay until the next time I rebuild (like by editing+saving the gradle file).Due to the spaces in the path, the first one being in
Application Support
, I get an error:[Error - 7:15:04 PM] Sep 24, 2022, 7:15:04 PM Error occured while building workspace. Details: message: Could not run phased build action using connection to Gradle distribution '[...]/gradle-7.5.1-bin.zip'. The specified initialization script '/Users/[...me]/Library/Application' does not exist.; code: 0; resource: /Users/[...me]/Documents/[...project-path]/build.gradle;
I am able to work around this issue by either:
arguments
line temporarily, re-saving the build.gradle file, and watch as it builds successfully.--user-data-dir /Users/[...me]/.vscode-insiders/user-data
flag applied to VS Code itself, the path that gets set for arguments is now a valid one!Notes:
[...]/Application Support[...]
to work and nothing would fix it. It just would not allow a path with a space in it.Environment
Steps To Reproduce
generatesMetadataFilesAtProjectRoot
setting.org.eclipse.buildship.core.prefs
file gets the describedarguments
line.You may use https://spring.io/guides/gs/gradle/ w/ the "complete" project as a base hello world project. It just needs a gradle update to 7.3.X, which you all nicely tell us to do/help us through on open.
log.txt
Current Result
Project won't build on build.gradle save due to inappropriate init scripts locations (no quotes around a spaced location)
Expected Result
Project builds under those circumstances.
Additional Informations
Provided upon request.
The text was updated successfully, but these errors were encountered: