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

appimagetool 489 -s deploy failure #44

Closed
Juuliuus opened this issue Jul 29, 2020 · 11 comments
Closed

appimagetool 489 -s deploy failure #44

Juuliuus opened this issue Jul 29, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@Juuliuus
Copy link

Hi,

This is Julius, we had a conversation on appimage discourse re: "modern" appimages.

I tried your suggestion of -s deploy with that latest appimagetool 489. Here are what I think are the relevant failure messages:
2020/07/29 10:51:06 Find out whether Qt is a dependency of the application to be bundled...
2020/07/29 10:51:06 Detected Qt 5
2020/07/29 10:51:06 Offset of qt_prfxpath: 3561388
2020/07/29 10:51:06 Length of value of qt_prfxpath: 4
qt_prfxpath: /usr
2020/07/29 10:51:06 Got qt_prfxpath but it does not contain 'plugins'
...
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/lib/x86_64-linux-gnu/kconf_update_bin
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/lib/x86_64-linux-gnu/qt5
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/share/lintian/overrides
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/src/linux-headers-5.4.0-26/scripts
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/src/linux-headers-5.4.0-26-generic/scripts
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/src/linux-headers-5.4.0-42/scripts
2020/07/29 10:36:21 Guessed qt_prfxpath to be /usr/src/linux-headers-5.4.0-42-generic/scripts
Looking in /usr/src/linux-headers-5.4.0-42-generic/scripts/plugins
2020/07/29 10:36:21 Could not find 'plugins/platforms/libqxcb.so' in qtPrfxpath, exiting

my /usr/src/linux-headers-5.4.0-42-generic/scripts/ folder does not have a plugins folder or file.

I did check and that file does exist in my /usr/.../qt/ folder fwiw.

The file also was present in ./AppDir/usr/plugins/platforms (this appdir was pre-existing from a linuxdeploy).

I tried a "bare bones" (only a bin executable, icons, and the desktop file) appdir and had the same failure.

HTH.

@probonopd
Copy link
Owner

probonopd commented Jul 29, 2020

Hello @Juuliuus thanks for checking this out. Can you please give some more information:

  • OS/distribution and version
  • Qt version
  • Where is your Qt from (distribution? PPA? Qt website?)
  • Where is your Qt plugins directory located? Looking at the above, probably /usr/lib/x86_64-linux-gnu/qt5/plugins? In this case the correct qt_prfxpath would be /usr/lib/x86_64-linux-gnu/qt5 which is mentioned in the second line above. We need to find out why it is not being used...
  • Do you have /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so? If not there, where is this file on your system?
  • What happens if you do not use -s? (Start with an empty AppDir)

@probonopd
Copy link
Owner

probonopd commented Jul 29, 2020

Could it be that libqt5gui5 and/or libqt5gui5-gles are not installed on your system?

If so, please install them and then try again.

(Is this an issue for the edge cases in which Qt CLI tools are being packaged and where those packages may not be present in the system at all?)

@Juuliuus
Copy link
Author

Juuliuus commented Jul 29, 2020

Hi,

My install is a straight Kubuntu 20.04 install.

OS/distribution and version

Linux juus-M6800 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Qt version

5.12.8

Where is your Qt from (distribution? PPA? Qt website?)

Kubuntu 20.04 iso

Where is your Qt plugins directory located? Looking at the above,
probably /usr/lib/x86_64-linux-gnu/qt5/plugins?

Correct, that is where it is located.

Do you have /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so?

Yes.

~ are these installed?

libqt5gui5
synaptic shows it as installed.
locate cmd shows: /usr/share/lintian/overrides/libqt5gui5

ibqt5gui5-gles

This is not installed but when I tried through synaptic pkg man. it wanted to remove many, many important looking packages. I will defer on this for now.

searching around on internet there was mention of having qt5-gmake installed. I do not have that installed by default.

What happens if you do not use -s? (Start with an empty AppDir)

I did try several permutations of the command, all failed. I will try it again but for now must "Punt". I will not be at desk for next couple of days...will report back when I can get it done.

@Juuliuus
Copy link
Author

Pardon me please. I have no idea what I am doing on this site to make everything "quote indented".

@probonopd
Copy link
Owner

Hi, thanks for the responses, I fixed the "quote indented" by adding a blank line after each quote.

@probonopd
Copy link
Owner

Do you have /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so?

Yes.

Then we must have some nasty bug around here:

