kicad-website icon indicating copy to clipboard operation
kicad-website copied to clipboard

AppImages for Linux

Open KarlZeilhofer opened this issue 5 years ago • 24 comments

Hi,

I've published my builds of AppImages on Github. This should close issue #257. https://github.com/KarlZeilhofer/kicad-appimage

What are the requirements, that they are mentioned in the download section of the KiCad website?

Kind regards, Karl

KarlZeilhofer avatar Jan 08 '19 11:01 KarlZeilhofer

On first look it looks good. I like to be able to see the build scripts as you shared. We could move the repo under the kicad org to make it easier to maintain and consider official. We could make it be built by jenkins, such that we can get regular nightlies updated.

nickoe avatar Jan 08 '19 12:01 nickoe

in case of gitlab we managed to build a gitlab-ci script to output appimages of kicad nightlies: https://gitlab.com/kicad-mirror/kicad-source-mirror/pipelines

pointhi avatar Jan 08 '19 13:01 pointhi

Please feel free to clone the repo or at least the recipes. If everything is in the official repo, I will delete mine.

KarlZeilhofer avatar Jan 08 '19 22:01 KarlZeilhofer

@pointhi I can't find the source or command used, please share.

nickoe avatar Jan 10 '19 09:01 nickoe

  • Buildscript: https://gitlab.com/kicad-mirror/kicad-source-mirror/blob/feature/gitlab-ci/.gitlab-ci.yml
  • Dockerfile: https://gitlab.com/kicad-mirror/kicad-docker/tree/master/kicad-builder

pointhi avatar Jan 10 '19 11:01 pointhi

@nickoe I've tryed to contact you before in order to move the docker image to the official repo. I've created both the docker image and the CI script. Any question feel free to ping me.

Thanks!

antoniovazquezblanco avatar Jan 10 '19 11:01 antoniovazquezblanco

@pointhi I get 404 for the kicad-docker repo

nickoe avatar Jan 10 '19 12:01 nickoe

@antoniovazquezblanco what is that zsync stuff? I couldn't immediately figure out what it was for attempting to browse the appimage doc.

nickoe avatar Jan 10 '19 12:01 nickoe

I've tryed to contact you before in order to move the docker image to the official repo.

@antoniovazquezblanco I am not sure when you did try this. I can't find any references about this. Maybe there was no link to the dockerfile and buldscript and I may have ignored it.

nickoe avatar Jan 10 '19 12:01 nickoe

@pointhi I get 404 for the kicad-docker repo

For some reason it is set to be a private repo I do not have permissions to change it. @pointhi will be able to do it.

@antoniovazquezblanco what is that zsync stuff? I couldn't immediately figure out what it was for attempting to browse the appimage doc.

It is a file that allows Appimage updating: https://github.com/AppImage/AppImageSpec/blob/master/draft.md#update-information

@antoniovazquezblanco I am not sure when you did try this. I can't find any references about this. Maybe there was no link to the dockerfile and buldscript and I may have ignored it.

My bad. I will try to be more concise the next time. Sorry about not being as focused as I was expected to.

Thank you!

antoniovazquezblanco avatar Jan 10 '19 13:01 antoniovazquezblanco

@antoniovazquezblanco running your container as non-root did not work, because there were some permission bits not set well for linuxdeploy. I had to do the follwoing to make it work: for i in $(find /usr/lib/linuxdeploy/ -type d -perm 700 -o -perm 711) ; do echo $i; chmod +rwx $i ;done

nickoe avatar Jan 12 '19 13:01 nickoe

@nickoe I've pushed a fix. A new image is available for testing if the issue persists. I've also triggered a new Appimage build in the source repo.

antoniovazquezblanco avatar Jan 12 '19 15:01 antoniovazquezblanco

@antoniovazquezblanco While we are at it, are you able to respond to me question about this commit? https://gitlab.com/kicad-mirror/kicad-docker/commit/f5218b02fcda458750488c64beafb9e711596138

The one where you change the base from 18.04 to 16.04. Both are LTS releases that are still supported by canonical.

Secondly, I don't get a .zsync file when I build with the linuxdeploy command you are using in your yaml file.

nickoe avatar Jan 12 '19 21:01 nickoe

@KarlZeilhofer Not to despice your work, but I think building from source is better than repackaging the PPA packages. Does python work in your builds? I see wxpython is not enabled.

@antoniovazquezblanco In your version of the app images wxpython is enabled, but it looks like the python stuff is not bundled. It get the warning that:

