Failed to run on-target setarch #9134

issue ghost opened this issue on November 11, 2016
  1. ghost commented at 6:38 PM on November 11, 2016: none

    I use this manual

    https://github.com/bitcoin/bitcoin/blob/master/doc/gitian-building.md

    https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#fetch-and-create-inputs-first-time-or-when-dependency-versions-change

    How can I solve the problem?

    Creating build script (var/build-script)
    Running build script (log in var/build.log)
    ./bin/gbuild:21:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
            from ./bin/gbuild:149:in `build_one_configuration'
            from ./bin/gbuild:285:in `block (2 levels) in <main>'
            from ./bin/gbuild:280:in `each'
            from ./bin/gbuild:280:in `block in <main>'
            from ./bin/gbuild:278:in `each'
            from ./bin/gbuild:278:in `<main>'
    
    

    tail -f var/build.log

    libtool: install: /usr/bin/install -c .libs/libprotoc.a /home/ubuntu/build/bitcoin/depends/work/staging/arm-linux-gnueabihf/native_protobuf/2.6.1-70c104d3b77/home/ubuntu/build/bitcoin/depends/arm-linux-gnueabihf/native/lib/libprotoc.a
    libtool: install: strip --strip-debug /home/ubuntu/build/bitcoin/depends/work/staging/arm-linux-gnueabihf/native_protobuf/2.6.1-70c104d3b77/home/ubuntu/build/bitcoin/depends/arm-linux-gnueabihf/native/lib/libprotoc.a
    libtool: install: chmod 644 /home/ubuntu/build/bitcoin/depends/work/staging/arm-linux-gnueabihf/native_protobuf/2.6.1-70c104d3b77/home/ubuntu/build/bitcoin/depends/arm-linux-gnueabihf/native/lib/libprotoc.a
    libtool: install: ranlib /home/ubuntu/build/bitcoin/depends/work/staging/arm-linux-gnueabihf/native_protobuf/2.6.1-70c104d3b77/home/ubuntu/build/bitcoin/depends/arm-linux-gnueabihf/native/lib/libprotoc.a
    libtool: install: warning: remember to run `libtool --finish /home/ubuntu/build/bitcoin/depends/arm-linux-gnueabihf/native/lib'
     /bin/mkdir -p '/home/ubuntu/build/bitcoin/depends/work/staging/arm-linux-gnueabihf/native_p
    
  2. unsystemizer commented at 9:19 PM on November 11, 2016: contributor

    I think the scripts are broken, I tried to work by that document last week and it doesn't work (the doc has bugs for sure, the scripts may have some too and I think the current gitian has some bugs as well). I think you should try the manual procedure and then compare with the scripts. Or wait for someone to tell us what exact environment they use and when they tried (maybe it worked with some older version of gitian). It's on my "to do" wishlist to contribute to the docs, but there were too many problems that I couldn't resolve so I haven't submitted documentation bugs/corrections yet.

  3. ghost commented at 9:42 PM on November 11, 2016: none

    I tried to change the username on ubuntu Did not help

  4. unsystemizer commented at 9:57 PM on November 11, 2016: contributor

    If it were that simple... As I said I think it's likely multiple bugs in the docs and the code (either the script or gitian or most likely both).

  5. fanquake added the label Build system on Nov 12, 2016
  6. ghost commented at 5:31 PM on November 13, 2016: none

    This is the solution! The error occurs because of lack of memory

  7. MarcoFalke commented at 5:37 PM on November 13, 2016: member

    Thanks for letting us know. I will close the issue now.

  8. MarcoFalke closed this on Nov 13, 2016

  9. aniket-kumar commented at 1:32 PM on November 15, 2016: none

    @twepl I don't think that is the solution. I am also facing the same issue. I have sufficient memory on my system. I am just trying to create windows binary file using gitian-build. Any help will be appreciated.

  10. ghost commented at 2:23 PM on November 15, 2016: none

    @aniket-kumar I made a small guide for you

    https://github.com/bitcoin/bitcoin/blob/master/doc/gitian-building.md

    Install VirtualBox VM and debian-8.5.0-amd64-netinst.iso

    Writing to the console

    sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
    
    /etc/init.d/ssh restart
    
    apt-get install git ruby sudo apt-cacher-ng qemu-utils debootstrap lxc python-cheetah parted kpartx bridge-utils make ubuntu-archive-keyring curl
    
    adduser debian sudo
    
    
    echo "%sudo ALL=NOPASSWD: /usr/bin/lxc-start" > /etc/sudoers.d/gitian-lxc
    echo "%sudo ALL=NOPASSWD: /usr/bin/lxc-execute" >> /etc/sudoers.d/gitian-lxc
    echo '#!/bin/sh -e' > /etc/rc.local
    echo 'brctl addbr br0' >> /etc/rc.local
    echo 'ifconfig br0 10.0.3.2/24 up' >> /etc/rc.local
    echo 'iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE' >> /etc/rc.local
    echo 'echo 1 > /proc/sys/net/ipv4/ip_forward' >> /etc/rc.local
    echo 'exit 0' >> /etc/rc.local
    echo 'export USE_LXC=1' >> /home/debian/.profile
    echo 'export GITIAN_HOST_IP=10.0.3.2' >> /home/debian/.profile
    echo 'export LXC_GUEST_IP=10.0.3.5' >> /home/debian/.profile
    reboot
    

    SSH localhost 22222 user debian

    sudo apt-get update
    
    sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
    
    sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
    
    wget http://archive.ubuntu.com/ubuntu/pool/universe/v/vm-builder/vm-builder_0.12.4+bzr494.orig.tar.gz
    echo "76cbf8c52c391160b2641e7120dbade5afded713afaa6032f733a261f13e6a8e  vm-builder_0.12.4+bzr494.orig.tar.gz" | sha256sum -c
    # (verification -- must return OK)
    tar -zxvf vm-builder_0.12.4+bzr494.orig.tar.gz
    cd vm-builder-0.12.4+bzr494
    sudo python setup.py install
    cd ..
    
    reboot
    

    Create a clone VirtualBox VM debian 2

    SSH localhost 22222 user debian

    Writing to the console

    git clone https://github.com/devrandom/gitian-builder.git
    git clone https://github.com/bitcoin/bitcoin
    git clone https://github.com/bitcoin-core/gitian.sigs.git
    
    cd gitian-builder
    bin/make-base-vm --lxc --arch amd64 --suite trusty
    
    pushd ./gitian-builder
    mkdir -p inputs
    wget -P inputs https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
    wget -P inputs http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
    popd
    
    pushd ./gitian-builder
    make -C ../bitcoin/depends download SOURCES_PATH=`pwd`/cache/common
    popd
    

    LINUX OS

    pushd ./gitian-builder
    ./bin/gbuild --memory 3000 --commit bitcoin=master ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
    ./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
    mv build/out/bitcoin-*.tar.gz build/out/src/bitcoin-*.tar.gz ../
    popd
    

    Windows OS

    pushd ./gitian-builder
    ./bin/gbuild --memory 3000 --commit bitcoin=master  ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
    ./bin/gsign --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
    mv build/out/bitcoin-*-win-unsigned.tar.gz inputs/bitcoin-win-unsigned.tar.gz
    mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../
    popd
    

    Mac OS X

    pushd ./gitian-builder
    ./bin/gbuild --memory 3000 --commit bitcoin=master  ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
    ./bin/gsign --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
    mv build/out/bitcoin-*-osx-unsigned.tar.gz inputs/bitcoin-osx-unsigned.tar.gz
    mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../
    popd
    
  11. aniket-kumar commented at 2:41 PM on November 15, 2016: none

    @twepl I am not using any VM, doing this on my machine.I have executed all other commands , only the windows binary build command is throwing error. I applied the changes in my command according to your answer, still getting the same error :

    Running build script (log in var/build.log) ./bin/gbuild:21:in system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError) from ./bin/gbuild:149:inbuild_one_configuration' from ./bin/gbuild:285:in block (2 levels) in <main>' from ./bin/gbuild:280:ineach' from ./bin/gbuild:280:in block in <main>' from ./bin/gbuild:278:ineach' from ./bin/gbuild:278:in `<main>'

  12. marvic41 commented at 5:24 AM on October 29, 2017: none

    @aniket-kumar I tried for mac it flashes errors. do you have a procedure to build for mac. For Linux and Win (32,64) i able to create binaries.

  13. MarcoFalke deleted a comment on Apr 26, 2018
  14. MarcoFalke deleted a comment on Apr 26, 2018
  15. gwpreggae commented at 6:14 PM on December 22, 2019: none

    @twepl I don't think that is the solution. I am also facing the same issue. I have sufficient memory on my system. I am just trying to create windows binary file using gitian-build. Any help will be appreciated.

    Did you figure this out? I am stuck here too.

  16. realcaesar commented at 9:45 AM on April 18, 2020: none

    @twepl I don't think that is the solution. I am also facing the same issue. I have sufficient memory on my system. I am just trying to create windows binary file using gitian-build. Any help will be appreciated.

    Did you figure this out? I am stuck here too.

    Did you?? same problem here!

  17. realcaesar commented at 9:44 AM on April 26, 2020: none

    Anyone solved this "failed to run on-target setarch x86_64 bash" problem? I tried a lot of combinations even differnt boost-win32 versions but no success.

  18. gwpreggae commented at 12:18 PM on April 26, 2020: none

    I really tried to figure it out to no avail. I got linux version working fine but can't get windows to compile. I've moved on for now to work on other things.

    On Sun, Apr 26, 2020, 5:44 AM caesar-ski notifications@github.com wrote:

    Anyone solved this "failed to run on-target setarch x86_64 bash" problem? I tried a lot of combinations even differnt boost-win32 versions but no success.

    — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/9134#issuecomment-619519328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNNQBB4JKVW4YNEQI6TT4TROP7ARANCNFSM4CWACPIA .

  19. Limecoin-LIME commented at 10:45 AM on April 20, 2021: none

    Same Problem here... hours of research so far without success. I will keep you updated and communicate as soon as I have a solution. Or have any of you solved the problem in the meantime? Edit: It definitely can't be the RAM, I have my VM fueled with 16+ GB. @realcaesar @gwpreggae

  20. realcaesar commented at 12:06 PM on April 20, 2021: none

    I somehow fixed it but it was so long ago i cant remember sorry. But there was an solution. Ps : i made like 6 diffrent Vms till it worked (or just use snapshots)

  21. DrahtBot locked this on Aug 18, 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: 2026-04-17 15:15 UTC

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