// Special case:
// Some distributions, including Ubuntu and Alpine,
// have qt_prfxpath set to '/usr' but the files are actually in e.g., '/usr/lib/qt5'
// In this case, we should NOT patch it
if helpers.IsDirectory(qt_prfxpath+"/plugins") == false {
log.Println("Got qt_prfxpath but it does not contain 'plugins'")
results := helpers.FilesWithSuffixInDirectoryRecursive(qt_prfxpath, "plugins")
log.Println("results", results)
for _, result := range results {
if helpers.Exists(result + "/platforms") {
qt_prfxpath = filepath.Dir(result)
log.Println("Guessed qt_prfxpath to be", qt_prfxpath)
quirksModePatchQtPrfxPath = true
}
}
}

Can you spot it?

@Juuliuus
Copy link
Author

Could it be that the "plugins" also needs a preceeding / ?None of the quessed paths have an ending /, and the could not find 'plugins/platforms/...' does not have a preceeding slash...

That will depend on what is happening in FilesWithSuffixInDirectoryRecursive(qt_prfxpath, "plugins"). But I don't really see that as being the problem because other calls to that function use similar grammar and then there would be a lot of stuff failing.

One thing I don't understand and it may be of interest:
if helpers.Exists(result + "/platforms")

The "guessed at' messages are only printed if that conditional is true. But I checked here for several "guessed at"'s and only ../qt5 has a plugins folder that contains a platforms folder. So that's odd.

It did seem to me that other calls to FilesWithSuffixInDirectoryRecursive in that code are usually searching for files, not folders, but again since .../qt5 was successfully "guessed at" that probably isn't it either.

The FilesWithSuffixInDirectoryRecursive(qt_prfxpath, "plugins") function, it turns out, is looking for anything containing 'plugins' in its name because all of those other successes do not have a straight "plugin" file or "plugin" folder, more things like, for example:
/usr/lib/x86_64-linux-gnu/kconf_update_bin/krunnerplugins

But the condition "if helpers.Exists(result + "/platforms")" shouldn't be successful at all in most of these cases! Because most, like I said are files and therefore won't have "/platforms" folders appended on them. For instance, there is no:
/usr/lib/x86_64-linux-gnu/kconf_update_bin/krunnerplugins/platforms

So that conditional is failing somehow? There should really only be one success (.../qt5) and yet it guesses at 7 different paths.

Further, when the conditional is true I don't see it breaking out of the conditional loop? From what I see it will go through the entire range of results and returning the last "..plugins.. it found?

That's all I see. HTH.

@probonopd
Copy link
Owner

probonopd commented Jul 30, 2020

Indeed something strange is going on. Thanks for your analysis.
I hope I will find some time to look at this soon.

@probonopd probonopd added the bug Something isn't working label Jul 30, 2020
@probonopd
Copy link
Owner

Can you post the output of

log.Println("results", results)

on your system?

@probonopd
Copy link
Owner

probonopd commented Jul 30, 2020

I think this is fixed now @Juuliuus - please check using the latest build (start with a "fresh" AppDir)

I tested it on Kubuntu like this:

rm -rf appdir || true # Clean up
mkdir -p appdir/usr/bin
mkdir -p appdir/usr/share/applications
mkdir -p appdir/usr/share/icons
cp /usr/bin/kcalc appdir/usr/bin/
cp /usr/share/applications/org.kde.kcalc.desktop appdir/usr/share/applications/
mkdir -p appdir/usr/share/icons/hicolor/scalable/applications
cp /usr/share/icons/Humanity/apps/48/kcalc.svg appdir/usr/share/icons/hicolor/scalable/applications/
Downloads/appimagetool-492-x86_64.AppImage -s deploy appdir/usr/share/applications/org.kde.kcalc.desktop 

Log now says:

2020/07/30 16:58:21 Detected Qt 5
2020/07/30 16:58:21 Offset of qt_prfxpath: 3561388
2020/07/30 16:58:21 Length of value of qt_prfxpath: 4
2020/07/30 16:58:21 qt_prfxpath: /usr
2020/07/30 16:58:21 Got qt_prfxpath but it does not contain 'plugins'
2020/07/30 16:58:23 libqxcb.so found: [/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so]
2020/07/30 16:58:23 Guessed qt_prfxpath to be /usr/lib/x86_64-linux-gnu/qt5

@Juuliuus
Copy link
Author

Super! Unfortunately, my main computer chose this time to die. So stress. I will go to an older computer and give it a go in the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants