Skip to content

Commit

Permalink
Restarting workspace should take into account changes to eclipse.ini
Browse files Browse the repository at this point in the history
Background:
===========
There are 3 return codes supported by Eclipse
- 0  - Normal exit
- 23 - Restart the eclipse with previous launcher arguments
- 24 - Restart the eclipse with the arguments provided by Eclipse
application itself

The above mentioned problem is not with the exit code 23. The reason is
that the eclipse launcher restarts itself in this case, hence eclipse.ini
is also reloaded. However eclipse launcher does not restart itself in case
of code 24 and parses the arguments provided by Eclipse application in
shared memory and simply relaunches java, which means that eclipse.ini will
not be reloaded.

For restarts, eclipse should be using code 23 but we had to switch to code
24 to fix following issue.
[[WorkbenchLauncher] Restart asks for the workspace to run](https://bugs.eclipse.org/bugs/show_bug.cgi?id=264072)
And then the fix of following built up on it.
[[Workspace chooser] "Older Workspace Version" dialog: "Cancel" button shouldn't close Eclipse but go back to workspace chooser](https://bugs.eclipse.org/bugs/show_bug.cgi?id=538830)

Fix:
====
For code 24, the arguments in shared memory are for launcher, so instead of
launcher just parsing the args and relaunching java, it should restart the
launcher with appropriate arguments. With relaunching the launcher,
eclipse.ini will be reloaded like its done for code 23.

Eclipse launcher is updated to relaunch for code 24 as well. Moreover,
there are 3 new launcher arguments introduced, 2 are internal to launcher
and one is external to launcher and can be set by eclipse application as a
relaunch argument.

- `--launcher.oldUserArgsStart` and `--launcher.oldUserArgsEnd`: The user
arguments passed to eclipse launcher for first start are tracked between
these arguments during relaunches. E.g., if eclipse was started as
`eclipse A B C` where A B C are some arguments to launcher and for
relaunch, Eclipse application mentioned `X Y Z` arguments then
relaunch command will be `eclipse --launcher.oldUserArgsStart A B C
--launcher.oldUserArgsEnd A B C X Y Z`. Moreover, launcher relaunch will
ignore all arguments between and including `--launcher.oldUserArgsStart`
and `--launcher.oldUserArgsEnd`.
- `--launcher.skipOldUserArgs`: If eclipse application wants to relaunch
with provided arguments only and ignore the older user args then it can
mention this argument. So for the case where eclipse was started as
`eclipse A B C` and Eclipse application mentioned `X Y Z` as relaunch
arguments along with `--launcher.skipOldUserArgs` then relaunch command
will be
`eclipse --launcher.oldUserArgsStart A B C --launcher.oldUserArgsEnd X Y Z`
where launcher relaunch will ignore all arguments between and including
`--launcher.oldUserArgsStart` and `--launcher.oldUserArgsEnd`.

For restarts, Eclipse application just mentions the `-data` argument now
as relaunch arguments instead of mentioning complete java args. However,
user can still mention more arguments for relaunch and Eclipse restart will
respect them as well and append the `-data` argument at the end of user
arguments.
  • Loading branch information
umairsair committed Jan 19, 2024
1 parent 94c7721 commit e01ea10
Show file tree
Hide file tree
Showing 18 changed files with 1,216 additions and 215 deletions.
54 changes: 51 additions & 3 deletions .github/workflows/build.yml
Expand Up @@ -64,18 +64,23 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.2
- name: Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Build
working-directory: features/org.eclipse.equinox.executable.feature/library/win32
run: nmake -f make_win64.mak
run: nmake -f make_win64.mak test
shell: pwsh
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -86,6 +91,49 @@ jobs:
features/org.eclipse.equinox.executable.feature/library/win32/eclipse*.exe
features/org.eclipse.equinox.executable.feature/library/win32/eclipse*.dll
if-no-files-found: error
- name: Upload Windows Test Results
uses: actions/upload-artifact@v4
with:
name: test-results-win64
if-no-files-found: error
path: '**/target/*-reports/*.xml'
build-launcher-linux64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.2
- name: Install GTK headers
run: sudo apt-get install -y libgtk-3-dev
- name: Build
working-directory: features/org.eclipse.equinox.executable.feature/library/gtk
run: ./build.sh test
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: Linux launcher artifacts
path: |
features/org.eclipse.equinox.executable.feature/library/gtk/eclipse
features/org.eclipse.equinox.executable.feature/library/gtk/eclipse*.so
if-no-files-found: error
- name: Upload Linux Test Results
uses: actions/upload-artifact@v4
with:
name: test-results-linux64
if-no-files-found: error
path: '**/target/*-reports/*.xml'
tck:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit e01ea10

Please sign in to comment.