go-graphviz icon indicating copy to clipboard operation
go-graphviz copied to clipboard

imports github.com/goccy/go-graphviz/internal/ccall: build constraints exclude all Go files

Open FaceCrap opened this issue 1 year ago • 2 comments
trafficstars

Since the original #27 issue is closed and the added comment didn't elicit a response, I've opted to open a new issue.

original comment pasted below. In short, go fails to produce an executable.

@goccy, see my post here and pasted below the output

E:\Programs64\Dev\Go\bin\GraphViz>..\go build -o my-renpy-graphviz-executable
go: downloading github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
go: downloading github.com/fatih/color v1.16.0
go: downloading github.com/goccy/go-graphviz v0.1.2
go: downloading github.com/emicklei/dot v1.6.2
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading golang.org/x/sys v0.18.0
go: downloading golang.org/x/image v0.14.0
go: downloading github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
go: downloading github.com/fogleman/gg v1.3.0
go: downloading github.com/pkg/errors v0.9.1
package pkg.amethysts.studio/renpy-graphviz
        imports github.com/goccy/go-graphviz
        imports github.com/goccy/go-graphviz/cgraph
        imports github.com/goccy/go-graphviz/internal/ccall: build constraints exclude all Go files in C:\Users\FaceCrap\go\pkg\mod\github.com\goccy\[email protected]\internal\ccall

go install just repeated the last bit and still no exe anywhere on my system.

package pkg.amethysts.studio/renpy-graphviz
        imports github.com/goccy/go-graphviz
        imports github.com/goccy/go-graphviz/cgraph
        imports github.com/goccy/go-graphviz/internal/ccall: build constraints exclude all Go files in C:\Users\FaceCrap\go\pkg\mod\github.com\goccy\[email protected]\internal\ccall

FaceCrap avatar May 30 '24 00:05 FaceCrap

I had this problem and it turns out it was because in my build instructions I had "CGO_ENABLED=0" for making a dockerizable executable. I've been using this parameter for a while now out of habit. Changing it to CGO_ENABLED=1 made the problem go away. Let's hope my container continues to execute correctly.

greenenergy avatar Aug 04 '24 07:08 greenenergy

I have no idea if that might be the cause, I have zero experience with GO so don't even know where to change that setting, only installed it to get around an issue in an app for which the dev won't make a one-line fix for 'cosmetic' reasons. I've however given up completely and removed both the app and GO, so won't be able to confirm or deny if this would 'fix' this particular issue

FaceCrap avatar Aug 09 '24 13:08 FaceCrap

I had this problem and it turns out it was because in my build instructions I had "CGO_ENABLED=0" for making a dockerizable executable. I've been using this parameter for a while now out of habit. Changing it to CGO_ENABLED=1 made the problem go away. Let's hope my container continues to execute correctly.

It doesn't work if want to cross-compile executable binaries for multiple platforms:

--> linux/arm64 error: exit status 1
Stderr: # runtime/cgo
gcc_arm64.S: Assembler messages:
gcc_arm64.S:30: Error: no such instruction: `stp x29,x30,[sp,'
gcc_arm64.S:34: Error: too many memory references for `mov'
gcc_arm64.S:36: Error: no such instruction: `stp x19,x20,[sp,'
gcc_arm64.S:39: Error: no such instruction: `stp x21,x22,[sp,'
gcc_arm64.S:42: Error: no such instruction: `stp x23,x24,[sp,'
gcc_arm64.S:45: Error: no such instruction: `stp x25,x26,[sp,'
gcc_arm64.S:48: Error: no such instruction: `stp x27,x28,[sp,'
gcc_arm64.S:52: Error: too many memory references for `mov'
gcc_arm64.S:53: Error: too many memory references for `mov'
gcc_arm64.S:54: Error: too many memory references for `mov'
gcc_arm64.S:56: Error: no such instruction: `blr x20'
gcc_arm64.S:57: Error: no such instruction: `blr x19'
gcc_arm64.S:59: Error: no such instruction: `ldp x27,x28,[sp,'
gcc_arm64.S:62: Error: no such instruction: `ldp x25,x26,[sp,'
gcc_arm64.S:65: Error: no such instruction: `ldp x23,x24,[sp,'
gcc_arm64.S:68: Error: no such instruction: `ldp x21,x22,[sp,'
gcc_arm64.S:71: Error: no such instruction: `ldp x19,x20,[sp,'
gcc_arm64.S:74: Error: no such instruction: `ldp x29,x30,[sp],'
--> darwin/arm64 error: exit status 1
Stderr: go: downloading github.com/mitchellh/go-homedir v1.1.0
# runtime/cgo
clang: error: argument unused during compilation: '-arch arm64' [-Werror,-Wunused-command-line-argument]
--> darwin/amd64 error: exit status 1
Stderr: go: downloading github.com/mitchellh/go-homedir v1.1.0
# runtime/cgo
clang: error: argument unused during compilation: '-arch x86_64' [-Werror,-Wunused-command-line-argument]
exit status 1

reaver-flomesh avatar Oct 12 '24 12:10 reaver-flomesh