1
0
Commit Graph

114 Commits

Author SHA1 Message Date
SomberNight
65ae281180 build: don't hardcode num worker threads "make -j4" 2022-12-03 22:50:18 +00:00
Sander van Grieken
c0772019f1 rerun freeze_container_distro.sh and update docker base images for debian buster and bullseye 2022-11-06 10:42:39 +01:00
SomberNight
1e404f4e30 binaries: update python and openssl
note: python 3.9.x is now in source-only mode, so could not update to latest...
it is time to investigate upgrading to python 3.10 in the win and mac binaries
2022-11-05 14:41:23 +00:00
SomberNight
6f311c8930 appimage build: better caching, both locally and on CI 2022-11-04 15:49:16 +00:00
SomberNight
34488478e6 appimage build: build and include libxcb-util1
fixes https://github.com/spesmilo/electrum/issues/8011

> Upgraded from Appimage 4.1.5 to 4.3.2 on MX-Linux 19.
> The new version fails to start with:
>
> ```
> $ electrum
> qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
> This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may > fix this problem.
>
> Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
>
> Aborted (core dumped)
> ```

debian 10 only distributes libxcb-util0.
debian 11 distributes libxcb-util1.
our base image atm is debian 10, so we build the package from source.
2022-10-11 18:24:02 +00:00
SomberNight
b5900eae98 contrib: reformat most shell scripts
Mostly just indentations.
For consistency, to conform to .editorconfig.
2022-09-27 14:55:22 +00:00
SomberNight
0abecffe6d mac build: force using source dist for most of our python dependencies
We compile from tar.gz, instead of using pre-built binary wheels from PyPI.
(or if the dep is pure-python, use tar.gz instead of "source-only" wheel)

-----
Some unorganised things below for future reference.

```
$ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory
---
triple:          'x86_64-apple-darwin'
binary-path:     'dist1/hid.cpython-39-darwin.so'
...
```

```
$ nm -pa dist1/hid.cpython-39-darwin.so
```

