-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It looks like Graphviz can't be bulit on 386 https://github.com/fornellas/resonance/actions/runs/10228304747/job/28300680133#step:5:102: ``` ../.cache/resonance/GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:131:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(v.c)) (variable of type [8]byte) as [4]byte value in assignment (compile) ../.cache/resonance/GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:241:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(header.Data)) (variable of type [8]byte) as [4]byte value in assignment (compile) ../.cache/resonance/GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:250:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(v.c)) (variable of type [8]byte) as [4]byte value in assignment (compile) ``` Let's disable it for now (though an upstream PR to fix this should be easy to cut).
- Loading branch information
Showing
2 changed files
with
54 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// This build fails on 32 bit: | ||
// GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:131:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(v.c)) (variable of type [8]byte) as [4]byte value in assignment (compile) | ||
// GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:241:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(header.Data)) (variable of type [8]byte) as [4]byte value in assignment (compile) | ||
// GOMODCACHE/github.com/goccy/go-graphviz@v0.1.3/internal/ccall/cdt.go:250:11: cannot use *(*[wordSize]byte)(unsafe.Pointer(v.c)) (variable of type [8]byte) as [4]byte value in assignment (compile) | ||
// | ||
//go:build !386 && !arm | ||
|
||
package resources | ||
|
||
import ( | ||
"bytes" | ||
|
||
"github.com/goccy/go-graphviz" | ||
"github.com/goccy/go-graphviz/cgraph" | ||
) | ||
|
||
// Returns a Graphviz graph of all nodes. | ||
func (ns Nodes) Graphviz() (string, error) { | ||
g := graphviz.New() | ||
defer g.Close() | ||
|
||
graph, err := g.Graph() | ||
if err != nil { | ||
return "", err | ||
} | ||
defer graph.Close() | ||
|
||
gNodeMap := map[string]*cgraph.Node{} | ||
for _, node := range ns { | ||
name := node.String() | ||
gNode, err := graph.CreateNode(name) | ||
if err != nil { | ||
return "", err | ||
} | ||
gNodeMap[name] = gNode | ||
} | ||
|
||
for _, node := range ns { | ||
gNode := gNodeMap[node.String()] | ||
for _, toNode := range node.requiredBy { | ||
toGNode := gNodeMap[toNode.String()] | ||
_, err := graph.CreateEdge("required_by", gNode, toGNode) | ||
if err != nil { | ||
return "", err | ||
} | ||
} | ||
} | ||
|
||
var buf bytes.Buffer | ||
if err := g.Render(graph, "dot", &buf); err != nil { | ||
return "", err | ||
} | ||
return buf.String(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters