{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/29055","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/29055/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/29055/comments","events_url":"https://api.github.com/repos/golang/go/issues/29055/events","html_url":"https://github.com/golang/go/issues/29055","id":386463187,"node_id":"MDU6SXNzdWUzODY0NjMxODc=","number":29055,"title":"plugin: not usable on another host using same go version and common dependencies","user":{"login":"oszika","id":21699894,"node_id":"MDQ6VXNlcjIxNjk5ODk0","avatar_url":"https://avatars3.githubusercontent.com/u/21699894?v=4","gravatar_id":"","url":"https://api.github.com/users/oszika","html_url":"https://github.com/oszika","followers_url":"https://api.github.com/users/oszika/followers","following_url":"https://api.github.com/users/oszika/following{/other_user}","gists_url":"https://api.github.com/users/oszika/gists{/gist_id}","starred_url":"https://api.github.com/users/oszika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oszika/subscriptions","organizations_url":"https://api.github.com/users/oszika/orgs","repos_url":"https://api.github.com/users/oszika/repos","events_url":"https://api.github.com/users/oszika/events{/privacy}","received_events_url":"https://api.github.com/users/oszika/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"node_id":"MDU6TGFiZWwzNzM0MDIyODk=","url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-01T14:30:22Z","updated_at":"2018-12-03T20:13:03Z","closed_at":null,"author_association":"NONE","body":"### What version of Go are you using (`go version`)?\r\n\r\n<pre>\r\n$ go version\r\ngo version go1.11.2 linux/amd64\r\n</pre>\r\n\r\n### Does this issue reproduce with the latest release?\r\nYes\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\n<details><summary><code>go env</code> ArchLinux host</summary><br><pre>\r\n$ go env\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/home/oszika/.cache/go-build\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/home/oszika/go\"\r\nGOPROXY=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/lib/go\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/lib/go/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"gcc\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"/home/oszika/go/src/plugin/main/go.mod\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build912174408=/tmp/go-build -gno-record-gcc-switches\"\r\n</pre></details>\r\n\r\n<details><summary><code>go env</code> Docker golang:1.11.2</summary><br><pre>\r\n$ go env\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/root/.cache/go-build\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/go\"\r\nGOPROXY=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/local/go\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/local/go/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"gcc\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"/plugins/main/go.mod\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build407785075=/tmp/go-build -gno-record-gcc-switches\"\r\n</pre></details>\r\n\r\n### What did you do?\r\n\r\n<!--\r\nIf possible, provide a recipe for reproducing the error.\r\nA complete runnable program is good.\r\nA link on play.golang.org is best.\r\n-->\r\n\r\nI try to build plugin on host and use it on container. Versions of common dependencies are defined in go.mod.\r\n\r\n#### p1/go.mod\r\n```\r\nmodule p1\r\n\r\nrequire gopkg.in/yaml.v2 v2.2.1\r\n```\r\n\r\n#### p1/p1.go\r\n```\r\npackage main\r\n\r\nimport (\r\n        \"fmt\"\r\n\r\n        yaml \"gopkg.in/yaml.v2\"\r\n)\r\n\r\nvar e = yaml.Encoder{}\r\n\r\nfunc init() { fmt.Printf(\"p1: Type: %T\\n\", e) }\r\n\r\nfunc main() {}\r\n```\r\n\r\n#### main/go.mod\r\n\r\n```\r\nmodule main\r\n\r\nrequire (\r\n        gopkg.in/yaml.v2 v2.2.1\r\n        p1 v0.0.0 // indirect\r\n)\r\n\r\nreplace p1 => ../p1\r\n```\r\n\r\n#### main/main.go\r\n```\r\npackage main\r\n\r\nimport (\r\n        \"fmt\"\r\n        \"plugin\"\r\n\r\n        yaml \"gopkg.in/yaml.v2\"\r\n)\r\n\r\nvar e = yaml.Encoder{}\r\n\r\nfunc init() { fmt.Printf(\"main: Type: %T\\n\", e) }\r\n\r\nfunc main() {\r\n        if _, err := plugin.Open(\"p1.so\"); err != nil {\r\n                panic(err)\r\n        }\r\n}\r\n```\r\n\r\nOn host :\r\n\r\n.../main $ go build -buildmode=plugin p1\r\n\r\nOn docker\r\n\r\n.../main $ go run main.go\r\n\r\n### What did you expect to see?\r\nLike on host:\r\n\r\n```\r\n.../main $ go run main.go\r\nmain: Type: yaml.Encoder\r\np1: Type: yaml.Encode\r\n```\r\n\r\n### What did you see instead?\r\n\r\n```\r\n.../main $ go run main.go \r\ngo: finding gopkg.in/yaml.v2 v2.2.1\r\ngo: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405\r\ngo: downloading gopkg.in/yaml.v2 v2.2.1\r\nmain: Type: yaml.Encoder\r\npanic: plugin.Open(\"p1\"): plugin was built with a different version of package gopkg.in/yaml.v2\r\n\r\ngoroutine 1 [running]:\r\nmain.main()\r\n\t/plugins/main/main.go:16 +0x63\r\nexit status 2\r\n```\r\n\r\nExcept the GOROOT, the package built seems the same:\r\n\r\nOn host:\r\n\r\n```\r\n#\r\n# gopkg.in/yaml.v2\r\n#\r\n\r\nmkdir -p $WORK/b026/\r\ncat >$WORK/b026/importcfg << 'EOF' # internal\r\n# import config\r\npackagefile bytes=/usr/lib/go/pkg/linux_amd64/bytes.a\r\npackagefile encoding=/usr/lib/go/pkg/linux_amd64/encoding.a\r\npackagefile encoding/base64=/usr/lib/go/pkg/linux_amd64/encoding/base64.a\r\npackagefile errors=/usr/lib/go/pkg/linux_amd64/errors.a\r\npackagefile fmt=/usr/lib/go/pkg/linux_amd64/fmt.a\r\npackagefile io=/usr/lib/go/pkg/linux_amd64/io.a\r\npackagefile math=/usr/lib/go/pkg/linux_amd64/math.a\r\npackagefile reflect=/usr/lib/go/pkg/linux_amd64/reflect.a\r\npackagefile regexp=/usr/lib/go/pkg/linux_amd64/regexp.a\r\npackagefile sort=/usr/lib/go/pkg/linux_amd64/sort.a\r\npackagefile strconv=/usr/lib/go/pkg/linux_amd64/strconv.a\r\npackagefile strings=/usr/lib/go/pkg/linux_amd64/strings.a\r\npackagefile sync=/usr/lib/go/pkg/linux_amd64/sync.a\r\npackagefile time=/usr/lib/go/pkg/linux_amd64/time.a\r\npackagefile unicode=/usr/lib/go/pkg/linux_amd64/unicode.a\r\npackagefile unicode/utf8=/usr/lib/go/pkg/linux_amd64/unicode/utf8.a\r\nEOF\r\ncd /home/oszika/go/pkg/mod/gopkg.in/yaml.v2@v2.2.1\r\n/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/b026/_pkg_.a -trimpath $WORK/b026 -p gopkg.in/yaml.v2 -complete -buildid -TBoSu6rbJldl0TAHMGq/-TBoSu6rbJldl0TAHMGq -goversion go1.11.2 -D \"\" -importcfg $WORK/b026/importcfg -pack -c=4 ./apic.go ./decode.go ./emitterc.go ./encode.go ./parserc.go ./readerc.go ./resolve.go ./scannerc.go ./sorter.go ./writerc.go ./yaml.go ./yamlh.go ./yamlprivateh.go\r\n/usr/lib/go/pkg/tool/linux_amd64/buildid -w $WORK/b026/_pkg_.a # internal\r\n```\r\n\r\nOn container:\r\n\r\n```\r\n#\r\n# gopkg.in/yaml.v2\r\n#\r\n\r\nmkdir -p $WORK/b026/\r\ncat >$WORK/b026/importcfg << 'EOF' # internal\r\n# import config\r\npackagefile bytes=/usr/local/go/pkg/linux_amd64/bytes.a\r\npackagefile encoding=/usr/local/go/pkg/linux_amd64/encoding.a\r\npackagefile encoding/base64=/usr/local/go/pkg/linux_amd64/encoding/base64.a\r\npackagefile errors=/usr/local/go/pkg/linux_amd64/errors.a\r\npackagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.a\r\npackagefile io=/usr/local/go/pkg/linux_amd64/io.a\r\npackagefile math=/usr/local/go/pkg/linux_amd64/math.a\r\npackagefile reflect=/usr/local/go/pkg/linux_amd64/reflect.a\r\npackagefile regexp=/usr/local/go/pkg/linux_amd64/regexp.a\r\npackagefile sort=/usr/local/go/pkg/linux_amd64/sort.a\r\npackagefile strconv=/usr/local/go/pkg/linux_amd64/strconv.a\r\npackagefile strings=/usr/local/go/pkg/linux_amd64/strings.a\r\npackagefile sync=/usr/local/go/pkg/linux_amd64/sync.a\r\npackagefile time=/usr/local/go/pkg/linux_amd64/time.a\r\npackagefile unicode=/usr/local/go/pkg/linux_amd64/unicode.a\r\npackagefile unicode/utf8=/usr/local/go/pkg/linux_amd64/unicode/utf8.a\r\nEOF\r\ncd /go/pkg/mod/gopkg.in/yaml.v2@v2.2.1\r\n/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b026/_pkg_.a -trimpath $WORK/b026 -p gopkg.in/yaml.v2 -complete -buildid Vu3xvoPx_6--pylAg8yB/Vu3xvoPx_6--pylAg8yB -goversion go1.11.2 -D \"\" -importcfg $WORK/b026/importcfg -pack -c=4 ./apic.go ./decode.go ./emitterc.go ./encode.go ./parserc.go ./readerc.go ./resolve.go ./scannerc.go ./sorter.go ./writerc.go ./yaml.go ./yamlh.go ./yamlprivateh.go\r\n/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b026/_pkg_.a # internal\r\n```"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/443853584","html_url":"https://github.com/golang/go/issues/29055#issuecomment-443853584","issue_url":"https://api.github.com/repos/golang/go/issues/29055","id":443853584,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mzg1MzU4NA==","user":{"login":"oszika","id":21699894,"node_id":"MDQ6VXNlcjIxNjk5ODk0","avatar_url":"https://avatars3.githubusercontent.com/u/21699894?v=4","gravatar_id":"","url":"https://api.github.com/users/oszika","html_url":"https://github.com/oszika","followers_url":"https://api.github.com/users/oszika/followers","following_url":"https://api.github.com/users/oszika/following{/other_user}","gists_url":"https://api.github.com/users/oszika/gists{/gist_id}","starred_url":"https://api.github.com/users/oszika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oszika/subscriptions","organizations_url":"https://api.github.com/users/oszika/orgs","repos_url":"https://api.github.com/users/oszika/repos","events_url":"https://api.github.com/users/oszika/events{/privacy}","received_events_url":"https://api.github.com/users/oszika/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T20:13:03Z","updated_at":"2018-12-03T20:13:03Z","author_association":"NONE","body":"Sorry for the error but I confirm that the behavior is the same using GOPATH.\r\n\r\nThe result of \"go list\" using modules :\r\n<details><summary><code>go list -m -json all</code> Archlinux host</summary><br><pre>\r\n$ GO111MODULE=on go list -m -json all                 \r\ngo: finding gopkg.in/yaml.v2 v2.2.1\r\ngo: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405\r\n{\r\n\t\"Path\": \"main\",\r\n\t\"Main\": true,\r\n\t\"Dir\": \"/home/oszika/go/src/plugin/main\",\r\n\t\"GoMod\": \"/home/oszika/go/src/plugin/main/go.mod\"\r\n}\r\n{\r\n\t\"Path\": \"gopkg.in/check.v1\",\r\n\t\"Version\": \"v0.0.0-20161208181325-20d25e280405\",\r\n\t\"Time\": \"2016-12-08T18:13:25Z\",\r\n\t\"Indirect\": true,\r\n\t\"GoMod\": \"/home/oszika/go/pkg/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod\"\r\n}\r\n{\r\n\t\"Path\": \"gopkg.in/yaml.v2\",\r\n\t\"Version\": \"v2.2.1\",\r\n\t\"Time\": \"2018-03-28T19:50:20Z\",\r\n\t\"GoMod\": \"/home/oszika/go/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.2.1.mod\"\r\n}\r\n{\r\n\t\"Path\": \"p1\",\r\n\t\"Version\": \"v0.0.0\",\r\n\t\"Replace\": {\r\n\t\t\"Path\": \"../p1\",\r\n\t\t\"Dir\": \"/home/oszika/go/src/plugin/p1\"\r\n\t},\r\n\t\"Indirect\": true,\r\n\t\"Dir\": \"/home/oszika/go/src/plugin/p1\",\r\n\t\"GoMod\": \"/home/oszika/go/src/plugin/p1/go.mod\"\r\n}\r\n</pre></details>\r\n\r\n<details><summary><code>go list -m -json all</code> Docker golang:1.11.2 host</summary><br><pre>\r\nroot@6b019df88e5d:/go/src/plugin/main# GO111MODULE=on go list -m -json all\r\ngo: finding gopkg.in/yaml.v2 v2.2.1\r\ngo: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405\r\n{\r\n\t\"Path\": \"main\",\r\n\t\"Main\": true,\r\n\t\"Dir\": \"/go/src/plugin/main\",\r\n\t\"GoMod\": \"/go/src/plugin/main/go.mod\"\r\n}\r\n{\r\n\t\"Path\": \"gopkg.in/check.v1\",\r\n\t\"Version\": \"v0.0.0-20161208181325-20d25e280405\",\r\n\t\"Time\": \"2016-12-08T18:13:25Z\",\r\n\t\"Indirect\": true,\r\n\t\"GoMod\": \"/go/pkg/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod\"\r\n}\r\n{\r\n\t\"Path\": \"gopkg.in/yaml.v2\",\r\n\t\"Version\": \"v2.2.1\",\r\n\t\"Time\": \"2018-03-28T19:50:20Z\",\r\n\t\"GoMod\": \"/go/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.2.1.mod\"\r\n}\r\n{\r\n\t\"Path\": \"p1\",\r\n\t\"Version\": \"v0.0.0\",\r\n\t\"Replace\": {\r\n\t\t\"Path\": \"../p1\",\r\n\t\t\"Dir\": \"/go/src/plugin/p1\"\r\n\t},\r\n\t\"Indirect\": true,\r\n\t\"Dir\": \"/go/src/plugin/p1\",\r\n\t\"GoMod\": \"/go/src/plugin/p1/go.mod\"\r\n}\r\n</pre></details>\r\n\r\nI will try to see if the problem occurs using same GOPATH and GOROOT."}}
{"actor":{"display_login":"oszika"}}