Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Symlink build behavior change #528

Closed
fzerorubigd opened this issue Dec 31, 2015 · 9 comments
Closed

Symlink build behavior change #528

fzerorubigd opened this issue Dec 31, 2015 · 9 comments

Comments

@fzerorubigd
Copy link

Before #511 this structure was ok :

.
├── src
│   └── somecode -> ../vendor/someplace/somecode
└── vendor
    └── someplace
        └── somecode
            └── main.go

this code : https://github.com/fzerorubigd/gb511,
gb build dose not build anything with error FATAL: command "build" failed: no packages supplied , but gb build somecode build it ok.
but in new version I get this error :

$ gb build someplace                                        
FATAL: command "build" failed: failed to resolve import path "someplace": import "someplace": not a directory

I don't know if this is a bug or not, but its somehow change in the old behavior.

@davecheney
Copy link
Contributor

@fzerorubigd I don't believe that old behaviour was supported. The go/build package was ruthless in its rejection of symlinks.

The workaround from #100 was to cd into $PROJECT/vendor and build, that would place any binary dependencies in $PROJECT/vendor/bin.

I'll check an older revision and confirm.

Wrt. your example, gb only builds code that is in $PROJECT/src/. If there are other dependencies in $GOROOT/src or $PROJECT/vendor/src then they would be built transitively but were never considered to be the roots of any package built (modulo #505 which is hard to exploit)

@davecheney
Copy link
Contributor

Another workaround is to move the vendored someplace/somecode into $PROJECT/src.

@fzerorubigd
Copy link
Author

In my case, I can not move the code inside the src. there is a library attached to this code. splitting that package into two separate package is out of my control. its something like go-bindata (see #100)

@davecheney
Copy link
Contributor

@fzerorubigd how about this as a counterproposal

gb build $PKG will build that package if it finds it in $PROJECT/src or
$PROJECT/vendor/src ?

On Thu, Dec 31, 2015 at 11:04 PM, fzerorubigd notifications@github.com
wrote:

In my case, I can not move the code inside the src. there is a library
attached to this code. splitting that package into two separate package is
out of my control. its something like go-bindata (see #100
#100)


Reply to this email directly or view it on GitHub
#528 (comment).

@fzerorubigd
Copy link
Author

That's great. +1!

@davecheney
Copy link
Contributor

@fzerorubigd ok, i'll look into how complicated it is to make that happen. For reference

cd $PROJECT; gb build

will only build the contents of $PROJECT/src/...

but

cd $PROJECT; gb build $PKG

will build $PKG if it is found in $PROJECT/src/$PKG or $PROJECT/vendor/src/$PKG

How does that sound ?

@fzerorubigd
Copy link
Author

This is ok, I already use this by setting the GOPATH and using the Go tool in a make file (as a workaround)

@davecheney
Copy link
Contributor

@fzerorubigd closed in #555.

@fzerorubigd
Copy link
Author

@davecheney Thank you!

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

No branches or pull requests

2 participants