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

Fix console launcher not consulting eclipse.ini to read vmargs when there is no console window (#117) #118

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

jonathan-meier
Copy link
Contributor

@jonathan-meier jonathan-meier commented Sep 18, 2022

Fixes #117. The fix is to properly propagate the launcher mode from main to the launcher DLL and removing the incomplete isConsoleLauncher function entirely.

@akurtakov
Copy link
Member

@niraj-modi would you please review this patch?

@github-actions
Copy link

Unit Test Results

     24 files       24 suites   11m 38s ⏱️
2 137 tests 2 092 ✔️ 44 💤 1
2 181 runs  2 136 ✔️ 44 💤 1

For more details on these failures, see this check.

Results for commit 27ae5ac.

@akurtakov
Copy link
Member

@nnemkin Is it possible that you review this patch ?

@Torbjorn-Svensson
Copy link
Contributor

I just stumbled on this same problem yesterday.
To me, the proposed solution looks fine as it removes the ambiguity for the expected name of the .ini file.

Copy link
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had a look too and it LGTM and better than existing solution all around, especially as it fixes the comment "should look for a better way to do this"

Please merge this in at the beginning of the 2023-03 dev cycle. (I'm not an equinox committer)

…here is no console window (eclipse-equinox#117)

Processes on Windows can be created without a window using the CREATE_NO_WINDOW flag. When the
console launcher eclipsec.exe is started as such a process, the isConsoleLauncher function wrongly
returns 0 because there is no console window and hence, only eclipsec.ini is consulted for vmargs
but not eclipse.ini (see also functions getConfigArgs and getIniFile).

The fix is to properly propagate the launcher mode from main to the launcher DLL and removing the
incomplete isConsoleLauncher function entirely.
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Test Results

     24 files       24 suites   11m 23s ⏱️
2 139 tests 2 094 ✔️ 44 💤 1
2 183 runs  2 138 ✔️ 44 💤 1

For more details on these failures, see this check.

Results for commit 0258876.

@Torbjorn-Svensson
Copy link
Contributor

@vogella are you planning to do more work/review on this PR or was your force-push just a rebase?
Do you know anyone that can take a look at this PR and hopefully get it merged?

@vogella
Copy link
Contributor

vogella commented Dec 15, 2022

@vogella are you planning to do more work/review on this PR or was your force-push just a rebase? Do you know anyone that can take a look at this PR and hopefully get it merged?

Just a rebate. Can you check the failing tests?

@Torbjorn-Svensson
Copy link
Contributor

@vogella are you planning to do more work/review on this PR or was your force-push just a rebase? Do you know anyone that can take a look at this PR and hopefully get it merged?

Just a rebate. Can you check the failing tests?

I have no idea why the test testCircularityHandling (org.eclipse.equinox.ds.tests.tbc.DSTest) would fail with this change.
To me, this test has nothing to do with what .ini file to read in the eclipsec.exe file. Are you of a different opinion?
Does this work for other PR's?

@iloveeclipse
Copy link
Member

Can you check the failing tests?

I'm pretty sure the native libraries code isn't built & tested anyway on PR's, and there are no tests for that change either.

The binaries are supposed to be built manually via magic jenkins jobs, see #16 (comment)

More important question is: has anyone tried to build the code and test if that change actually works?

@Torbjorn-Svensson
Copy link
Contributor

Can you check the failing tests?

I'm pretty sure the native libraries code isn't built & tested anyway on PR's, and there are no tests for that change either.

The binaries are supposed to be built manually via magic jenkins jobs, see #16 (comment)

More important question is: has anyone tried to build the code and test if that change actually works?

No, I've not built it and I don't even have enough permission to do it on the Jenkins job.
All I've done is to review the change and based on that it relies on the define instead of doing a runtime check, makes it less subject to work some time and not some other time.

@Torbjorn-Svensson
Copy link
Contributor

Using the github action approach in #247, I've been able to validate the functionality using the following approach:

  1. Created a small console application RCP in that simply prints the value of java property and exits.
  2. Modified the eclipse.ini to contain the definition of the property
  3. Created a small java application that runs the product exported in step 1.

The java application contains the following code:

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        String path = "C:\\tmp\\eclipse";

        Process proc = new ProcessBuilder(path + "\\eclipsec.exe")
                .directory(new File(path))
                .start();
        
        System.out.println("Exit code: " + proc.waitFor());

        try (BufferedReader is = new BufferedReader(new InputStreamReader(proc.getInputStream()))) {
            String line;
            while ((line = is.readLine()) != null) {
                System.out.println(line);
            }
        }
    }
}

When running the application defined above with the Eclipse 2023-03 SimRel binaries, the property cannot be extracted:

Exit code: 0
Property value is: null

When running it with the binaries produces with pr/118, then I instead get the following result:

Exit code: 0
Property value is: foo

Other than a rebase and removing some trailing whitespace, I would say that this PR is ready for a merge (keep in mind that I'm not an equinox committer).

What's the next step to get this change merged?

@vogella
Copy link
Contributor

vogella commented Apr 15, 2023

Merging based on Torbjorn-Svensson review.

@vogella vogella merged commit b4b7ffe into eclipse-equinox:master Apr 15, 2023
@vogella
Copy link
Contributor

vogella commented Apr 15, 2023

Thanks @jonathan-meier and @Torbjorn-Svensson for working in this and testing it. We (PMC) decided a while ago that should remove the native support for splash screen from the launcher as the assumption was that this would greatly simplify the launcher code. Maybe something you could help with, in case you also think that simplification of the launcher code might be helpful.

@HannesWell
Copy link
Member

In the area of the launcher the following would be also an interesting issue.

@umairsair
Copy link
Contributor

See #117 (comment)

is this fix part of latest eclipse releases?

IIUC, the binaries are picked from following location and I don't see a new commit after this fix.. am I missing something here?

https://github.com/eclipse-equinox/equinox.binaries/tree/master/org.eclipse.equinox.executable/bin/win32/win32/x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows console launcher (eclipsec.exe) not reading vmargs from eclipse.ini when there is no console window
8 participants