Giter Site home page Giter Site logo

Comments (8)

umarcor avatar umarcor commented on July 23, 2024

Hi @nirmannarang! golang seems te be tricky on qemu-user, and several bugs have been fixed in the last months:

It might be interesting trying this without Docker (using qemu-user on the host) and opening a bug report in QEMU.

from qemu-user-static.

nirmannarang avatar nirmannarang commented on July 23, 2024

@umarcor Docker requirement is necessary actually. This is part of CI which builds this s390x go-build image on x86 and is then published on docker hub. And this fails only for s390x, other architectures like ppc64le, arm64, etc. are running successfully through this process.
Let me still give it a try without Docker(using qemu-user on the host).
Thanks.

from qemu-user-static.

nirmannarang avatar nirmannarang commented on July 23, 2024

@umarcor GOARCH=s390x go install -v std command is successful if I run it directly on x86 host. The same command gives error if ran inside s390x docker container on x86 host.

from qemu-user-static.

umarcor avatar umarcor commented on July 23, 2024

@umarcor Docker requirement is necessary actually. This is part of CI which builds this s390x go-build image on x86 and is then published on docker hub. And this fails only for s390x, other architectures like ppc64le, arm64, etc. are running successfully through this process.

Yes, I understand that. However, I think that this might be an issue with "qemu-user allowing s390x targets on x86_64 hosts". Because you seem to have access to an s390x host (you wrote "When I build the same Dockerfile.s390x on an s390x machine, it is built successfully"), I'm suggesting you to take Docker out of the equation FOR TESTING PURPOSES ONLY. Once you find/fix the issue, you can go back to using the container, as you expect.

GOARCH=s390x go install -v std command is successful if I run it directly on x86 host.

This is cross-compilation; qemu-user is not being used. I suggest to download a go installation for s390x into your host. If you try to execute it straightaway, it should fail. If you run qemu-user go install -v std, it should theoretically produce a packages/libraries for s390x. But, in this case, I'd expect it to fail with the same error that you are seeing in the container. This would mean that the issue is, indeed, with golang and qemu-user, but unrelated to docker.

from qemu-user-static.

nirmannarang avatar nirmannarang commented on July 23, 2024

I installed qemu on x86 Ubuntu host. Extracted s390x go 1.14.2 binaries on the same. Ran the following commands:

root:~ wget -q https://storage.googleapis.com/golang/go1.14.2.linux-s390x.tar.gz
root@:~# chmod ugo+r go1.14.2.linux-s390x.tar.gz
root@:~# rm -rf /usr/local/go /usr/bin/go
root@:~#  tar -C /usr/local -xzf go1.14.2.linux-s390x.tar.gz
root@:~# ln -sf /usr/local/go/bin/go /usr/bin/
root@:~# ln -sf /usr/local/go/bin/gofmt /usr/bin/
root@:~# ln -sf /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
root@:~# go version
/lib/ld64.so.1: No such file or directory
root@:~# qemu-s390x /usr/bin/go version
/lib/ld64.so.1: No such file or directory

from qemu-user-static.

nirmannarang avatar nirmannarang commented on July 23, 2024

Another note, on x86 host, I ran the following commands:

docker run --rm --privileged multiarch/qemu-user-static:4.2.0-7 --reset -p yes

Ran an s390x golang 1.14.2 alpine container on x86 host

root@:~# docker run -it -v /usr/bin/qemu-s390x-static:/usr/bin/qemu-s390x-static s390x/golang:1.14.2-alpine3.11

Inside s390x container, ran following go commands:

/go # go version
go version go1.14.2 linux/s390x
/go # go install -v -x std
WORK=/tmp/go-build090332422
/go #

Strange that this is successful but docker build fails using same command inside Dockerfile.s390x.

from qemu-user-static.

umarcor avatar umarcor commented on July 23, 2024

That seems to confirm that this is an issue upstream with allowing s390x targets on x86_64 hosts. I suggest to open a bug report as commented in #114 (comment).

from qemu-user-static.

nirmannarang avatar nirmannarang commented on July 23, 2024

The issue has been fixed with the latest release 6.1.0-8. Hence closing the issue.

from qemu-user-static.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.