spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.38k stars 3.07k forks source link

Trying to build Windows binaries on Ubuntu using Docker fails with the error "build-electrum-git failed" #7621

Closed sindereis closed 1 year ago

sindereis commented 2 years ago

I've been trying to build Electrum for Windows on my Ubuntu VM using Docker 20.10.12 but I keep getting the "build-electrum-git failed" error after a while.

I don't know if it is important but I made some modifications to the source code I cloned: changed a little bit the GUI to make it more "personal" so to say.

Here is the full log:

cuckoo@cuckoo-virtual-machine:~/Desktop/electrum-master/contrib/build-wine$ ./build.sh
💬 INFO:  building docker image.
[sudo] password for cuckoo: 
Sending build context to Docker daemon  31.28MB
Step 1/6 : FROM ubuntu:20.04@sha256:c95a8e48bf88e9849f3e0f723d9f49fa12c5a00cfc6e60d2bc99d87555295e4c
 ---> f643c72bc252
Step 2/6 : ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
 ---> Using cache
 ---> 12a180ef396a
Step 3/6 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 5c204b97b789
Step 4/6 : RUN dpkg --add-architecture i386 &&     apt-get update -q &&     apt-get install -qy         wget=1.20.3-1ubuntu1         gnupg2=2.2.19-3ubuntu2.1         dirmngr=2.2.19-3ubuntu2.1         python3-software-properties=0.98.9.2         software-properties-common=0.98.9.2         &&     rm -rf /var/lib/apt/lists/* &&     apt-get autoremove -y &&     apt-get clean
 ---> Using cache
 ---> 13a1f8223e0d
Step 5/6 : RUN apt-get update -q &&     apt-get install -qy         git=1:2.25.1-1ubuntu3         p7zip-full=16.02+dfsg-7build1         make=4.2.1-1.2         mingw-w64=7.0.0-2         mingw-w64-tools=7.0.0-2         win-iconv-mingw-w64-dev=0.0.8-3         autotools-dev=20180224.1         autoconf=2.69-11.1         autopoint=0.19.8.1-10build1         libtool=2.4.6-14         gettext=0.19.8.1-10build1         &&     rm -rf /var/lib/apt/lists/* &&     apt-get autoremove -y &&     apt-get clean
 ---> Using cache
 ---> f8cd996785f8
Step 6/6 : RUN wget -nc https://dl.winehq.org/wine-builds/Release.key &&         echo "c51bcb8cc4a12abfbd7c7660eaf90f49674d15e222c262f27e6c96429111b822 Release.key" | sha256sum -c - &&         apt-key add Release.key &&         rm Release.key &&     wget -nc https://dl.winehq.org/wine-builds/winehq.key &&         echo "78b185fabdb323971d13bd329fefc8038e08559aa51c4996de18db0639a51df6 winehq.key" | sha256sum -c - &&         apt-key add winehq.key &&         rm winehq.key &&     apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ &&     apt-get update -q &&     apt-get install -qy         wine-stable-amd64:amd64=6.0.2~focal-1         wine-stable-i386:i386=6.0.2~focal-1         wine-stable:amd64=6.0.2~focal-1         winehq-stable:amd64=6.0.2~focal-1         &&     rm -rf /var/lib/apt/lists/* &&     apt-get autoremove -y &&     apt-get clean
 ---> Using cache
 ---> adaaf8ca9fcc
Successfully built adaaf8ca9fcc
Successfully tagged electrum-wine-builder-img:latest
💬 INFO:  not doing fresh clone.
💬 INFO:  building binary...
💬 INFO:  Clearing /opt/wine64/drive_c/electrum/contrib/build-wine/build and /opt/wine64/drive_c/electrum/contrib/build-wine/dist...
💬 INFO:  libsecp256k1 already built, skipping
💬 INFO:  libzbar already built, skipping
💬 INFO:  libusb already built, skipping
💬 INFO:  Booting wine.
Could not find Wine Gecko. HTML rendering will be disabled.
Could not find Wine Gecko. HTML rendering will be disabled.
wine: configuration in L"/opt/wine64" has been updated.
💬 INFO:  Installing Python.
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/keyring-electrum-build-python-dev.gpg' created
gpg: key FC624643487034E5: 5 signatures not checked due to missing keys
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key FC624643487034E5: public key "Steve Dower (Python Release Signing) <steve.dower@microsoft.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no ultimately trusted keys found
Installing core...
Installing dev...
Installing exe...
Installing lib...
Installing pip...
Installing tools...
💬 INFO:  Intentionally breaking legacy easy_install.
💬 INFO:  Installing build dependencies.
Collecting altgraph==0.17.2
  Using cached altgraph-0.17.2-py2.py3-none-any.whl (21 kB)
Collecting future==0.18.2
  Using cached future-0.18.2.tar.gz (829 kB)
Collecting pefile==2021.9.3
  Using cached pefile-2021.9.3.tar.gz (72 kB)
Collecting pip==21.3.1
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting pyinstaller-hooks-contrib==2021.3
  Using cached pyinstaller_hooks_contrib-2021.3-py2.py3-none-any.whl (200 kB)
Collecting pywin32-ctypes==0.2.0
  Using cached pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting setuptools==49.6.0
  Using cached setuptools-49.6.0-py3-none-any.whl (803 kB)
Collecting wheel==0.37.0
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Using legacy 'setup.py install' for future, since package 'wheel' is not install
ed.
Using legacy 'setup.py install' for pefile, since package 'wheel' is not install
ed.
Installing collected packages: wheel, setuptools, pywin32-ctypes, pyinstaller-ho
oks-contrib, pip, pefile, future, altgraph
  Attempting uninstall: setuptools
    Found existing installation: setuptools 57.4.0
    Uninstalling setuptools-57.4.0:
      Successfully uninstalled setuptools-57.4.0
  Attempting uninstall: pip
    Found existing installation: pip 21.2.3
    Uninstalling pip-21.2.3:
      Successfully uninstalled pip-21.2.3
    Running setup.py install for pefile ... done
    Running setup.py install for future ... done
Successfully installed altgraph-0.17.2 future-0.18.2 pefile-2021.9.3 pip-21.3.1 
pyinstaller-hooks-contrib-2021.3 pywin32-ctypes-0.2.0 setuptools-49.6.0 wheel-0.
37.0
💬 INFO:  Installing NSIS.
💬 INFO:  Building PyInstaller.
💬 INFO:  pyinstaller already built, skipping
💬 INFO:  Installing PyInstaller.
Processing c:\electrum\contrib\build-wine\.cache\win32\pyinstaller
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyinstaller
  Building wheel for pyinstaller (pyproject.toml) ... done
  Created wheel for pyinstaller: filename=pyinstaller-4.2-py3-none-any.whl size=
1680825 sha256=70328b3c00b878db6de06ab6c26efe9f26f1da38e74c9eb8ca127fa48615b652 
  Stored in directory: C:\users\root\Temp\pip-ephem-wheel-cache-7fm1qeok\wheels\
02\5d\5d\a2456fbf36665aa1dd7d9579b0e987e0e27afd76f31dce4f50
Successfully built pyinstaller
Installing collected packages: pyinstaller
Successfully installed pyinstaller-4.2
💬 INFO:  Wine is configured.
💬 INFO:  Resetting modification time in C:\Python...
/opt/wine64/drive_c/python3 /opt/wine64/drive_c/electrum/contrib/build-wine
/opt/wine64/drive_c/electrum/contrib/build-wine
total 5848
drwxr-xr-x  2 root root    4096 Nov 11  2000 DLLs
-rw-r--r--  1 root root   32628 Nov 11  2000 LICENSE.txt
drwxr-xr-x 31 root root    4096 Nov 11  2000 Lib
-rw-r--r--  1 root root 1085460 Nov 11  2000 NEWS.txt
drwxr-xr-x  2 root root    4096 Nov 11  2000 Scripts
drwxr-xr-x  6 root root    4096 Nov 11  2000 Tools
drwxr-xr-x  4 root root    4096 Nov 11  2000 include
drwxr-xr-x  2 root root    4096 Nov 11  2000 libs
-rwxr-xr-x  1 root root   99560 Nov 11  2000 python.exe
-rw-r--r--  1 root root   59624 Nov 11  2000 python3.dll
-rw-r--r--  1 root root 4497640 Nov 11  2000 python39.dll
-rwxr-xr-x  1 root root   98024 Nov 11  2000 pythonw.exe
-rw-r--r--  1 root root   76168 Nov 11  2000 vcruntime140.dll
/opt/wine64/drive_c/electrum /opt/wine64/drive_c/electrum/contrib/build-wine
fatal: not a git repository (or any parent up to mount point /opt/wine64/drive_c)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
🗯 ERROR: build-electrum-git failed

Plus, my docker version for good measure

cuckoo@cuckoo-virtual-machine:~/Desktop/electrum-master/contrib/build-wine$ docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
SomberNight commented 2 years ago
/opt/wine64/drive_c/electrum /opt/wine64/drive_c/electrum/contrib/build-wine
fatal: not a git repository (or any parent up to mount point /opt/wine64/drive_c)

Those are the interesting lines. The issue is that the build script can only build from a git clone.

cuckoo@cuckoo-virtual-machine:~/Desktop/electrum-master/contrib/build-wine$ docker version

Looking at that path, I'm guessing you've downloaded the zipped source code of master directly from github. Try git cloning instead.

gruve-p commented 2 years ago

@sindereis can you try git clone instead downloading the zipped source to your desktop and report back if this issue can be closed?