zopencommunity / wharf

A container registry
Apache License 2.0
6 stars 4 forks source link

Porting wireguard-go: unsanitized config used #43

Open jlee3227 opened 7 months ago

jlee3227 commented 7 months ago

While trying to port wireguard-go I see this error:

$ wharf ./wireguard-go/
Build errors occurred in: golang.zx2c4.com/wireguard
Build errors occurred in: golang.zx2c4.com/wireguard/tun
panic: unsanitized config used for doing porting of depenendencies [recovered]
        panic: unsanitized config used for doing porting of depenendencies

goroutine 1 [running]:
go/types.(*Checker).handleBailout(0xc004cec3c0, 0xc00196b630)
        /jenkins/go-1.21/go/src/go/types/check.go:336 +0xe0
panic({0xf5fb598, 0xf7457d8})
        /jenkins/go-1.21/go/src/runtime/panic.go:879 +0x28c
github.com/zosopentools/wharf/internal/porting.port.func3({{0xc0004c00c0, 0x4544, {0xc005454140, 0x122}, 0x0, 0x15, 0x4544, 0x4548}, {0xf747638, 0xfa10618}})
        /jenkins/workspace/Port-Build/wharf/wharf/internal/porting/port.go:378 +0x192
github.com/zosopentools/wharf/internal/packages.(*Package).Build.func2({0xf747658, 0xc0056f36c0})
        /jenkins/workspace/Port-Build/wharf/wharf/internal/packages/build.go:52 +0x1b6
go/types.(*Checker).report(0xc004cec3c0, 0xc0019689f0)
        /jenkins/go-1.21/go/src/go/types/errors.go:289 +0x5d2
go/types.(*Checker).errorf(...)
        /jenkins/go-1.21/go/src/go/types/errors.go:310
go/types.(*Checker).assignment(0xc004cec3c0, 0xc0056f3580, {0xf749290, 0xc0019d99d0}, {0xc00177bbc0, 0x1c})
        /jenkins/go-1.21/go/src/go/types/assignments.go:95 +0xbd6
go/types.(*Checker).arguments(0xc004cec3c0, 0xc00580aa80, 0xc003d98d40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0xc00528c340, ...}, ...)
        /jenkins/go-1.21/go/src/go/types/call.go:653 +0x1970
go/types.(*Checker).callExpr(0xc004cec3c0, 0xc0056f3540, 0xc00580aa80)
        /jenkins/go-1.21/go/src/go/types/call.go:302 +0x9fa
go/types.(*Checker).exprInternal(0xc004cec3c0, {0x0, 0x0}, 0xc0056f3540, {0xf74ab38, 0xc00580aa80}, {0x0, 0x0})
        /jenkins/go-1.21/go/src/go/types/expr.go:1359 +0x1892
go/types.(*Checker).rawExpr(0xc004cec3c0, {0x0, 0x0}, 0xc0056f3540, {0xf74ab38, 0xc00580aa80}, {0x0, 0x0}, 0x0)
        /jenkins/go-1.21/go/src/go/types/expr.go:965 +0x1a6
go/types.(*Checker).multiExpr(0xc004cec3c0, {0xf74ab38, 0xc00580aa80}, 0x0)
        /jenkins/go-1.21/go/src/go/types/expr.go:1517 +0x82
go/types.(*Checker).initVars(0xc004cec3c0, {0xc001e339f0, 0x1, 0x1}, {0xc00580cf70, 0x1, 0x1}, {0x0, 0x0})
        /jenkins/go-1.21/go/src/go/types/assignments.go:398 +0x120
go/types.(*Checker).shortVarDecl(0xc004cec3c0, {0xf747698, 0xc00177bba0}, {0xc00580cf50, 0x1, 0x1}, {0xc00580cf70, 0x1, 0x1})
        /jenkins/go-1.21/go/src/go/types/assignments.go:546 +0xbe0
go/types.(*Checker).stmt(0xc004cec3c0, 0x0, {0xf74ae08, 0xc00580aac0})
        /jenkins/go-1.21/go/src/go/types/stmt.go:476 +0xede
go/types.(*Checker).stmtList(0xc004cec3c0, 0x0, {0xc004dbd800, 0x1e, 0x20})
        /jenkins/go-1.21/go/src/go/types/stmt.go:124 +0xbe
go/types.(*Checker).funcBody(0xc004cec3c0, 0xc0052fcba0, {0xc005682e7c, 0x4}, 0xc005458040, 0xc004a8f390, {0x0, 0x0})
        /jenkins/go-1.21/go/src/go/types/stmt.go:44 +0x298
go/types.(*Checker).funcDecl.func1()
        /jenkins/go-1.21/go/src/go/types/decl.go:826 +0x84
go/types.(*Checker).processDelayed(0xc004cec3c0, 0x0)
        /jenkins/go-1.21/go/src/go/types/check.go:439 +0x204
go/types.(*Checker).checkFiles(0xc004cec3c0, {0xc004b88ea0, 0x2, 0x2})
        /jenkins/go-1.21/go/src/go/types/check.go:383 +0x2d8
go/types.(*Checker).Files(...)
        /jenkins/go-1.21/go/src/go/types/check.go:341
go/types.(*Config).Check(0xc0052fc0c0, {0xc000428420, 0x1a}, 0xc0004c00c0, {0xc004b88ea0, 0x2, 0x2}, 0x0)
        /jenkins/go-1.21/go/src/go/types/api.go:425 +0x1e6
github.com/zosopentools/wharf/internal/packages.(*Package).Build(0xc000480a90, 0x0, 0xc00504bfa0)
        /jenkins/workspace/Port-Build/wharf/wharf/internal/packages/build.go:62 +0x212
github.com/zosopentools/wharf/internal/porting.port(0xc000480a90, 0xc0011b5810)
        /jenkins/workspace/Port-Build/wharf/wharf/internal/porting/port.go:373 +0x9b2
github.com/zosopentools/wharf/internal/porting.run({0xc0011140d0, 0x1, 0x1}, 0xc0011b5810)
        /jenkins/workspace/Port-Build/wharf/wharf/internal/porting/port.go:173 +0x2d8
github.com/zosopentools/wharf/internal/porting.Port({0xc0011140d0, 0x1, 0x1}, 0xc0011b5810)
        /jenkins/workspace/Port-Build/wharf/wharf/internal/porting/port.go:90 +0x4aa
main.main1(...)
        /jenkins/workspace/Port-Build/wharf/wharf/main.go:147
main.main()
        /jenkins/workspace/Port-Build/wharf/wharf/main.go:119 +0xd48

Note that I made some manual changes - adding z/OS implementations to two files in the package: