Windows build through Windows Subsystem for Linux doesn't work anymore #11814

issue nopara73 opened this issue on December 2, 2017
  1. nopara73 commented at 1:30 AM on December 2, 2017: none

    I am following the instructions of this page: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md

    When I get to sudo apt install g++-mingw-w64-x86-64 it fails, because of an unmet dependency. Which this dependency is does not matter, I am following down the chain of unmet dependencies with apt install to the bottom and that's when I find the problem:

    Depends: binutils (>= 2.28) but 2.26.1-1ubuntu1~16.04.5 is to be installed

    lsb_release -a gives the following output:

    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.3 LTS
    Release:        16.04
    Codename:       xenial
    

    While I am new to WSL, I suspect I'm not able to upgrade from xenial. Am I right?
    The right solution would be to somehow install newer version of binutils, right? How can I do that?

    [ ] Also this issue should not be closed until the documentation had been updated.

    Cc @sipsorcery, because you've just worked on the WSL documentation 15 days ago.

  2. fanquake added the label Windows on Dec 2, 2017
  3. nopara73 commented at 2:11 PM on December 2, 2017: none

    @fanquake It's a Linux issue, not a Windows issue.

  4. sipsorcery commented at 2:28 AM on December 3, 2017: member

    @nopara73 did you run the apt install command mentioned in the instructions before g++-mingw-w64-x86-64?

    sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git

  5. nopara73 commented at 4:33 AM on December 3, 2017: none

    @sipsorcery Yes, as I explained g++-mingw-w64-x86-64 depends on something that depends on something that depends on binutils (>= 2.28), while only 2.26.1 is available at the app store of Ubuntu 16.04.

  6. sipsorcery commented at 1:04 AM on December 4, 2017: member

    @nopara73 I have repeated the WSL steps on a different machine and do not get the dependency issue you have described.

    • Install ubuntu
    • sudo apt update
    • sudo apt upgrade
    • sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
    • sudo apt install g++-mingw-w64-x86-64

    The output from the last step was:

    $ sudo apt install g++-mingw-w64-x86-64 Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libfreetype6 Use 'sudo apt autoremove' to remove it. The following additional packages will be installed: binutils-mingw-w64-x86-64 gcc-mingw-w64-base gcc-mingw-w64-x86-64 mingw-w64-common mingw-w64-x86-64-dev Suggested packages: gcc-5-locales wine64 The following NEW packages will be installed: binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-base gcc-mingw-w64-x86-64 mingw-w64-common mingw-w64-x86-64-dev 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 57.9 MB of archives. After this operation, 366 MB of additional disk space will be used.

    Which shows that the binutils package from the mingw cross chain is going to be installed. The install completed successfully.

    Checking the version of the binutils package shows 2.26.1

    $ apt search binutils Sorting... Done Full Text Search... Done binutils/xenial-updates,now 2.26.1-1ubuntu1~16.04.5 amd64 [installed,automatic] GNU assembler, linker and binary utilities

    I don't believe there are any additional steps required in the WSL build instructions.

  7. nopara73 commented at 5:43 PM on December 7, 2017: none

    @sipsorcery I'm not sure what's going on. My output:

    $ sudo apt update
    Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    Hit:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
    Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
    Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
    Hit:5 http://archive.ubuntu.com/ubuntu zesty InRelease
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    1 package can be upgraded. Run 'apt list --upgradable' to see it.
    $
    $
    $ sudo apt upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    $
    $
    $ sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    automake is already the newest version (1:1.15-4ubuntu1).
    autotools-dev is already the newest version (20150820.1).
    bsdmainutils is already the newest version (9.0.6ubuntu3).
    build-essential is already the newest version (12.1ubuntu2).
    libtool is already the newest version (2.4.6-0.1).
    pkg-config is already the newest version (0.29.1-0ubuntu1).
    curl is already the newest version (7.47.0-1ubuntu2.5).
    git is already the newest version (1:2.7.4-0ubuntu1.3).
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    $
    $
    $ sudo apt install g++-mingw-w64-x86-64
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     g++-mingw-w64-x86-64 : Depends: gcc-mingw-w64-x86-64 (= 6.2.1-4ubuntu1+19.2) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    

    Checking the version of the binutils package shows 2.26.1

    $ apt search binutils
    Sorting... Done
    Full Text Search... Done
    binutils/xenial-updates,now 2.26.1-1ubuntu1~16.04.5 amd64 [installed]
      GNU assembler, linker and binary utilities
    

    My theory is. In the instructions you have the steps I inserted here, which follows this step: sudo apt install g++-mingw-w64-x86-64. I may have done things in the wrong order. I will reinstall my wsl and see.

    sudo apt install software-properties-common
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe"
    sudo apt update
    sudo apt upgrade
    sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
    
  8. nopara73 commented at 6:04 PM on December 7, 2017: none

    Yes, that's what happened. I undone the steps and all worked well.

  9. nopara73 closed this on Dec 7, 2017

  10. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me