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

Unable to launch Eclipse launch config if name contains spaces #1630

Closed
iloveeclipse opened this issue Feb 27, 2025 · 15 comments
Closed

Unable to launch Eclipse launch config if name contains spaces #1630

iloveeclipse opened this issue Feb 27, 2025 · 15 comments
Assignees
Labels
bug Something isn't working regression Regression defect
Milestone

Comments

@iloveeclipse
Copy link
Member

iloveeclipse commented Feb 27, 2025

Regression in 4.35 via #1565.

  1. Create new launch configuration to start Eclipse (default name New_configuration)
  2. Try to start Eclipse - works.
  3. Duplicate launch config to get a name New_configuration (1) (note the space)
  4. Try to Start Eclipse - fails with error
An error has occurred.  See the log file
/data/runtime-Java_21/.metadata/.plugins/org.eclipse.pde.core/New_configuration%20(1)/1740652776602.log

Log file contains this:

ESSION Thu Feb 27 11:39:36 CET 2025 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2025-02-27 11:39:36.619
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.io.FileNotFoundException: Could not find framework under /data/git/equinox/bundles/org.eclipse.equinox.launcher/bin/plugins
        at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:990)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:585)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

Reverting e62be0b fixes the launch.

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Feb 27, 2025

Note, the encoding of the -dev attribute was broken before and not fixed by reverting e62be0b. I'm looking at commit that broke this, looks like this one: 04785c9

@akurtakov
Copy link
Member

I'm looking into it. Reverting a series of commits is not what I aim at .

@iloveeclipse
Copy link
Member Author

I'm looking into it. Reverting a series of commits is not what I aim at .

It is one commit + one change from other commit. Should be safe.

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Feb 27, 2025
iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Feb 27, 2025
@iloveeclipse
Copy link
Member Author

See #1631.

@akurtakov
Copy link
Member

@iloveeclipse I am unable to reproduce the problem on Linux . Do you see it on windows?

@merks
Copy link
Contributor

merks commented Feb 27, 2025

FYI, I see a problem here where the launcher simply doesn't decode a properly encoded URI:

Image

@iloveeclipse
Copy link
Member Author

@iloveeclipse I am unable to reproduce the problem on Linux . Do you see it on windows?

Linux

@iloveeclipse
Copy link
Member Author

Note, PDE creates two directories with different names but deletes only one. To reproduce, one has manually delete all existing directories.

@iloveeclipse
Copy link
Member Author

FYI, I see a problem here where the launcher simply doesn't decode a properly encoded URI:

I'm not sure this is the place to fix, because launcher cant know whether /data/runtime-Java_21/.metadata/.plugins/org.eclipse.pde.core/New_configuration%20(1)/ or /data/runtime-Java_21/.metadata/.plugins/org.eclipse.pde.core/New_configuration (1)/ is the "right" path - both are possible and valid values.

I believe the problem is in PDE where the paths entered in the UI and paths passed to the launcher differ.

@merks
Copy link
Contributor

merks commented Feb 27, 2025

It's really quite the disaster area. The launcher main is so terrible with all the confusion and hacks around things that are URLs or maybe they are file paths, or maybe goodness knows maybe both, neither, some abomination in between that is not even a valid URI this is kind of a semi-bogus URL.

I found that this fixes the problem as far as I've been able to reproduce it.

Image

merks added a commit to merks/equinox that referenced this issue Feb 27, 2025
- First try to create a URI from the spec and then create a File from
that URI to ensure that the spec is properly decoded.

eclipse-pde/eclipse.pde#1630
@iloveeclipse
Copy link
Member Author

I found that this fixes the problem as far as I've been able to reproduce it.

I can confirm the PR with the fix above fixes this issue.

@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Feb 27, 2025
@iloveeclipse iloveeclipse added this to the 4.35 RC2 milestone Feb 27, 2025
merks added a commit to merks/equinox that referenced this issue Feb 27, 2025
- First try to create a URI from the spec and then create a File from
that URI to ensure that the spec is properly decoded.

eclipse-pde/eclipse.pde#1630
merks added a commit to eclipse-equinox/equinox that referenced this issue Feb 27, 2025
- First try to create a URI from the spec and then create a File from
that URI to ensure that the spec is properly decoded.

eclipse-pde/eclipse.pde#1630
@iloveeclipse
Copy link
Member Author

Thanks Ed.

@laeubi
Copy link
Contributor

laeubi commented Feb 28, 2025

By the way is there any chance to add a regression test so we notice such thing earlier and don't need manual testing?

@merks
Copy link
Contributor

merks commented Feb 28, 2025

By the way is there any chance to add a regression test so we notice such thing earlier and don't need manual testing?

What's the standard answer to that type of question? 😬

In any case, that code, I'm sorry to say, is kind of a disaster area.

Unless all places create properly encoded URIs in the first places and all places converting those to file system paths decode those properly I think it will never work 100% correctly, e.g., don't try this at home boys and girls:

Image

When I see a lot of file:D:/..., file:D:\..., and file:/D:/... then I know the problem of encoding correctly is pervasive which means all bets are off for proper decoding because the code is rife with hacks that deal with the not-properly-encoded case(s) so much so that the properly-encoded case didn't actually work.

So not only do there need to be tests, there needs to be significant rework to stamp out the sources of bad data...

@laeubi
Copy link
Contributor

laeubi commented Feb 28, 2025

I think a test that uses a space in the path would be a very first step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants