-
Notifications
You must be signed in to change notification settings - Fork 284
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
Generate AppImage #161
Generate AppImage #161
Conversation
[ci skip]
As can be seen toward the end of the build log at https://travis-ci.org/probonopd/qpdf/builds/297028605#L1040, the download URL (valid for 14 days) of a current build is |
This is a huge help. I've actually got setting up travis CI on my private to-do list. It may be a bit of time before I have time to actually look at this and do it, but I am very interested in doing it and appreciate your help in getting it set up. No promises, but I'll try to get to it in the next few weeks. qpdf is a 100% spare time project, and I don't have much spare time! I haven't studied this at all yet. I may have questions when I do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really good. I have a few minor questions. I'm inclined to just squash this as a single commit and accept it once my minor issues are addressed. I'd like to get this all going and have real CI on qpdf. While I use github day in and day out and have plenty of experience with various build, release, and CI systems (my day job is release engineering), I am brand new to travis-ci and have never used github releases other than the ones automatically created with tags. For now, I'm still using sourceforge for distributing things mainly because of its visibility. Is putting a signed AppImage on github something people would do, or is the expectation that AppImages always come from some known, central location?
I am very grateful for your work on this, and would be equally grateful for any comments you can make that help qpdf be a good model of how to exist in this ecosystem. Coincidentally, there is a user right now who is trying to figure out the easiest way to run qpdf 7.0.0 on Fedora Server 26, and it would be great if I could just point him to the AppImage.
Once my questions are answered, I think I can turn this around pretty fast. It doesn't look like there's really much for me to do, other than maybe creating a logo. :-)
.travis.yml
Outdated
dist: trusty | ||
|
||
script: | ||
- ./autogen.sh # Undocumented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really undocumented. The top-level README.md mentions this as a step when building from a pristine checkout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to https://github.com/qpdf/qpdf/blob/master/INSTALL, maybe this information could be added there too. Will remove my comment
.travis.yml
Outdated
- make install DESTDIR=$(readlink -f appdir) ; find appdir/ | ||
- rm -rf appdir/usr/include/ appdir/usr/lib/pkgconfig/ appdir/usr/lib/*.{a,la} # Don't bundle developer stuff | ||
- sudo mv appdir/usr/lib/* /usr/local/lib/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/160 | ||
- mkdir -p appdir/usr/share/icons/hicolor/128x128/apps ; cp dist/qpdf.png appdir/usr/share/icons/hicolor/128x128/apps/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking for a while that qpdf needs a logo or an icon or something. I'll put some thought into it. I guess since the icon is actually here in the qpdf repository, I can change it if/when I come up with something. If I were to design my own logo, I would probably create an SVG file for it. Can that be used, or would I need to generate the right resolution png file (which I can definitely do)?
- sudo mv appdir/usr/lib/* /usr/local/lib/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/160 | ||
- mkdir -p appdir/usr/share/icons/hicolor/128x128/apps ; cp dist/qpdf.png appdir/usr/share/icons/hicolor/128x128/apps/ | ||
- mkdir -p appdir/usr/share/applications ; cp dist/qpdf.desktop appdir/usr/share/applications/ | ||
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the qt stuff? Is it used elsewhere in AppImage, or are you just using it for functionality around bundling additional dependent libraries (jpeg and zlib)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linuxdeployqt
is the tool that does all the work of bundling libraries and making the AppDir, then the AppImage. It uses Qt internally. Not Qt will end up in the AppImage.
- export LD_LIBRARY_PATH=/usr/local/lib/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/160 | ||
- ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs | ||
- # In addition to the main executable, we have additional ones to process | ||
- # ./linuxdeployqt*.AppImage ./appdir/usr/bin/fix-qdf -bundle-non-qt-libs # Not an ELF? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix-qdf is a perl script. Will there be a version of perl here? Has fix-qdf been tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is currently, a compatible version of Perl must be available on the target system. Otherwise we would have to bundle Perl, which is doable but complex and would significantly increase the download size.
.travis.yml
Outdated
script: | ||
- ./autogen.sh # Undocumented | ||
- ./configure --prefix=/usr | ||
- make -j$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would feel a bit more comfortable if this were also followed by make check
to run the tests. The tests by default only add perl and gnu diff as an additional dependency, but that is the main diff in Linux so it's pretty much always there. You need perl for fix-qdf anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added.
- # Generate AppImage | ||
- ./linuxdeployqt*.AppImage --appimage-extract | ||
- rm ./appdir/AppRun ; cp dist/AppRun appdir/ ; chmod a+x ./appdir/AppRun # Replace symlink with custom script | ||
- PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool ./appdir/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an awful lot of boilerplate here. Is this just a reflection of the state of how one builds AppImages? This is not something I'd ever heard of. Over time, I'd like to make sure that this continues to work, possibly by setting up a way of running portions of qpdf's test suite using the AppImage. I see your AppRun script handles symlinks whose names match another binary. That's good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my impulse would be to have a script that builds the AppImage, to invoke the script as a make target, and to have the .travis.yml file invoke make AppImage
. In my day job, I avoid having lots of steps in any CI job. That would also make it easier for me to build an AppImage and test it locally, build a signed AppImage, create an ad-hoc one for giving to someone to test a fix, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally this would be done automatically by linuxdeployqt
in a step further above, but since we are using a custom AppRun
script to make the symlink trick work, we have to manually run the underlying appimagetool
(which is normally used by linuxdeployqt
).
But actually your comment makes me think that we would use the symlink trick for our own linuxdeployqt.AppImage as well, which would allow us to call appimagetool
without having to extract the AppImage first. I have opened a feature request on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my impulse would be to have a script that builds the AppImage, to invoke the script as a make target, and to have the .travis.yml file invoke make AppImage.
Converting the appropriate lines from .travis.yml
into a Makefile is something you would have to do because I am not accustomed to writing Makefiles.
|
||
after_success: | ||
- find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq | ||
- curl --upload-file ./QPDF*.AppImage https://transfer.sh/QPDF-git.$(git rev-parse --short HEAD)-x86_64.AppImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can anyone do this? How do you distinguish an official image? Can these be signed? How does the signature work from CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everyone can do this. The URL will be visible in the build log. This is useful, e.g., for pull requests. As for your official continuous builds and/or releases, you may consider to upload them to GitHub Releases instead. This way, they would be visible on the Releases page of your project. This is what I recommend. See https://docs.travis-ci.com/user/deployment/releases/. If you want to do this for continuous builds, also see https://github.com/probonopd/uploadtool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, AppImages can be GPG-signed but indeed it is a bit tricky to do on a CI tool like Travis CI. One way is to upload your private key inside an encrypted file that is protected by a password, and give the CI environment this password as a Travis CI secure environment variable. It's what we do for AppImageKit, here: https://github.com/AppImage/AppImageKit/blob/appimagetool/master/.travis.yml#L16-L18
BTW, I grabbed your AppImage, and fix-qdf does work with it. |
Cool. Let me know whether my answers sufficiently address your questions. If you would like to see only one entry for the Pull Request in your project's history, then please enable this GitHub functionality on your repo. It allows you to squash (combine) the commits when merging. |
Thanks! Yes, your answers address my concerns. What I'll most likely do is squash merge this into a new branch, make some changes of my own, and then merge to master when ready. I'm not sure when I'll do it, but hopefully very soon. I don't think it will be much work on my part. I'll leave this open and in its current form until I'm ready to grab it just in case you feel like making any additional changes. Thanks again for doing this! |
Hi @jberkenbilt is this still in the pipeline? Happy New Year. |
Yes, still in the pipeline. I may try to take some time off in the next few weeks to catch up. I was traveling over the holidays and didn't get to put time into this or the other open issues. |
I have accepted these changes by incorporating them into my branch and merging from there. |
This PR, when merged, will compile this application on Travis CI upon each
git push
, and upload an AppImage to a temporary download URL on transfer.sh (available for 14 days). The download URL is toward the end of each Travis CI build log of each build (see below for how to set up automatic uploading to your GitHub Releases page).For this to work, you need to enable Travis CI for your repository as described here prior to merging this, if you haven't already done so.
Providing an AppImage would have, among others, these advantages:
appimaged
Here is an overview of projects that are already distributing upstream-provided, official AppImages.
Please note: Instead of storing AppImage builds temporarily for 14 days each on transfer.sh, you could use GitHub Releases to store the binaries permanently. This way, they would be visible on the Releases page of your project. This is what I recommend. See https://docs.travis-ci.com/user/deployment/releases/. If you want to do this for continuous builds, also see https://github.com/probonopd/uploadtool.
If you would like to see only one entry for the Pull Request in your project's history, then please enable this GitHub functionality on your repo. It allows you to squash (combine) the commits when merging.
If you have questions, AppImage developers are on #AppImage on irc.freenode.net.
Closes #160