-
Notifications
You must be signed in to change notification settings - Fork 421
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
Wrong parsing of an application name containing "." (a dot) leads to a non-working AppImage #289
Comments
Oh well, this should not happen. I bet it's due to calling Should be an easy fix. |
Spot on... likely here: linuxdeployqt/tools/linuxdeployqt/main.cpp Line 196 in 63e768b
Thanks @TheAssassin - you are now a true master of Qt, debugging code without even looking at it ;-) |
Not really a master, but I have some experience with its |
Would there be any reconsideration to add back in a check for the |
How would a proper fix look like? |
- QString appName = QDir::cleanPath(QFileInfo(appBinaryPath).completeBaseName());
+ // Assume ".real" is an attempt to shim additional runtime behavior, e.g. LD_LIBRARY_PATH
+ // take the basename instead
+ QString appName = appBinaryPath.endsWith(".real") ?
+ QDir::cleanPath(QFileInfo(appBinaryPath).completeBaseName()) :
+ QDir::cleanPath(QFileInfo(appBinaryPath).fileName()); Probably worth putting in the official documentation if this is accepted. I looked around and couldn't find it anywhere except a note from you in our bug report...
If we're simply doing it wrong, let us know that too. :) |
Well, hardcoding one particular extension, |
I'm not sure what you mean. If this is an officially supported technique, you should set the standard, as this is your library. I was hesitant to even write it, TBH since this was a proposal by exactly you. :D Whatever you decide, if you decide, let us know so that we can continuing using |
So some additional background on all of this...
So, the root of the issue was the first environmental variable -- but -- the need to add more has made this just-in-time-custom-environment much more important as we embrace So what we need is the ability to shim custom logic into the launcher from the We'd be happy to provide this as a supplement to the |
Maybe I am seeing it too simple, but it seems that a dot ( Am I missing something? |
"Break" being the operative word. I'll quote myself the first time this
So, I was confused by this behavior, pointed it out, but since upstream recommended it, I used it. Now it's been removed and we have no fallback option. Perhaps we just need to stop using |
@tresf again, what is forcing you to use a dot (.) in the Exec= value? Just that I did this in an example I made up earlier, when a dot in the Exec= value was still working? The easy workaround is to just not use a dot (.) in the Exec= value, e.g., by substituting it with an underscore (_). |
Perhaps you are misunderstanding the bug and the resolution. The dot in the filename is what allowed the shim script to work in the first place. Adding an underscore does nothing because it was the behavior of the baseName that allowed the shim in the first place as it allowed the binary to have a different path than the launch command without breaking the automatic bundling behavior of the tool. |
Ah right, I forgot about how that script works. Can we change the shim script to use a |
I feel we're talking in circles here. With your advice, we moved the binary and |
You might want to check out linuxdeploy and its Qt plugin. |
Since we've switched to using # After calling linuxdeployqt, point the AppRun to the shim launcher, not the foo.real version
ln -sfr [appdir]/usr/bin/foo [appdir]/AppRun |
@tresf linuxdeploy for instance respects existing AppRuns, and doesn't overwrite them. |
Thanks, we'll eventually switch to that if it's the eventual successor to |
Cool. Feel free to visit #appimage on Freenode if you have questions. |
Steps to reproduce:
Create an AppDir containing usr/bin/my_application_2.0_linux64 and usr/share/applications/my_application.desktop
=> my_application_2.0_linux64 is actually the name of the executable.
Run the following command line in a shell:
./linuxdeployqt-continuous-x86_64.AppImage AppDir/usr/share/applications/my_application.desktop -appimage -bundle-non-qt-libs -verbose=2
You will notice that the AppDir was filled properly
The AppImage was created without error
But AppDir/AppRun is a symlink to AppDir/bin/my_application2
that is to say the application name was truncated at the dot (parsing error). Trying to run the AppImage yields the following message :
execv error: No such file or directory
Work around
Rename the application binary file without any dot, for example my_application_2_linux64
The text was updated successfully, but these errors were encountered: