mattn / gom

Go Manager - bundle for go
1.38k stars 92 forks source link

gom lock #63

Closed reinerRubin closed 8 years ago

reinerRubin commented 8 years ago

I think, there is bug in gom/gen.go

        if isDir(filepath.Join(p, ".git")) {
            vcs = git
        } 

Gomfile:

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/awsutil'
gom 'github.com/aws/aws-sdk-go/aws/client'
gom 'github.com/aws/aws-sdk-go/aws/client/metadata'
gom 'github.com/aws/aws-sdk-go/aws/corehandlers'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds'
gom 'github.com/aws/aws-sdk-go/aws/defaults'
gom 'github.com/aws/aws-sdk-go/aws/ec2metadata'
gom 'github.com/aws/aws-sdk-go/aws/request'
gom 'github.com/aws/aws-sdk-go/aws/session'
gom 'github.com/aws/aws-sdk-go/private/endpoints'
gom 'github.com/aws/aws-sdk-go/private/protocol/query'
gom 'github.com/aws/aws-sdk-go/private/protocol/query/queryutil'
gom 'github.com/aws/aws-sdk-go/private/protocol/rest'
gom 'github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil'
gom 'github.com/aws/aws-sdk-go/private/signer/v4'
gom 'github.com/aws/aws-sdk-go/service/sns'

but .git dir is only on level https://github.com/aws/aws-sdk-go/.

reinerRubin commented 8 years ago

Temporally workaround is manual adding in Gomfile dir with .git dir

+ gom 'github.com/aws/aws-sdk-go'
mattn commented 8 years ago
package main

import (
    "github.com/aws/aws-sdk-go/aws"
)

func main() {
    println(aws.UseServiceDefaultRetries)
}

Trying gom gen gomfile, then following Gomfile is generated.

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/go-ini/ini'

And do gom lock. Gomfile.lock is generated

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/go-ini/ini'

Do you mean gom gen gomfile instead of gom lock?

reinerRubin commented 8 years ago

Hi, thanks.

Do you mean gom gen gomfile instead of gom lock?

Nope, I want to see locked commit. Something like this (Gomfile.lock after gom lock):

gom 'github.com/BurntSushi/toml', :commit => '056c9bc7be7190eaa7715723883caffa5f8fa3e4'
...
gom 'github.com/aws/aws-sdk-go', :commit => '9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8'
... aws stuff
mattn commented 8 years ago

Ah, okay. will fix in later.

reinerRubin commented 8 years ago

Thanks!

// My workaround works with aws but not with proto

no buildable Go source files
mattn commented 8 years ago

Fixed. But you need to remove following lines. Or gom gen gomfile again. (NOTE that copy backup current Gomfile)

gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/awsutil'
gom 'github.com/aws/aws-sdk-go/aws/client'
gom 'github.com/aws/aws-sdk-go/aws/client/metadata'
gom 'github.com/aws/aws-sdk-go/aws/corehandlers'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds'
gom 'github.com/aws/aws-sdk-go/aws/defaults'
gom 'github.com/aws/aws-sdk-go/aws/ec2metadata'
gom 'github.com/aws/aws-sdk-go/aws/request'
gom 'github.com/aws/aws-sdk-go/aws/session'
gom 'github.com/aws/aws-sdk-go/private/endpoints'
gom 'github.com/aws/aws-sdk-go/private/protocol/query'
gom 'github.com/aws/aws-sdk-go/private/protocol/query/queryutil'
gom 'github.com/aws/aws-sdk-go/private/protocol/rest'
gom 'github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil'
gom 'github.com/aws/aws-sdk-go/private/signer/v4'
gom 'github.com/aws/aws-sdk-go/service/sns'
reinerRubin commented 8 years ago

I got another problem.

Gomfile after "gom gen gomfile":

gom 'github.com/gogo/protobuf', :commit => 'd3235f01ecae4901dd9f7ea6af57a352c0189deb'
rm -rf _vendor
gom install 
...
downloading github.com/gogo/protobuf
package github.com/gogo/protobuf
        imports github.com/gogo/protobuf
        imports github.com/gogo/protobuf: no buildable Go source files in /home/XXX/Dev/go/src/gorep.qubeidea.net/cube-server/_vendor/src/github.com/gogo/protobuf
gom:  exit status 1

before your fix it was (Gomfile):

gom 'github.com/gogo/protobuf/proto'

and "gom install" was ok.

mattn commented 8 years ago

could you please try last commit?

reinerRubin commented 8 years ago

Sure!

reinerRubin commented 8 years ago

Wohoo! Looks like all is good. Every dependency in Gomfile is with commit. Build is also good. Thanks.

By the way. Can I update only one dependence from Gomfile with "gom update"? // If no I can do it on holidays.

mattn commented 8 years ago

Still not. But will do

mattn commented 8 years ago

added gom update. try last commit. But note that this feature is experimental. And this overwrite your Gomfile. Please try it after backup your files.