- https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable
- https://github.com/pypa/pip/issues/6505
- https://github.com/pypa/pip/issues/7808#issuecomment-770275723
- https://github.com/NixOS/nixpkgs/pull/91272
- https://github.com/cython/cython/pull/1576
- 9d2ba1611b/Cython/Compiler/ModuleNode.py (L913)
2022-09-26 12:16:02 +00:00
SomberNight
4f574afe5a Merge remote-tracking branch 'remotes/spesmilo/appimage-debian-base'
Change Docker base images from Ubuntu to Debian, and use `snapshot.debian.org` as apt source list.
Ubuntu occasionally removes version-pinned packages from apt (see #7484), which
- breaks historical reproducible builds
- introduces maintenance burden as we have to update the version pins
Hopefully this change fixes both issues.

merges https://github.com/spesmilo/electrum/pull/7926
closes https://github.com/spesmilo/electrum/issues/7484
2022-08-22 13:10:25 +00:00
SomberNight
019d213325 Revert "mac build: force using source dist for most of our python dependencies"
This reverts commit 0c2a885c66.

Reverting for now due to reproducibility issues:
```
error: /Users/vagrant/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: can't open file: /tmp/electrum_compare_dmg/signed_app/Electrum.app/Contents/MacOS/libffi.8.dylib (No such file or directory)
```
`Electrum.app/Contents/MacOS/libffi.8.dylib` is included when building on one machine, but missing on the other...
Will have to investigate later.

related https://github.com/spesmilo/electrum/pull/7918
2022-08-17 17:07:22 +00:00
SomberNight
c2b5e3ec15 build: use build-locale.sh in all build scripts 2022-08-16 19:06:47 +00:00
Sander van Grieken
f63df43614 wine: rename freeze_appimage_distro.sh to freeze_containers_distro.sh and
adapt build-wine container to Debian+snapshots base
2022-08-11 12:36:48 +02:00
Sander van Grieken
a1975e2449 appimage: add freeze_appimage_distro.sh and adapt Dockerfile to use debian buster base 2022-08-11 12:15:22 +02:00
SomberNight
7e2fab809d appimage build: better parameterise python version 2022-08-10 21:03:55 +02:00
SomberNight
0c2a885c66 mac build: force using source dist for most of our python dependencies
We compile from tar.gz, instead of using pre-built binary wheels from PyPI.
(or if the dep is pure-python, use tar.gz instead of "source-only" wheel)

-----
Some unorganised things below for future reference.

```
$ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory
---
triple:          'x86_64-apple-darwin'
binary-path:     'dist1/hid.cpython-39-darwin.so'
...
```

```
$ nm -pa dist1/hid.cpython-39-darwin.so
```

- https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable
- https://github.com/pypa/pip/issues/6505
- https://github.com/pypa/pip/issues/7808#issuecomment-770275723
- https://github.com/NixOS/nixpkgs/pull/91272
- https://github.com/cython/cython/pull/1576
- 9d2ba1611b/Cython/Compiler/ModuleNode.py (L913)
2022-08-06 07:52:03 +02:00
gruve-p
bc5b5eb0b1 appimage: Bump git
https://launchpad.net/ubuntu/+source/git/1:2.17.1-1ubuntu0.12
2022-07-20 15:45:01 +02:00
gruve-p
e50db4bf2b appimage: update libssl-dev libssl1.1 openssl
Windows image: update gnupg2 dirmngr
2022-07-09 14:41:41 +02:00
gruve-p
29ab90e1b1 appimage: update libssl-dev libssl1.1 openssl (#7869) 2022-06-24 05:05:09 +00:00
SomberNight
1fedb23946 appimage: update package (libdbus-1-3) in dockerfile 2022-05-11 18:08:36 +02:00
gruve-p
eb66ed8e4b appimage: update libssl-dev libssl1.0.0 openssl libsqlite3-dev (#7798) 2022-05-05 14:57:35 +00:00
ghost43
c45170acfb Merge pull request #7785 from SomberNight/202204_bump_appimage
build appimage: bump pkg2appimage version
2022-04-26 18:29:10 +00:00
Michel van Kessel
54f5ad46b3 appimage: update package (git) in dockerfile (#7786)
https://launchpad.net/ubuntu/+source/git/1:2.17.1-1ubuntu0.11
2022-04-26 18:28:29 +00:00
SomberNight
6633ef4c35 build appimage: bump pkg2appimage version
should fix https://github.com/spesmilo/electrum/issues/7784
by including commit 1e3ecde6b9
2022-04-25 21:04:46 +02:00
gruve-p
75044f334b appimage: update git 2022-04-14 22:53:46 +02:00
SomberNight
634611272a build appimage: make binary somewhat smaller by excluding stuff
4.1.5->4.2.1, the appimage grew 54M->66M. This change shrinks it back to 58M.
```
$ ls -lah
total 224M
drwxrwxr-x  5 user user 4.0K Mar 27 18:18 .
drwxrwxr-x 16 user user 4.0K Mar 23 16:02 ..
-rwxrw-r--  1 user user  48M Dec 18  2020 electrum-4.0.9-x86_64.AppImage
-rwxrw-r--  1 user user  54M Jan 19 14:25 electrum-4.1.5-x86_64.AppImage
-rwxr-xr-x  1 user user  58M Mar 27 18:12 electrum-4.2.1-dirty-x86_64.AppImage
-rwxrw-r--  1 user user  66M Mar 27 15:00 electrum-4.2.1-x86_64.AppImage
```
I've used the great `ncdu` tool to investigate file sizes.
```
$ du squashfs-root-415/usr/lib/python3.7/ --max-depth=1 | sort -nr | head -n8
154608	squashfs-root-415/usr/lib/python3.7/
138864	squashfs-root-415/usr/lib/python3.7/site-packages
4720	squashfs-root-415/usr/lib/python3.7/lib-dynload
1744	squashfs-root-415/usr/lib/python3.7/encodings
664	squashfs-root-415/usr/lib/python3.7/pydoc_data
460	squashfs-root-415/usr/lib/python3.7/distutils
460	squashfs-root-415/usr/lib/python3.7/asyncio
436	squashfs-root-415/usr/lib/python3.7/email

$ du squashfs-root-421/usr/lib/python3.9/ --max-depth=1 | sort -nr | head -n8
194088	squashfs-root-421/usr/lib/python3.9/
143512	squashfs-root-421/usr/lib/python3.9/site-packages
33824	squashfs-root-421/usr/lib/python3.9/config-3.9-x86_64-linux-gnu
5244	squashfs-root-421/usr/lib/python3.9/lib-dynload
1720	squashfs-root-421/usr/lib/python3.9/encodings
696	squashfs-root-421/usr/lib/python3.9/pydoc_data
520	squashfs-root-421/usr/lib/python3.9/asyncio
464	squashfs-root-421/usr/lib/python3.9/distutils
```
We should delete `usr/lib/python3.9/config-3.9-x86_64-linux-gnu/` (which is 33M unpacked)
With py3.7 (electrum 4.1.5), this folder was named `config-3.7m-x86_64-linux-gnu`,
presumably because the default config to compile py3.7 was `--with-pymalloc`,
but maybe it is not for py3.9... ? not sure. (see https://peps.python.org/pep-3149/ )
2022-03-27 19:27:55 +02:00
SomberNight
98d32f41d5 build: (reproducibility) always uses "pip install" with "--no-build-isolation"
fixes https://github.com/spesmilo/electrum/issues/7737
fixes https://github.com/spesmilo/electrum/issues/7736
related 8559d1eb72
2022-03-26 02:45:47 +01:00
SomberNight
1bb7ef92e7 binaries: bump python 3.9.10->3.9.11; and for android 3.8.12->3.8.13
This is bumping the python versions bundled inside our binaries.
For macOS and AppImage, from 3.9.10 to 3.9.11.
For Android, from 3.8.12 to 3.8.13.

Windows is left untouched as I am having issues with the wine build when using 3.9.11.
(see https://github.com/spesmilo/electrum/pull/7721#issuecomment-1071901116 )
2022-03-18 16:21:24 +01:00
gruve-p
1aa831c7d9 appimage: update libssl-dev libssl1.0.0 openssl (#7715) 2022-03-15 23:45:49 +00:00
SomberNight
b726fe85e1 contrib: add docker_notes.md 2022-03-03 19:24:22 +01:00
SomberNight
0df8392c86 build: rm need for sudo in most places; and do not run as root
This includes two logically separate changes:
- on the host, try not to require sudo when running the build scripts
    - namely when interacting with the docker daemon, this requires
      the unix user on the host to be part of the `docker` group
    - this solves part of https://github.com/spesmilo/electrum/issues/7602
- while running inside the docker containers, do not run as root
    - this means that e.g. files created in mounted folders should
      no longer be owned by root on the host
    - there is some code duplication involved here - not sure
      how it could be deduped.
2022-03-03 19:24:18 +01:00
SomberNight
cdfc75ff2b appimage: update package (libc) in dockerfile
Ubuntu no longer serves old version
2022-03-03 19:22:52 +01:00
SomberNight
5e2cee6a31 build appimage: rm importlib-metadata workaround
The importlib-metadata pkg is no longer needed apparently (since we bumped the min python to 3.8).
2022-02-22 17:14:23 +01:00
SomberNight
bb5b52f2d7 binaries: bump python 3.9.7->3.9.10 2022-02-17 16:51:13 +01:00
vertion
906c4c4e2c appimage build: update libudev-dev libudev1 (#7629)
(cherry picked from commit 19a9a151e8832a55444f3815df3a1ca35fdb1674)
2022-01-18 14:47:29 +00:00
SomberNight
ca2d1eea45 build appimage: update appimagetool and stop using fork of mksquashfs
The latest release of appimagetool bundles a new enough version of
mksquashfs. We had been building a fork of mksquashfs but all the
relevant patches there had been upstreamed.

Note: we still need a wrapper when calling mksquashfs, as appimagetool
calls it with "-mkfs-time 0" and we have the SOURCE_DATE_EPOCH env var
set; and these two would conflict.
Two ways to fix: either unset SOURCE_DATE_EPOCH for that context, or
build a wrapper that removes the "-mkfs-time 0". The former would be
cleaner but for some reason I did not manage to build reproducibly
that way. The latter seems to work.

related:
- https://github.com/AppImage/AppImageKit/issues/929#issuecomment-580769875
  > Now official squashfs 4.4 makes reproducible images by default
- https://github.com/AppImage/AppImageKit/pull/996
2021-09-23 18:49:44 +02:00
SomberNight
11146d352f appimage build: bump python 3.8.12->3.9.7 2021-09-20 19:31:41 +02:00
SomberNight
fb3ce438d6 appimage build: bump python 3.7.10->3.8.12 2021-09-20 19:31:38 +02:00
SomberNight
5d0aa63adb appimage build: change base to ubuntu 18.04
ubuntu 16.04 is EOL
2021-09-20 19:31:33 +02:00
gruve-p
475d41e42e appimage: update libssl-dev libssl1.0.0 openssl (#7472) 2021-09-07 14:18:21 +00:00
SomberNight
f1e77b6e43 build: update zbar to fix build issue with autoconf 2.70
see https://github.com/Electron-Cash/Electron-Cash/pull/2143
see https://github.com/mchehab/zbar/issues/132
2021-06-25 16:44:35 +02:00
SomberNight
9d46fe775a build: try to consolidate instructions and decr codedupe in release.sh 2021-06-18 17:10:15 +02:00
SomberNight
3df1c3bbf7 build: rename some scripts
also, merge sdist/build.sh and sdist/make_tgz into sdist/make_sdist.sh
2021-06-18 16:29:03 +02:00
Thorsten Hempel
b990ff78a5 appimage: update libc6-dev package (#7299) 2021-06-04 08:36:23 +00:00
ThomasV
7c3f1d9e65 appimage: update libudev-dev package 2021-04-17 12:16:54 +02:00
SomberNight
4e91555d56 appimage build: bundle dependencies of Qt xcb plugin
fixes #7198

We recently bumped the bundled version of PyQt (5.14.2->5.15.4).
It seems the new version has a lot more dynamic dependencies.

From https://doc.qt.io/qt-5/linux-requirements.html :
> From Qt 5.15 onwards, Qt does require libxcb 1.11. Also, the -qt-xcb
> configure option got removed that was bundling some of the libs below.

We are using the prebuilt wheels for PyQt5 from PyPI. Presumably those
had previously been built using the -qt-xcb option.
2021-04-12 18:21:57 +02:00
SomberNight
c23fca37d4 build: clarify which locale files are included
related: 2cb4e56be3
2021-03-31 17:00:39 +02:00
Axel Gembe
6e1caf7e88 AppImage build: Include libxcb into the image
Ubuntu 20.04 needs `libxcb-xinerama.so.0`
and Debian 10 needs `libxcb-util.so.1` for the Qt `xcb` plugin.

-----

ported from 380f04a805

see https://github.com/Electron-Cash/Electron-Cash/issues/2196

-----

In particular, see this comment:

>> I confirmed that both Ubuntu 20.04 and Debian 10.8 clean install have an issue with the 4.2.4 AppImage.
>
> Any idea what broke it? I assume it used to work.

Yes, it did work in 4.2.3 which used PyQt5 5.13.2. I just had a look at the xcb plugin and it definitely has less dependencies:
```
ago@ubuntu2004vm:~/src/Electron-Cash/dist$ ldd squashfs-root/usr/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so|grep xcb
        libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f0ec9d07000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0ec9cdd000)
        libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007f0ec6ead000)
```

compared to PyQt5 5.15.2 in 4.2.4:
```
ago@ubuntu2004vm:~/src/Electron-Cash/dist$ ldd squashfs-root/usr/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so|grep xcb
        libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fcb5715f000)
        libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007fcb57158000)
        libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007fcb56f51000)
        libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fcb56f4c000)
        libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007fcb56d46000)
        libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007fcb56d41000)
        libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fcb56d2e000)
        libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007fcb56d27000)
        libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fcb56d16000)
        libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007fcb56d11000)
        libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fcb56d07000)
        libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fcb56cfd000)
        libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fcb56cf8000)
        libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fcb56cda000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fcb56cae000)
```
2021-03-27 21:41:09 +01:00
SomberNight
eaffced6dd binaries: bump python version 2021-03-13 16:52:19 +01:00
SomberNight
6e6e956de4 appimage build: adapt to new PyQt (5.15.3+) layout 2021-03-13 16:52:15 +01:00
gruve-p
abc155b688 Appimage build: update git=1:2.7.4-0ubuntu1.10 15b5d9d (#7091) 2021-03-09 23:35:02 +00:00
SomberNight
dded25f398 windows build: cache pip downloads 2021-03-07 22:12:26 +01:00