Gitian with Bionic host #13688

issue Sjors openend this issue on July 17, 2018
  1. Sjors commented at 12:16 pm on July 17, 2018: member

    As of #13171 Gitian uses Bionic to build the binaries, but the host machine that runs this doesn’t have to be Gitian. The instructions currently recommend Debian 9.

    This machine-inside-a-machine situation is confusing enough, so all things equal I think it would be better to switch the recommended host to Bionic.

    Windows build uses Bionic as well, per #13246. So everyone who does that, could potentially help out with Gitian builds. It would also allow us to reuse the nicely detailed Gitian instructions to help Windows folks out.

    Last time I tried I ran into some trouble though. I’ll try again for the v0.16.2 release candidate.

  2. fanquake added the label Build system on Jul 17, 2018
  3. MarcoFalke commented at 12:21 pm on July 17, 2018: member

    Note that gitian builds should work on any host that provides apt-cacher-ng (see the instructions for debian and fedora in https://github.com/bitcoin-core/docs/blob/master/gitian-building.md#preparing-the-gitian-builder-host)

    Alternatively, if the host doesn’t come with apt-cacher-ng or the vmbuilder doesn’t work on the host, you could try docker: https://github.com/bitcoin-core/docs/pull/33

  4. Sjors commented at 12:23 pm on July 17, 2018: member
    I can’t remember what went wrong last time. Hopefully indeed it’s purely a documentation change.
  5. Sjors commented at 3:45 pm on July 17, 2018: member

    Just tried to do a Gitian build for master, with the new Python Gitian script from #13623 as well as gitian-build.sh on master. I can build the base image using --setup, but trying to do a build I get:

     0./gitian-build.sh --detach-sign --no-commit -b sjors -c master
     1
     2master
     3~/bitcoin ~
     4[...]
     5Building Dependencies
     6[...]
     7make: Leaving directory '/home/gitianuser/bitcoin/depends'
     8
     9Compiling master Linux
    10
    11--- Building for bionic amd64 ---
    12Stopping target if it is up
    13Making a new image copy
    14Failed run an application inside container
    15Traceback (most recent call last):
    16	6: from ./bin/gbuild:301:in `<main>'
    17	5: from ./bin/gbuild:301:in `each'
    18	4: from ./bin/gbuild:303:in `block in <main>'
    19	3: from ./bin/gbuild:303:in `each'
    20	2: from ./bin/gbuild:308:in `block (2 levels) in <main>'
    21	1: from ./bin/gbuild:57:in `build_one_configuration'
    22./bin/gbuild:21:in `system!': failed to run make-clean-vm --suite bionic --arch amd64 (RuntimeError)
    23Traceback (most recent call last):
    24./bin/gsign:70:in `<main>': result/bitcoin-linux-0.17-res.yml does not exist (RuntimeError)
    25mv: cannot stat 'build/out/bitcoin-*.tar.gz': No such file or directory
    26mv: cannot stat 'build/out/src/bitcoin-*.tar.gz': No such file or directory
    

    I’m guessing it’s an LXC related thing.

    No luck with Docker either (both Python and bash). It happily builds an image, but then:

    0Compiling master Linux
    1--- Building for bionic amd64 ---
    2Stopping target if it is up
    3Making a new image copy
    4Error: No such container: gitian-target
    
  6. Sjors commented at 6:56 pm on July 17, 2018: member

    From IRC, @ken2812221 wrote:

    0[20:42:11] ken2812221_ Modify lxcbr0 to br0 at /etc/default/lxc-net
    1[20:43:50] ken2812221_ And add "export GITIAN_HOST_IP=10.0.3.1 LXC_GUEST_IP=10.0.3.5" to your .profile
    

    Note that lxcbr0 to br0 is new (compared to Debian 9 instructions) and that the IP is now 10.0.3.1 instead of 10.0.3.2.

    This indeed starts a build process for LXC (Docker still has the same issue).

  7. MarcoFalke commented at 7:02 pm on July 17, 2018: member

    export GITIAN_HOST_IP=10.0.3.1 LXC_GUEST_IP=10.0.3.5

    Would be nice, if the environment variables were exported by the script, so it would’t have to be done manually?

  8. deadalnix commented at 10:03 pm on September 28, 2018: none

    Trying to make that work on debian here as well. I followed instructions found here ( https://github.com/bitcoin-core/docs/blob/master/gitian-building/gitian-building-create-vm-debian.md ) and here ( https://github.com/bitcoin-core/docs/blob/master/gitian-building/gitian-building-setup-gitian-debian.md )

    I get the same error as above:

    lxc-execute: tools/lxc_execute.c: main: 164 Failed run an application inside container

    Ready the instructions to fix this:

    Modify lxcbr0 to br0 at /etc/default/lxc-net

    I do not have that file on the system.

    And add “export GITIAN_HOST_IP=10.0.3.1 LXC_GUEST_IP=10.0.3.5” to your .profile

    This is done, but do not change anything.

    Any help appreciated on how to move this forward.

  9. achow101 commented at 10:42 pm on September 28, 2018: member
    @deadalnix Do you have LXC 2.1+ installed? IIRC debian does not have that in its repos, so you will have to install it manually.
  10. deadalnix commented at 11:03 pm on September 28, 2018: none

    I installed 2.1.1 via the following procedure:

    Checkout lxc source from its git repository. git checkout lxc-2.1.1 ./autogen.sh mkdir build cd build ./configure –without-werror –prefix=/opt/lxc make sudo make install

    Then I added /opt/lxc/bin to my path.

    lxc-execute –version gives me 2.1.1

    Le sam. 29 sept. 2018 à 00:45, Andrew Chow notifications@github.com a écrit :

    @deadalnix https://github.com/deadalnix Do you have LXC 2.1+ installed? IIRC debian does not have that in its repos, so you will have to install it manually.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/13688#issuecomment-425585858, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0IaXZ-mmvzAXwm_DdauatxKJ4sdoo6ks5ufqaBgaJpZM4VSvHP .

  11. Sjors commented at 1:58 pm on February 19, 2019: member
    I’ve been using a Bionic host for Gitian building for a while now without a problem, though I can’t remember if I reconfigured anything :-)
  12. fanquake closed this on Feb 5, 2020

  13. DrahtBot locked this on Feb 15, 2022

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: 2024-12-19 09:12 UTC

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