bluetooth icon indicating copy to clipboard operation
bluetooth copied to clipboard

vendoring not possible because of missing dependencies

Open ecksun opened this issue 5 years ago • 3 comments

I cannot seem to vendor my dependency in any project with a dependency on tinygo.org/x/bluetooth.

I can't run go mod tidy with the same error as show below.

I get the feeling it is related to the tooling not understanding the build tags as the errors appear to be related to importing tinygo packages.

Steps to reproduce

$ go mod init example.test/foobar
go: creating new go.mod: module example.test/foobar
$ wget --quiet https://raw.githubusercontent.com/tinygo-org/bluetooth/release/examples/scanner/main.go
$ go run ./main.go 
go: finding module for package tinygo.org/x/bluetooth
go: found tinygo.org/x/bluetooth in tinygo.org/x/bluetooth v0.1.0
scanning...
found device: ...
^Csignal: interrupt
$ go mod vendor
example.test/foobar imports
        tinygo.org/x/bluetooth imports
        device/arm: package device/arm is not in GOROOT (/home/user/bin/go1.15.1.linux-amd64/src/device/arm)
example.test/foobar imports
        tinygo.org/x/bluetooth imports
        device/nrf: package device/nrf is not in GOROOT (/home/user/bin/go1.15.1.linux-amd64/src/device/nrf)
example.test/foobar imports
        tinygo.org/x/bluetooth imports
        machine: package machine is not in GOROOT (/home/user/bin/go1.15.1.linux-amd64/src/machine)
example.test/foobar imports
        tinygo.org/x/bluetooth imports
        runtime/interrupt: package runtime/interrupt is not in GOROOT (/home/user/bin/go1.15.1.linux-amd64/src/runtime/interrupt)
example.test/foobar imports
        tinygo.org/x/bluetooth imports
        runtime/volatile: package runtime/volatile is not in GOROOT (/home/user/bin/go1.15.1.linux-amd64/src/runtime/volatile)

ecksun avatar Oct 08 '20 12:10 ecksun

I'm not sure that we are going to be able to handle module vendoring at the moment with the build tags that are needed to support TinyGo and various hardware platforms. I'll play around and see if I can figure something out.

deadprogram avatar Oct 24 '20 15:10 deadprogram

There might be a way to do this.

First, look up the GOROOT that is used by TinyGo. For example, using:

~$ tinygo info microbit
[...]
cached GOROOT:     /path/to/tinygo/goroot

Then you can use the GOROOT during the vendor operation:

GOROOT=/path/to/tinygo/goroot go mod vendor

aykevl avatar Oct 24 '20 18:10 aykevl

I'm not sure that we are going to be able to handle module vendoring at the moment with the build tags that are needed to support TinyGo and various hardware platforms. I'll play around and see if I can figure something out.

I see, I guess we can leave this issue open until it is, because it is a rather useful feature.

First, look up the GOROOT that is used by TinyGo. For example, using:

Alright, I'm not using TinyGo though :(

Anyway it's nice it's possible at all :)

ecksun avatar Oct 25 '20 22:10 ecksun