-
Notifications
You must be signed in to change notification settings - Fork 198
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
Restarting workspace should take into account changes to eclipse.ini #1307
Merged
sravanlakkimsetti
merged 1 commit into
eclipse-platform:master
from
umairsair:eclipse-equinox-p2-issues-166
Jan 29, 2024
Merged
Restarting workspace should take into account changes to eclipse.ini #1307
sravanlakkimsetti
merged 1 commit into
eclipse-platform:master
from
umairsair:eclipse-equinox-p2-issues-166
Jan 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f9c142e
to
833b11e
Compare
833b11e
to
51dc537
Compare
67549db
to
31da964
Compare
@sravanlakkimsetti any comments here or are we good? |
9b24de8
to
91c3470
Compare
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.
91c3470
to
8bf9be0
Compare
sravanlakkimsetti
approved these changes
Jan 29, 2024
be51d14
into
eclipse-platform:master
13 of 14 checks passed
umairsair
added a commit
to umairsair/eclipse.platform.ui
that referenced
this pull request
Feb 4, 2024
- In development mode, changing restart parameters is not allowed, hence exit code 24 is not supported. Previously Workbench.buildCommandLine(..) used to return null for development mode, hence exit code was not set by Workbench.restart(..). And IDEApplication.start(..) used to take care of restarting development mode eclipse with exit code 23. - Now in eclipse-platform#1307, Workbench.buildCommandLine(..) does not check for development mode, hence Workbench.restart(..) is setting return code 24. Fix: ==== Similar to Workbench.setRestartArguments(..), Workbench.restart(..) also checks for development mode and explicitly sets the exit code 23
umairsair
added a commit
to umairsair/eclipse.platform.ui
that referenced
this pull request
Feb 4, 2024
- In development mode, changing restart parameters is not allowed, hence exit code 24 is not supported. Previously Workbench.buildCommandLine(..) used to return null for development mode, hence exit code was not set by Workbench.restart(..). And IDEApplication.start(..) used to take care of restarting development mode eclipse with exit code 23. - Now in [PR#1307](eclipse-platform#1307), Workbench.buildCommandLine(..) does not check for development mode, hence Workbench.restart(..) is setting return code 24. Fix: ==== Similar to Workbench.setRestartArguments(..), Workbench.restart(..) also checks for development mode and explicitly sets the exit code 23
umairsair
added a commit
to umairsair/eclipse.platform.ui
that referenced
this pull request
Feb 4, 2024
- In development mode, changing restart parameters is not allowed, hence exit code 24 is not supported. Previously Workbench.buildCommandLine(..) used to return null for development mode, hence exit code was not set by Workbench.restart(..). And IDEApplication.start(..) used to take care of restarting development mode eclipse with exit code 23. - Now in [PR#1307](eclipse-platform#1307), Workbench.buildCommandLine(..) does not check for development mode, hence Workbench.restart(..) is setting return code 24. Fix: ==== Similar to Workbench.setRestartArguments(..), Workbench.restart(..) also checks for development mode and explicitly sets the exit code 23
merks
pushed a commit
that referenced
this pull request
Feb 4, 2024
- In development mode, changing restart parameters is not allowed, hence exit code 24 is not supported. Previously Workbench.buildCommandLine(..) used to return null for development mode, hence exit code was not set by Workbench.restart(..). And IDEApplication.start(..) used to take care of restarting development mode eclipse with exit code 23. - Now in [PR#1307](#1307), Workbench.buildCommandLine(..) does not check for development mode, hence Workbench.restart(..) is setting return code 24. Fix: ==== Similar to Workbench.setRestartArguments(..), Workbench.restart(..) also checks for development mode and explicitly sets the exit code 23
amartya4256
pushed a commit
to amartya4256/eclipse.platform.ui
that referenced
this pull request
Feb 8, 2024
- In development mode, changing restart parameters is not allowed, hence exit code 24 is not supported. Previously Workbench.buildCommandLine(..) used to return null for development mode, hence exit code was not set by Workbench.restart(..). And IDEApplication.start(..) used to take care of restarting development mode eclipse with exit code 23. - Now in [PR#1307](eclipse-platform#1307), Workbench.buildCommandLine(..) does not check for development mode, hence Workbench.restart(..) is setting return code 24. Fix: ==== Similar to Workbench.setRestartArguments(..), Workbench.restart(..) also checks for development mode and explicitly sets the exit code 23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background:
There are 3 return codes supported by Eclipse
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
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
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 aseclipse A B C
where A B C are some arguments to launcher and for relaunch, Eclipse application mentionedX Y Z
arguments then relaunch command will beeclipse --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 aseclipse A B C
and Eclipse application mentionedX Y Z
as relaunch arguments along with--launcher.skipOldUserArgs
then relaunch command will beeclipse --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.See also eclipse-equinox/equinox#401
Fixes eclipse-equinox/p2#166