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

Set up continuous integration #20

Merged
merged 111 commits into from
Jul 12, 2019
Merged

Set up continuous integration #20

merged 111 commits into from
Jul 12, 2019

Conversation

loicgilbert
Copy link
Contributor

Built project on Linux and Windows, with python 3.6 and 3.7 on both using Appveyor.
(close #10, close#11 )

@loicgilbert
Copy link
Contributor Author

Also, we'll need a script with instructions detailing how to sign the Windows binary for redistribution. I'm going to leave the electronic signature dongle on your table.

I have no idea how to do that. Any usefull link or ressource?

appveyor.yml Outdated
- cmd: "7z a zubax-kucher.7z *"
- sh: "7z a zubax-kucher.7z * &>/dev/null &"
- "appveyor PushArtifact zubax-kucher.7z"
- "pyinstaller pyinstaller.spec"
Copy link
Member

Choose a reason for hiding this comment

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

Invoking PyInstaller directly is not quite correct. On GNU/Linux, we must use StaticX to produce a truly portable executable, as implemented in this build script: https://github.com/Zubax/kucher/blob/appveyor-CI/build_linux.sh. Running just PyInstaller is not sufficient since the resulting executable ends up being dependent on a particular version of libGL, which is disastrous for redistributable executables. So when building for GNU/Linux, invoke the above script. For consistency, I recommend defining an equivalent build script for Windows, despite the fact that no additional steps are needed there (yet).

Now, there was a problem with StaticX that I described here: JonathonReinhart/staticx#79. Jonathon said that I should look into the dependencies to try and find out which one pulls in the unnecessary stuff. Shortly after receiving that reply I realized that the problem might be with the PyQtGraph library, which is no longer needed anyway (see #21). I suggest to remove PyQtGraph and then see if StaticX is able to link a portable executable.

@pavel-kirienko
Copy link
Member

I have no idea how to do that. Any usefull link or ressource?

@loicgilbert I'm going to pull this into a separate issue. No need to fix this in this PR.

@pavel-kirienko
Copy link
Member

pavel-kirienko commented Jul 4, 2019

To summarize, what's left here is:

  • comments about QT_QPA_PLATFORM=offscreen
  • build script for Windows
  • on GNU/Linux, use the build script instead of invoking PyInstaller directly due to portability issues

If the last one can't be fixed easily, we could comment out the staticx part temporarily and fix it in a separate pr later.

@pavel-kirienko
Copy link
Member

Okay, almost done here. Having StaticX like this is not the best idea since it clutters our repo with a third-party codebase. What I meant when I said that we should fork it is that there should be a separate repository under the Zubax org which is a fork of StaticX; the fork can be created by clicking the aptly named button "Fork" in the upper-right side of the StaticX's GitHub page. GitHub will ask you where you want it forked, pick "Zubax" (I believe you have the necessary permissions for that). Then apply our patch there and add the patched repo as a submodule under kucher/libraries. That should be it.

@pavel-kirienko
Copy link
Member

Please also drop the PyQtGraph submodule from kucher/libraries as discussed, I just noticed that it's still there.

build_linux.sh Outdated

pyinstaller --clean --noconfirm pyinstaller.spec || exit 2
cd kucher/libraries/staticx
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cd kucher/libraries/staticx
pushd kucher/libraries/staticx

build_linux.sh Outdated

# https://github.com/JonathonReinhart/staticx/issues/79
cd dist
cd ../../../dist
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cd ../../../dist
popd
pushd dist

build_linux.sh Outdated
mv Kucher Kucher.tmp
staticx --loglevel DEBUG Kucher.tmp Kucher

rm -rf *.tmp
cd ..
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cd ..
popd

build_linux.sh Outdated
@@ -4,12 +4,20 @@
#

sudo apt-get install patchelf -y
sudo apt install gcc
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sudo apt install gcc
sudo apt-get install -y gcc

Missing -y and changed apt to apt-get for consistency.

build_linux.sh Outdated
@@ -4,12 +4,20 @@
#

sudo apt-get install patchelf -y
sudo apt install gcc
sudo apt-get install scons
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sudo apt-get install scons
sudo apt-get install -y scons

@pavel-kirienko pavel-kirienko merged commit 85df884 into master Jul 12, 2019
@pavel-kirienko pavel-kirienko deleted the appveyor-CI branch July 12, 2019 09:18
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.

Build Windows executables Continuous integration & testing
2 participants