Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vgo: 'vgo build ./...' includes inner module dependencies in the parent go.mod file #25414

Closed
ufoscout opened this issue May 16, 2018 · 2 comments
Milestone

Comments

@ufoscout
Copy link

What version of Go are you using (go version)?

go version go1.10.2 linux/amd64
go version go1.10.2 linux/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ufo/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ufo/workspaces/go"
GORACE=""
GOROOT="/home/ufo/Programs/go"
GOTMPDIR=""
GOTOOLDIR="/home/ufo/Programs/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build204477034=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I have a single repository with hierarchical modules, e.g.:

main
  |-- module_1
  |       |-- go.mod  <- it contains deps of module_1 only
  |       |-- "go files of module_1"
  |-- module_2
  |       |-- go.mod  <- it contains deps of module_2 only
  |       |-- "go files of module_2"
  |-- go.mod  <- it contains deps of module main only
  |-- "go files of main"

If I execute "vgo build" in each folder separately everything works as expected. However, if I execute "vgo build ./..." or "vgo test ./..." in the main folder then the go.mod file of main is automatically modified to include all the dependencies of the internal modules (in this case, module_1 and module_2)

What did you expect to see?

I expected that executing "vgo build ./..." (or "vgo test ./...") each modules was built (or tested) independently and the go.mod file of each module was not impacted by the one of the others.

What did you see instead?

The go.mod file of the parent at the end of the build contains all the dependencies of the inner modules.

@gopherbot gopherbot added this to the vgo milestone May 16, 2018
@myitcv
Copy link
Member

myitcv commented May 16, 2018

I think this is a dup of #24749

@rsc
Copy link
Contributor

rsc commented Jun 6, 2018

Yes dup of #24749 / #24605.

@rsc rsc closed this as completed Jun 6, 2018
@golang golang locked and limited conversation to collaborators Jun 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants