owenthereal / nut

Vendor Go dependencies
https://github.com/jingweno/nut
MIT License
232 stars 11 forks source link

Error `no buildable Go source files ...` when no go file on repo root #17

Closed evalphobia closed 9 years ago

evalphobia commented 9 years ago

facts

When no go source files on repository root, go get emits an error like below.

$ nut install

Downloading foo/bar@1234abcd
Vendoring dependencies

package foo/bar 
    imports foo/bar:  no buildable Go source files in /var/folders/xx/xxx/xx/src/foo/bar

problems

some repository does not contain any go files on its directory root.

For example: https://github.com/awslabs/aws-sdk-go/

[dependencies]

# Below this doesn't work
# "github.com/awslabs/aws-sdk-go" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"

# Do I have to write every package recursively?
"github.com/awslabs/aws-sdk-go/aws" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"
"github.com/awslabs/aws-sdk-go/apis/config" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"
"github.com/awslabs/aws-sdk-go/apis/dynamodb" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"
"github.com/awslabs/aws-sdk-go/internal/endpoints" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"
"github.com/awslabs/aws-sdk-go/internal/protocol/query" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"
"github.com/awslabs/aws-sdk-go/..." = "..."

I know this error is from go get, but it's difficult and tedious to write each dirs on Nut.toml. Any option or flag to avoid this?

thanks,

owenthereal commented 9 years ago

Declaring with just the repository and SHA should work and I just verified it:

[dependencies]

"github.com/awslabs/aws-sdk-go" = "8753e85c61243cf9c31ac5cafa6596dfc77d2a24"

With your latest contribution on https://github.com/jingweno/nut/pull/18, the above should be working - previously git-clone downloads the package to the wrong folder so it triggers a go-get.

evalphobia commented 9 years ago

Thanks for your confirmation. I checked and fixed this. But I found a problem of import URL, so open another issue.