eclipse-platform / eclipse.platform

https://eclipse.dev/eclipse/
Eclipse Public License 2.0
84 stars 113 forks source link

[2024-09 regression] Restart is needed to refresh shared launch configurations #1609

Closed rhoehener closed 1 week ago

rhoehener commented 1 week ago

Since 2024-09, we need to restart eclipse to refresh our shared launch configurations. Otherwise Eclipse will still show launch configs that have been changed by someone else (= the change happens via souce control updates, not via launch config UI).

I assume this might also affect adding or renaming of launch configurations.

To reproduce, delete a shared launch configuration on the file system and try to refresh / update the project in the workspace -> the launch configuration should still be visible in the list.

jukzi commented 1 week ago

@rhoehener thanks for your report, can you please contribute a fix or at least point to a commit that broke the behaviour?

rhoehener commented 1 week ago

@jukzi i'm sorry i'm just a long-time user of eclipse. but please let me know if you cannot reproduce the problem or need more information.

merks commented 1 week ago

Perhaps this has some unintended impact?

https://github.com/eclipse-platform/eclipse.platform/commit/8d5bfec6e9f2e6c6136413e0a82062d667029dbc

iloveeclipse commented 1 week ago

Perhaps this has some unintended impact?

8d5bfec

Yes, https://github.com/eclipse-platform/eclipse.platform/pull/1487 looks related. @HannesWell : could you please check? This isn't a nice regression ...

iloveeclipse commented 1 week ago

@trancexpress : could you please bisect if this is from https://github.com/eclipse-platform/eclipse.platform/pull/1487 and if yes, provide a fix or revert? Would be nice for RC1.

trancexpress commented 1 week ago

I can't reproduce with latest I-build, on Linux:

Eclipse SDK
Version: 2024-12 (4.34)
Build id: I20241111-1800

I tried:

  1. Create a new Java project.
  2. Create some Java class with a main snippet.
  3. Run the snippet.
  4. Adjust the launch to be shared, shared launch file is in the root of the project.
  5. Delete the launch file on command line.
  6. Refresh the project, the launch configuration is gone.

I also tried restarting Eclipse between steps 4. and 5..

I also tried with the Eclipse 4.33 release:

Eclipse SDK
Version: 2024-09 (4.33)
Build id: I20240903-0240

@rhoehener please provide specific reproduction steps, the type of launch, where its stored and so on.

rhoehener commented 1 week ago

@trancexpress I downloaded a fresh copy of eclipse (eclipse-jee-2024-09-R-win32-x86_64.zip, Windows 11) and everything works if I save the launch configs in the project root. But all our shared launch configs are stored in <project-dir>/.launch.

I assume there is a new filter at work that skips folders prefixed with a dot when scanning for launch configs.

If I import the attached test project, I do not see any launch configurations at all until I do a close/open project cycle. Same for copying/deleting/renaming. And when launch configurations exist in both the project root and the .launch folder, the problems seem to get even worse.

testartifact.zip

image

trancexpress commented 1 week ago

Storing the launch in a folder .launch in the project root does it, I can see the bug now. Also, the removed configs are seen in the launch configuration dialog, not in the run menu.

Reverting 8d5bfec6e9f2e6c6136413e0a82062d667029dbc does fix the problem.

I've set: https://github.com/eclipse-platform/eclipse.platform/pull/1615

trancexpress commented 1 week ago

@HannesWell , after the revert, please do the following:

  1. Apply the inner class to delta conversion and the minor code clean-ups (enhanced for loop and local variable scope reduction) in one commit.
  2. Apply whatever changes you did on top of that change in a separate commit, validate why those changes cause this bug, fix accordingly.
trancexpress commented 1 week ago

Revert is merged, I'll double-check with the I-build tomorrow if the bug is gone.

rhoehener commented 1 week ago

Thank you everyone for looking into this issue!

trancexpress commented 1 week ago

Validated the latest I-build, the bug is gone: https://download.eclipse.org/eclipse/downloads/drops4/I20241113-1800/

I also don't see any platform.ui Linux failures in the build. I did get a notification that platform UA test testAllLinks fails, but I don't see how that is related (see also e.g.: https://github.com/eclipse-platform/eclipse.platform/issues/1370 )