Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during go get tinygo.org/x/tinygba #2

Open
scraly opened this issue Dec 21, 2023 · 9 comments
Open

Error during go get tinygo.org/x/tinygba #2

scraly opened this issue Dec 21, 2023 · 9 comments

Comments

@scraly
Copy link

scraly commented Dec 21, 2023

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

@deadprogram
Copy link
Member

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

@scraly
Copy link
Author

scraly commented Dec 21, 2023

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?

@deadprogram
Copy link
Member

what is the output when you run this command?

tinygo env

@scraly
Copy link
Author

scraly commented Dec 21, 2023

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"

@deadprogram
Copy link
Member

Last question, hopefully:

which tinygo

@scraly
Copy link
Author

scraly commented Dec 21, 2023

 $ 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)

@JuanHeza
Copy link

JuanHeza commented Mar 5, 2024

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)

@scraly
Copy link
Author

scraly commented Mar 5, 2024

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

@JuanHeza
Copy link

JuanHeza commented Mar 6, 2024

Thank you, it worked 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants