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

Feature: Windows debug launcher #2666

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

infeo
Copy link
Member

@infeo infeo commented Feb 6, 2023

This PR is a follow up of #2661.

It was evaluated, if we could simply add --win-console (see jpackage doc) to our main application and avoid an additional launcher. But doing so would result in bad user experience: Everytime Cryptomator is started, also a cmd Terminal is started.

Hence, to gather extended debug output on windows, we need the launcher. But we decided use it as general debug launcher (in contrast to former PR). This increases maintenance, but we'll be able to analyze with the help of users certain windows-related problems in more detail.

.github/workflows/win-exe.yml Outdated Show resolved Hide resolved
-Dcryptomator.integrationsWin.autoStartShellLinkName="$AppName" \
-Dcryptomator.integrationsWin.keychainPaths="~/AppData/Roaming/$AppName/keychain.json" \
-Dcryptomator.showTrayIcon=true \
-Dcryptomator.buildNumber="msi-${REVISION_NUM}"
Copy link
Member

Choose a reason for hiding this comment

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

We might even add -dbg here, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean a new jvm property (e.g., cryptomator.dbg) which is read by the application?

Copy link
Member

Choose a reason for hiding this comment

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

No just the build number, so we know whether people started the debug launcher

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, got it! Yes, that's a good idea.

* substitute all java-options
* use correct properties path
* fix read-only attribute of debug launcher
@infeo
Copy link
Member Author

infeo commented Feb 6, 2023

Currently the jpackage build fails with:

[2023/02/06 13:00:27.095, jpackage.dll (PID: 2168, TID: 2748), jpackage.cpp:125 (Java_jdk_jpackage_internal_ExecutableRebrander_versionSwap)]
	ERROR: Exception with message 'VersionInfo.cpp(154) at VersionInfo::apply(): Missing mandatory FILEVERSION property' caught
[13:00:26.251] Exception: CryptomatorDebug.properties
[13:00:26.564] Creating app package: Cryptomator in D:\a\cryptomator\cryptomator\appdir
 
(loaded from file D:\a\cryptomator\cryptomator\dist\win\resources\Cryptomator.ico).
[13:00:26.939] Using default package resource WinLauncher.template [Template for creating executable properties file] (add Cryptomator.properties to the resource-dir to customize).
 
(loaded from file D:\a\cryptomator\cryptomator\dist\win\resources\Cryptomator.ico).
[13:00:27.095] Using custom package resource [Template for creating executable properties file] (loaded from CryptomatorDebug.properties).
[13:00:27.095] java.lang.RuntimeException: Failed to update version information for D:\a\cryptomator\cryptomator\appdir\Cryptomator\CryptomatorDebug.exe
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandProperties(ExecutableRebrander.java:212)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.lambda$rebrandExecutable$2(ExecutableRebrander.java:97)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:135)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:96)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:92)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandLauncher(ExecutableRebrander.java:77)
	at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.createLauncherForEntryPoint(WindowsAppImageBuilder.java:140)
	at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.prepareApplicationFiles(WindowsAppImageBuilder.java:108)
	at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.createAppBundle(AppImageBundler.java:187)
	at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:91)
	at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
	at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
	at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
	at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[13:00:27.095] jdk.jpackage.internal.PackagerException: java.lang.RuntimeException: Failed to update version information for D:\a\cryptomator\cryptomator\appdir\Cryptomator\CryptomatorDebug.exe
	at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:96)
	at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
	at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
	at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
	at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
Caused by: java.lang.RuntimeException: Failed to update version information for D:\a\cryptomator\cryptomator\appdir\Cryptomator\CryptomatorDebug.exe
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandProperties(ExecutableRebrander.java:212)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.lambda$rebrandExecutable$2(ExecutableRebrander.java:97)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:135)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:96)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandExecutable(ExecutableRebrander.java:92)
	at jdk.jpackage/jdk.jpackage.internal.ExecutableRebrander.rebrandLauncher(ExecutableRebrander.java:77)
	at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.createLauncherForEntryPoint(WindowsAppImageBuilder.java:140)
	at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.prepareApplicationFiles(WindowsAppImageBuilder.java:108)
	at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.createAppBundle(AppImageBundler.java:187)
	at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:91)
	... 4 more

Noteable is the first/second line. Seems like an internal JDK bug. I'll try to reproduce it with a minimal example. Interestingly, the debug executable is still build, only certain file properties cannot be altered. (Maybe a read-only problem?)

@infeo
Copy link
Member Author

infeo commented Feb 28, 2023

Update: A ticket is created in the jdk issue tracker for it, see https://bugs.openjdk.org/browse/JDK-8303325.

@infeo infeo added state:blocked Waiting for upstream bugfixes type:enhancement Improvements on an existing feature os:windows labels Jun 20, 2023
@CLAassistant

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows state:blocked Waiting for upstream bugfixes type:enhancement Improvements on an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants