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

cmd/go: submodule info is omitted in runtime/debug.modinfo #28753

Open
hyangah opened this Issue Nov 12, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@hyangah
Contributor

hyangah commented Nov 12, 2018

Dependency on submodule (in the same repo) sometimes doesn't appear in the debug modinfo.

Tested with Go built from the tip today

$ go version
go version devel +f58b02a29c Sun Nov 11 18:49:40 2018 +0000 linux/amd64

How to reproduce:

$ go get rsc.io/goversion

$ git clone https://github.com/hyangah/modtest7.git
$ cd modtest7
$ tree
.
├── go.mod
├── go.sum
├── hello
│   ├── go.mod
│   └── hello.go
└── main.go
$ cat main.go
package main

import (
	"github.com/hyangah/modtest7/hello"
)

func main() {
	hello.Hi()
}

$ go build
$ goversion -m modtest7
modtest7 devel +f58b02a29c Sun Nov 11 18:49:40 2018 +0000
	path  github.com/hyangah/modtest7
	mod   github.com/hyangah/modtest7  (devel)

I expected the module github.com/hyangah/modtest7/hello is listed as a dependency, but it didn't appear.

go build -x -v output
$ go build -x -v
WORK=/tmp/go-build666928546
mkdir -p /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24 # git2 https://github.com/hyangah/modtest7
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git init --bare
0.005s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git init --bare
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git remote add origin https://github.com/hyangah/modtest7
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git remote add origin https://github.com/hyangah/modtest7
go: finding github.com/hyangah/modtest7/hello v0.0.0-20181112233247-afc59526b1e9
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' afc59526b1e9
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' afc59526b1e9
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git tag -l
0.002s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git tag -l
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git ls-remote -q origin
0.244s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git ls-remote -q origin
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
0.293s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' afc59526b1e9
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' afc59526b1e9
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
go: downloading github.com/hyangah/modtest7/hello v0.0.0-20181112233247-afc59526b1e9
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:hello/go.mod
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ afc59526b1e9357dfd74c2b55fedf7c09461e2e9 -- hello
0.004s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ afc59526b1e9357dfd74c2b55fedf7c09461e2e9 -- hello
cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:LICENSE
0.003s # cd /usr/local/google/home/hakim/go/pkg/mod/cache/vcs/690aa3d58c3a1743e72ae301f73382e197623d579a5ad3ddc35eca733d606c24; git cat-file blob afc59526b1e9357dfd74c2b55fedf7c09461e2e9:LICENSE
mkdir -p $WORK/b001/
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile github.com/hyangah/modtest7=/usr/local/google/home/hakim/.cache/go-build/f3/f3364a757515e565a17db8ce81386ba3ce3cfc3d411b3d94838c597c3de137e7-d
packagefile github.com/hyangah/modtest7/hello=/usr/local/google/home/hakim/.cache/go-build/27/2763495febf1ae14d202f8e098930fc5d5329828aa73caf78f1d3517f3b8e2e3-d
packagefile runtime=/usr/local/google/home/hakim/.cache/go-build/fa/fadd0857eaf0d83dbe2ea7918b5b8c1b7849ff105ff155d26c29341dfb479130-d
packagefile internal/bytealg=/usr/local/google/home/hakim/.cache/go-build/b9/b9aa84a005f37674bb1d54facbba420cac72f89554ec18744e4fc10e15b1a573-d
packagefile internal/cpu=/usr/local/google/home/hakim/golang/go/pkg/linux_amd64/internal/cpu.a
packagefile runtime/internal/atomic=/usr/local/google/home/hakim/golang/go/pkg/linux_amd64/runtime/internal/atomic.a
packagefile runtime/internal/math=/usr/local/google/home/hakim/golang/go/pkg/linux_amd64/runtime/internal/math.a
packagefile runtime/internal/sys=/usr/local/google/home/hakim/golang/go/pkg/linux_amd64/runtime/internal/sys.a
EOF
mkdir -p $WORK/b001/exe/
cd .
/usr/local/google/home/hakim/golang/go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=yV_6u0tuDNnxPReT53qd/iEGjVHL_ChZAAZfv5eKJ/JVIBetcUg4mrkMBZzVD2/yV_6u0tuDNnxPReT53qd -extld=gcc /usr/local/google/home/hakim/.cache/go-build/f3/f3364a757515e565a17db8ce81386ba3ce3cfc3d411b3d94838c597c3de137e7-d
/usr/local/google/home/hakim/golang/go/pkg/tool/linux_amd64/buildid -w $WORK/b001/exe/a.out # internal
mv $WORK/b001/exe/a.out modtest7
rm -r $WORK/b001/

I suspect this is related to #28083.

@hyangah hyangah added the modules label Nov 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment