tinygba icon indicating copy to clipboard operation
tinygba copied to clipboard

Error during go get tinygo.org/x/tinygba

Open scraly opened this issue 1 year ago • 9 comments
trafficstars

Hi,

I've tried to use this repo in order to create some GBA apps/games and I have an error:

$ go get tinygo.org/x/tinygba
go: tinygo.org/x/tinygba imports
        device/gba: package device/gba is not in std (/home/gitpod/go/src/device/gba)
go: tinygo.org/x/tinygba imports
        machine: package machine is not in std (/home/gitpod/go/src/machine)

Can you help me about it?

thanks

scraly avatar Dec 21 '23 10:12 scraly

@scraly both of those packages are part of the tinygo-specific packages. Perhaps your tinygo env is not set correctly?

deadprogram avatar Dec 21 '23 10:12 deadprogram

I am in a new environment, with go 1.21.

in my memories you fixed 7 month ago the go.mod because device/gba where in a dev branch, isn't it?

So I think the go.mod file of ths repo need to be updated.

image

WDYT?

scraly avatar Dec 21 '23 10:12 scraly

what is the output when you run this command?

tinygo env

deadprogram avatar Dec 21 '23 11:12 deadprogram

Here is the output:

$ tinygo env
GOOS="linux"
GOARCH="amd64"
GOROOT="/home/gitpod/go"
GOPATH="/workspace/go"
GOCACHE="/home/gitpod/.cache/tinygo"
CGO_ENABLED="1"
TINYGOROOT="/home/linuxbrew/.linuxbrew/Cellar/tinygo/0.30.0"

scraly avatar Dec 21 '23 11:12 scraly

Last question, hopefully:

which tinygo

deadprogram avatar Dec 21 '23 11:12 deadprogram

 $ which tinygo
/home/linuxbrew/.linuxbrew/bin/tinygo

And I just tested in another machine, same problem:

$ go version
go version go1.21.5 darwin/arm64

$ tinygo version
tinygo version 0.30.0 darwin/amd64 (using go version go1.21.5 and LLVM version 16.0.1)

$ tinygo env
GOOS="darwin"
GOARCH="amd64"
GOROOT="/Users/avache/go/pkg/mod/golang.org/[email protected]"
GOPATH="/Users/avache/go"
GOCACHE="/Users/avache/Library/Caches/tinygo"
CGO_ENABLED="1"
TINYGOROOT="/Users/avache/homebrew/Cellar/tinygo/0.30.0"

$ which tinygo
/Users/avache/homebrew/bin/tinygo


$ tinygo run -target=gameboy-advance gopher.go
go: downloading tinygo.org/x/tinyfont v0.4.0
go: downloading tinygo.org/x/drivers v0.25.0
gopher.go:13:2: no required module provides package tinygo.org/x/tinygba; to add it:
	go get tinygo.org/x/tinygba


$ go get tinygo.org/x/tinygba
go: downloading tinygo.org/x/tinygba v0.0.0-20231205145444-0d73574106af
go: tinygo.org/x/tinygba imports
	device/gba: package device/gba is not in std (/Users/avache/go/pkg/mod/golang.org/[email protected]/src/device/gba)
go: tinygo.org/x/tinygba imports
	machine: package machine is not in std (/Users/avache/go/pkg/mod/golang.org/[email protected]/src/machine)

scraly avatar Dec 21 '23 12:12 scraly

i have the same problem :(

tinygo env GOOS="windows" GOARCH="amd64" GOROOT="C:\Program Files\Go\" GOPATH="D:\DevDog\Go" GOCACHE="C:\Users\juane\AppData\Local\tinygo" CGO_ENABLED="1" TINYGOROOT="C:\Users\juane\scoop\apps\tinygo\current"

go get tinygo.org/x/tinygba go: downloading tinygo.org/x/tinygba v0.0.0-20231205145444-0d73574106af go: tinygo.org/x/tinygba imports device/gba: package device/gba is not in std (C:\Program Files\Go\src\device\gba) go: tinygo.org/x/tinygba imports machine: package machine is not in std (C:\Program Files\Go\src\machine)

JuanHeza avatar Mar 05 '24 06:03 JuanHeza

my solution was to set in my environment that I am using go modules (instead of asking go to pull dependencies in a vendor folder):

$ GOFLAGS=-mod=mod tinygo build -o myapp.gba -target=gameboy-advance main.go

scraly avatar Mar 05 '24 10:03 scraly

Thank you, it worked 😸

JuanHeza avatar Mar 06 '24 05:03 JuanHeza