usbarmory / tamago-example

TamaGo - example application
BSD 3-Clause "New" or "Revised" License
69 stars 14 forks source link

Build failure `net.SocketFunc` and `net.DefaultNS` undefined #20

Closed wizche closed 1 year ago

wizche commented 1 year ago

Howdy,

I'm buildiing the example app against the MKII with

$ make imx TARGET=usbarmory                                                    
/home/wizche/repos/tamago-go-latest/bin/go install github.com/usbarmory/crucible/cmd/habtool
cp -f /home/wizche/go/pkg/mod/github.com/usbarmory/crucible@v0.0.0-20230412092556-269c90b0067e/cmd/crucible/fusemaps/IMX6ULL.yaml cmd/IMX6ULL.yaml
GO_EXTLINK_ENABLED=0 CGO_ENABLED=0 GOOS=tamago GOARM=7 GOARCH=arm /home/wizche/repos/tamago-go-latest/bin/go build -tags usbarmory,linkramsize,native -trimpath -ldflags "-s -w -T 0x80010000  -E _rt0_arm_tamago -R 0x1000 -X 'main.Build=wizche@beast on 2023-07-03 20:09:52' -X 'main.Revision=b7b5498'" -o example
# github.com/usbarmory/tamago-example/network
network/const.go:25:6: undefined: net.DefaultNS
network/imx-enet.go:85:6: undefined: net.SocketFunc
network/imx-usbnet.go:81:6: undefined: net.SocketFunc
make: *** [Makefile:147: example] Error 1

Using TamaGo built from sources:

$ wget https://github.com/usbarmory/tamago-go/archive/refs/tags/latest.zip
$ unzip latest.zip
$ cd tamago-go-latest/src && ./all.bash
$ cd ../bin && export TAMAGO=`pwd`/go
$ go version
go version go1.20.5 linux/amd64

Targeting qemu results in the same error:

$ go clean -modcache
$ make qemu         
/home/wizche/repos/tamago-go-latest/bin/go install github.com/usbarmory/crucible/cmd/habtool
go: downloading github.com/usbarmory/crucible v0.0.0-20230412092556-269c90b0067e
go: downloading go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352
cp -f /home/wizche/go/pkg/mod/github.com/usbarmory/crucible@v0.0.0-20230412092556-269c90b0067e/cmd/crucible/fusemaps/IMX6ULL.yaml cmd/IMX6ULL.yaml
GO_EXTLINK_ENABLED=0 CGO_ENABLED=0 GOOS=tamago GOARM=7 GOARCH=arm /home/wizche/repos/tamago-go-latest/bin/go build -tags "usbarmory",linkramsize,semihosting -trimpath -ldflags "-s -w -T 0x80010000 -E _rt0_arm_tamago -R 0x1000 -X 'main.Build=wizche@beast on 2023-07-03 20:22:56' -X 'main.Revision=b7b5498'" -o example
go: downloading github.com/arl/statsviz v0.5.2
go: downloading github.com/usbarmory/imx-enet v0.0.0-20230622162703-9eec0bcf6bb4
go: downloading golang.org/x/crypto v0.10.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20230623170555-183630ada7e0
go: downloading golang.org/x/term v0.9.0
go: downloading github.com/usbarmory/tamago v0.0.0-20230629154957-a6a5aa50eeed
go: downloading github.com/usbarmory/imx-usbnet v0.0.0-20230626092818-ef791923688e
go: downloading github.com/Harvey-OS/ninep v0.0.0-20200724082702-d30a6d4f9789
go: downloading github.com/btcsuite/btcd/btcec/v2 v2.3.2
go: downloading github.com/btcsuite/btcd/btcutil v1.1.3
go: downloading github.com/btcsuite/btcd v0.23.4
go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
go: downloading github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564
go: downloading github.com/cloudflare/circl v1.3.3
go: downloading github.com/psanford/wormhole-william v1.0.6
go: downloading gvisor.dev/gvisor v0.0.0-20230614190805-57027c7d31f8
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading golang.org/x/sync v0.1.0
go: downloading github.com/gorilla/websocket v1.4.2
go: downloading github.com/klauspost/compress v1.11.13
go: downloading salsa.debian.org/vasudev/gospake2 v0.0.0-20180813171123-adcc69dd31d5
go: downloading github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
go: downloading github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading nhooyr.io/websocket v1.8.6
go: downloading github.com/google/btree v1.0.1
go: downloading golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
go: downloading golang.org/x/sys v0.9.0
go: downloading github.com/decred/dcrd/crypto/blake256 v1.0.0
# github.com/usbarmory/tamago-example/network
network/const.go:25:6: undefined: net.DefaultNS
network/imx-enet.go:85:6: undefined: net.SocketFunc
network/imx-usbnet.go:81:6: undefined: net.SocketFunc
make: *** [Makefile:147: example] Error 1

I'm running Debian 11 Bullseye:

##### Test execution environment.
# GOARCH: amd64
# CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
# GOOS: linux
# OS Version: Linux 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64

Thanks a lot

abarisani commented 1 year ago

Hello, if you are using the latest tamago-example please use https://github.com/usbarmory/tamago-go/tree/tamago1.20.5 as apparently the latest tag is not correctly synced (we'll fix that).

andrejro commented 1 year ago

Fixed: tag latest now points to tamago-go1.20.5.