tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 454 forks source link

godep no longer saving dependencies in Godep.json #460

Closed Throckmortra closed 6 years ago

Throckmortra commented 8 years ago

Worked fine up until today. Now it wipes all dependencies from Godep.json if run in a project directory. Deleting Godep directory and doing a new save doesn't fix. Updated Godep, still broken.

Throckmortra commented 8 years ago
godep save -d
versionString() godep v62 (darwin/amd64/go1.6)
majorGoVersion go1.6
VendorExperiment true
sep /vendor/
dotPackageImportPath: .
dotPackageDir: /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp
LoadPackages [.]
listPackage .
findDirForPath . <nil>
Looking For Package: . in /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp
&build.Package{
    Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
    Name:           "",
    ImportComment:  "",
    Doc:            "",
    ImportPath:     ".",
    Root:           "",
    SrcRoot:        "",
    PkgRoot:        "",
    PkgTargetRoot:  "",
    BinDir:         "",
    Goroot:         false,
    PkgObj:         "",
    AllTags:        nil,
    ConflictDir:    "",
    GoFiles:        nil,
    CgoFiles:       nil,
    IgnoredGoFiles: nil,
    InvalidGoFiles: nil,
    CFiles:         nil,
    CXXFiles:       nil,
    MFiles:         nil,
    HFiles:         nil,
    SFiles:         nil,
    SwigFiles:      nil,
    SwigCXXFiles:   nil,
    SysoFiles:      nil,
    CgoCFLAGS:      nil,
    CgoCPPFLAGS:    nil,
    CgoCXXFLAGS:    nil,
    CgoLDFLAGS:     nil,
    CgoPkgConfig:   nil,
    Imports:        nil,
    ImportPos:      {},
    TestGoFiles:    nil,
    TestImports:    nil,
    TestImportPos:  {},
    XTestGoFiles:   nil,
    XTestImports:   nil,
    XTestImportPos: {},
}
Done Looking For Package: . in /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp
&main.Package{
    Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
    Root:           "",
    ImportPath:     ".",
    Deps:           nil,
    Standard:       false,
    Processed:      false,
    GoFiles:        nil,
    CgoFiles:       nil,
    IgnoredGoFiles: nil,
    TestGoFiles:    nil,
    TestImports:    nil,
    XTestGoFiles:   nil,
    XTestImports:   nil,
    Error:          struct { Err string }{},
    Imports:        nil,
}
[]*main.Package{
    &main.Package{
        Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
        Root:           "",
        ImportPath:     ".",
        Deps:           nil,
        Standard:       false,
        Processed:      false,
        GoFiles:        nil,
        CgoFiles:       nil,
        IgnoredGoFiles: nil,
        TestGoFiles:    nil,
        TestImports:    nil,
        XTestGoFiles:   nil,
        XTestImports:   nil,
        Error:          struct { Err string }{},
        Imports:        nil,
    },
}
Filtered projectPackages
[]*main.Package{
    &main.Package{
        Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
        Root:           "",
        ImportPath:     ".",
        Deps:           nil,
        Standard:       false,
        Processed:      false,
        GoFiles:        nil,
        CgoFiles:       nil,
        IgnoredGoFiles: nil,
        TestGoFiles:    nil,
        TestImports:    nil,
        XTestGoFiles:   nil,
        XTestImports:   nil,
        Error:          struct { Err string }{},
        Imports:        nil,
    },
}
fill .
[]*main.Package{
    &main.Package{
        Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
        Root:           "",
        ImportPath:     ".",
        Deps:           nil,
        Standard:       false,
        Processed:      false,
        GoFiles:        nil,
        CgoFiles:       nil,
        IgnoredGoFiles: nil,
        TestGoFiles:    nil,
        TestImports:    nil,
        XTestGoFiles:   nil,
        XTestImports:   nil,
        Error:          struct { Err string }{},
        Imports:        nil,
    },
}
LoadPackages []
path [.]
uniq, unqualify'd path [.]
LoadPackages [.]
listPackage .
findDirForPath . <nil>
Looking For Package: . in /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp
&build.Package{
    Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
    Name:           "",
    ImportComment:  "",
    Doc:            "",
    ImportPath:     ".",
    Root:           "",
    SrcRoot:        "",
    PkgRoot:        "",
    PkgTargetRoot:  "",
    BinDir:         "",
    Goroot:         false,
    PkgObj:         "",
    AllTags:        nil,
    ConflictDir:    "",
    GoFiles:        nil,
    CgoFiles:       nil,
    IgnoredGoFiles: nil,
    InvalidGoFiles: nil,
    CFiles:         nil,
    CXXFiles:       nil,
    MFiles:         nil,
    HFiles:         nil,
    SFiles:         nil,
    SwigFiles:      nil,
    SwigCXXFiles:   nil,
    SysoFiles:      nil,
    CgoCFLAGS:      nil,
    CgoCPPFLAGS:    nil,
    CgoCXXFLAGS:    nil,
    CgoLDFLAGS:     nil,
    CgoPkgConfig:   nil,
    Imports:        nil,
    ImportPos:      {},
    TestGoFiles:    nil,
    TestImports:    nil,
    TestImportPos:  {},
    XTestGoFiles:   nil,
    XTestImports:   nil,
    XTestImportPos: {},
}
Done Looking For Package: . in /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp
&main.Package{
    Dir:            "/Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp",
    Root:           "",
    ImportPath:     ".",
    Deps:           nil,
    Standard:       false,
    Processed:      false,
    GoFiles:        nil,
    CgoFiles:       nil,
    IgnoredGoFiles: nil,
    TestGoFiles:    nil,
    TestImports:    nil,
    XTestGoFiles:   nil,
    XTestImports:   nil,
    Error:          struct { Err string }{},
    Imports:        nil,
}
standard or dest skipping .
New Godeps Filled
&main.Godeps{
    ImportPath:   ".",
    GoVersion:    "go1.6",
    GodepVersion: "",
    Packages:     nil,
    Deps:         nil,
    isOldFile:    false,
}
[]main.Dependency(nil)
[]main.Dependency(nil)
[]string(nil)
freeformz commented 8 years ago