22:01:22: ***** Error importing the wxPython API! *****
22:01:22: pcbnewInitPythonScripting() failed.

Which means that the footprint wizards does not work, nor the python console.

And I also see this in the shell where I started the appimage:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/_core.py", line 4, in <module>
    import _core_
ImportError: /usr/lib/libatk-bridge-2.0.so.0: undefined symbol: atk_component_scroll_to_point

nickoe avatar Jan 13 '19 21:01 nickoe

@nickoe Good point about Python. I'm not sure, if it works, I've never used python scripting within KiCad. The footprint wizard seems to be working.

KarlZeilhofer avatar Jan 14 '19 09:01 KarlZeilhofer

@antoniovazquezblanco While we are at it, are you able to respond to me question about this commit?

Done

Secondly, I don't get a .zsync file when I build with the linuxdeploy command you are using in your yaml file.

The tool is guessing the info from env variables available at the build machine. If you have a look at the build log (https://gitlab.com/kicad-mirror/kicad-source-mirror/-/jobs/144913393) you can find:

[appimage/stderr] zsyncmake is available and updateinformation is provided, hence generating zsync file
[appimage/stdout] /builds/kicad-mirror/kicad-source-mirror/build/AppDir should be packaged as KiCad-x86_64.AppImage
[appimage/stdout] Guessing update information based on $CI_COMMIT_REF_NAME=feature/gitlab-ci and $CI_JOB_NAME=all
[appimage/stdout] zsync|https://gitlab.com/kicad-mirror/kicad-source-mirror/-/jobs/artifacts/feature/gitlab-ci/raw/KiCad-x86_64.AppImage.zsync?job=all

In your version of the app images wxpython is enabled, but it looks like the python stuff is not bundled.

I don't know what could be causing this. I will need to have a look with a little bit more patience. If you see anything that could point me in the right direction please guide me. In case you didn't know, the latest appimage build log can be found at https://gitlab.com/kicad-mirror/kicad-source-mirror/-/jobs/144913393

Thank you

antoniovazquezblanco avatar Jan 14 '19 11:01 antoniovazquezblanco

Maybe the PYTHONPATH is needed to point to the stuff in App something and be passed on for linuxdeploy.

nickoe avatar Jan 14 '19 12:01 nickoe

During the weekend I had a look at this. It seems linuxdeploy does not pack python and python package dependencies. There is a conda plugin for linuxdeploy that I have added to the kicad-builder image.

The next steps would be to build KiCad using conda as the python dependency manager and to add conda deps to linuxdeploy and the issue with python support should be solved.

If anyone has compiled KiCad with conda any help would be apreciated as I do not have much spare time at the moment.

antoniovazquezblanco avatar Mar 18 '19 09:03 antoniovazquezblanco

Can't you just copy the normal python with linuxdeploy? I don't think it needs to use conda.

nickoe avatar Mar 21 '19 10:03 nickoe

From what I've read that should do the trick although I read that the conda way was a little bit more "standard". I need time to have a look at this and unfortunately I do not have much lately.

Related stuff: https://github.com/AppImage/AppImageKit/issues/131

antoniovazquezblanco avatar Mar 21 '19 19:03 antoniovazquezblanco

Great effort @KarlZeilhofer and @antoniovazquezblanco :+1: Thank you.

I agree that generally it's better to build for AppImage specifically rather than to re-package deb files. Regarding Python, Conda is not needed but it seems to do the job rather well. You need to ensure that the whole Python and all its needed modules are bundled, as you cannot rely on Python being on the host system.

Please let me know if you need assistance with anything AppImage related.

probonopd avatar May 04 '19 13:05 probonopd

what is that zsync stuff?

It's described in detail at https://github.com/AppImage/AppImageUpdate.

Unfortunately it's currently broken for GitLab. Works on GitHub and many other file hosts tough. https://github.com/AppImage/AppImageUpdate/issues/94

probonopd avatar May 04 '19 14:05 probonopd

Can't you just copy the normal python with linuxdeploy? I don't think it needs to use conda.

Regarding bundling Python (without Conda), see what we are using for the Inkscape AppImage:

https://gitlab.com/inkscape/inkscape/blob/master/packaging/appimage/generate.sh

probonopd avatar May 04 '19 14:05 probonopd

I just uploaded an AppImage for V5.1.2: https://github.com/KarlZeilhofer/kicad-appimage/releases/tag/v5.1.2

KarlZeilhofer avatar Jul 04 '19 14:07 KarlZeilhofer