The Wayback Machine - https://web.archive.org/web/20201204231953/https://github.com/go-python/gopy/issues/174
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gopy bind with docker failed #174

Open
Fiona1729 opened this issue Jan 8, 2019 · 5 comments
Open

gopy bind with docker failed #174

Fiona1729 opened this issue Jan 8, 2019 · 5 comments

Comments

@Fiona1729
Copy link

@Fiona1729 Fiona1729 commented Jan 8, 2019

Hello, my attempt to generate GoPy bindings for https:///github.com/divan/txqr in an Ubuntu commandline using Windows Subsystem for Linux fails with the message:

finian_blackett@780-01D1-FBLAC:~$ cd $GOPATH/src/github.com/go-python/gopy
finian_blackett@780-01D1-FBLAC:~/go/src/github.com/go-python/gopy$ docker build -t go-python/gopy .
Sending build context to Docker daemon  891.4kB
Step 1/3 : FROM golang:onbuild
# Executing 3 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> ae64442e0a39
Step 2/3 : RUN apt-get update && apt-get install -y pkg-config python2.7-dev && apt-get clean
 ---> Using cache
 ---> 84f23581f3a8
Step 3/3 : CMD /go/bin/app
 ---> Using cache
 ---> de30e547f626
Successfully built de30e547f626
Successfully tagged go-python/gopy:latest
finian_blackett@780-01D1-FBLAC:~/go/src/github.com/go-python/gopy$ docker run -it --rm go-python/gopy
gopy -

Commands:

    bind        generate and compile (C)Python language bindings for Go
    gen         generate (C)Python language bindings for Go

Use "gopy help <command>" for more information about a command.

finian_blackett@780-01D1-FBLAC:~/go/src/github.com/go-python/gopy$ docker run -it --rm go-python/gopy 'bind github.com/divan/txqr;'
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"bind github.com/divan/txqr;\": stat bind github.com/divan/txqr;: no such file or directory": unknown.

The txqr package is properly installed and in the $GOPATH variable

.
├── bin
├── pkg
│   └── linux_amd64
│       └── github.com
│           └── divan
└── src
    └── github.com
        ├── divan
        │   └── txqr
        │       ├── cmd
        │       │   ├── txqr-ascii
        │       │   ├── txqr-gif
        │       │   └── txqr-tester
        │       │       ├── app
        │       │       │   └── css
        │       │       ├── docs
        │       │       ├── mobile
        │       │       └── ws
        │       ├── docs
        │       ├── mobile
        │       └── qr
        │           └── testdata
        ├── go-python
        │   └── gopy
        │       ├── _examples
        │       │   ├── arrays
        │       │   ├── cgo
.....................................................
        │       │   ├── vars
        │       │   └── wrapper
        │       │       └── pywrapper
        │       └── bind
        ├── gonuts
        │   ├── commander
        │   │   └── examples
        │   │       └── my-cmd
        │   └── flag
        └── google
            └── gofountain

56 directories

Result of go-env:

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/finian_blackett/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/finian_blackett/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build759671476=/tmp/go-build -gno-record-gcc-switches"
@Fiona1729
Copy link
Author

@Fiona1729 Fiona1729 commented Jan 8, 2019

Additionally, these are the results of my attempt to run GoPy out of the docker container:

finian_blackett@780-01D1-FBLAC:~/go/src/github.com/divan/txqr$ ls
LICENSE  Makefile  README.md  cmd  decode.go  doc.go  docs  encode.go  fountain.go  go.mod  go.sum  mobile  qr  txqr_test.go
finian_blackett@780-01D1-FBLAC:~/go/src/github.com/divan/txqr$ gopy
gopy -

Commands:

    bind        generate and compile (C)Python language bindings for Go
    gen         generate (C)Python language bindings for Go

Use "gopy help <command>" for more information about a command.

finian_blackett@780-01D1-FBLAC:~/go/src/github.com/divan/txqr$ gopy bind github.com/divan/txqr
panic: gopy: could not find pkg-config file (no python.pc installed?)

goroutine 1 [running]:
github.com/go-python/gopy/bind.(*goGen).genPreamble(0xc4201ee8c0)
        /home/finian_blackett/go/src/github.com/go-python/gopy/bind/gengo.go:1133 +0x62d
github.com/go-python/gopy/bind.(*goGen).gen(0xc4201ee8c0, 0xc4201d6e80, 0x1)
        /home/finian_blackett/go/src/github.com/go-python/gopy/bind/gengo.go:192 +0x43
github.com/go-python/gopy/bind.GenGo(0x756c80, 0xc42000c918, 0xc42001e300, 0xc4200ba960, 0x2, 0x70c9a0, 0x7, 0x0, 0x0)
        /home/finian_blackett/go/src/github.com/go-python/gopy/bind/bind.go:94 +0x154
main.genPkg(0xc4201fe520, 0x13, 0xc4200ba960, 0xc420014379, 0x3, 0x0, 0x0)
        /home/finian_blackett/go/src/github.com/go-python/gopy/gen.go:70 +0x259
main.gopyRunCmdBind(0xc4200ca5a0, 0xc42000e0b0, 0x1, 0x1, 0x0, 0x0)
        /home/finian_blackett/go/src/github.com/go-python/gopy/cmd_bind.go:115 +0x74d
github.com/gonuts/commander.(*Command).Dispatch(0xc4200ca5a0, 0xc42000e0b0, 0x1, 0x1, 0x0, 0x0)
        /home/finian_blackett/go/src/github.com/gonuts/commander/commands.go:221 +0x259
github.com/gonuts/commander.(*Command).Dispatch(0xc4200ca6c0, 0xc42000e0a0, 0x2, 0x2, 0x0, 0x0)
        /home/finian_blackett/go/src/github.com/gonuts/commander/commands.go:187 +0x144
main.run(0xc42000e0a0, 0x2, 0x2, 0x0, 0xc420055f78)
        /home/finian_blackett/go/src/github.com/go-python/gopy/main.go:36 +0x254
main.main()
        /home/finian_blackett/go/src/github.com/go-python/gopy/main.go:44 +0x6a
finian_blackett@780-01D1-FBLAC:~/go/src/github.com/divan/txqr$```
@Fiona1729
Copy link
Author

@Fiona1729 Fiona1729 commented Jan 8, 2019

If anyone could help that would be much appreciated

@Fiona1729
Copy link
Author

@Fiona1729 Fiona1729 commented Jan 9, 2019

Attempting to build on windows has led to numerous failures, I believe these are related to non-cross-compatibility with certain Posix vs Windows APIs, for example, _beginthread vs OpenThread() or something like that

@sbinet
Copy link
Member

@sbinet sbinet commented Jan 15, 2019

Windows support is still in the works... here: #175

@sbinet
Copy link
Member

@sbinet sbinet commented Jan 16, 2019

ok. #175 is in a satisfying state.
I declare Windows supported, only in the cffi backend though.

could you give it a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.