What are the contents of /Users/aaron/documents/gowork/src/github.com/Throckmortra/ryp ? What is your $GOPATH?

freeformz commented 8 years ago

Also, does go install -v . run / work / install anything?

freeformz commented 8 years ago

According to the output, godep didn't find any valid go files in . (GoFiles is nil)

freeformz commented 8 years ago

So you either have invalid go files in . (syntax error maybe?) or you need to specificy ./... when you save.

Throckmortra commented 8 years ago

ryp aaron$ ls Godeps Procfile README.md main.go manifest.yml rypresource.go

$GOPATH -bash: /Users/aaron/Documents/gowork: is a directory

go install runs and installs

Throckmortra commented 8 years ago

https://github.com/Throckmortra/ryp/blob/master/Godeps/Godeps.json

this is the Godeps.json when I committed it, working, 23 days ago

Throckmortra commented 8 years ago

godep save was working then and correctly saved Deps. Running godep save today after updating godep to v62 is wiping my deps on every project I've run it on

freeformz commented 8 years ago

v62 was just a doc update.

Throckmortra commented 8 years ago

as well as v61? https://github.com/Throckmortra/ryp/blob/master/Godeps/Godeps.json was commited while using v60

freeformz commented 8 years ago

Your $GOPATH is /Users/aaron/Documents/gowork and you are in /Users/aaron/documents/gowork. So there is still some case related isuses apparently.

Throckmortra commented 8 years ago

retrying with fixed path now

Throckmortra commented 8 years ago

thank god, that fixed it

Throckmortra commented 8 years ago

sorry I'm an idiot. Thank you for your help

freeformz commented 8 years ago

Hmm. Thanks for the report. I'll have to figure out a way to test this better. I don't think Travis CI has the option for case insensitive filesystems though.

abigailbeets commented 6 years ago

I'm also getting this issue when run at any level. Does the $GOPATH have to exactly match the project directory? I have multiple projects nested inside my $GOPATH so it seems odd to have to set it to be my specific project directory...

freeformz commented 6 years ago

Go projects go inside a go workspace, which is rooted inside of the $GOPATH. This is how Go works. Recent versions of Go have an implicit $GOPATH of $HOME/go, if none is defined.