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

cmd/link: linking a c-shared archive into a Go program fails on Darwin #29061

Open
YoshikiShibata opened this issue Dec 1, 2018 · 9 comments
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Milestone

Comments

@YoshikiShibata
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

I tried to rebuild the latest tip version with all.bash on my Mac.

What did you expect to see?

No error.

What did you see instead?

$ git rev-parse HEAD
b397248168fcb26400ac6afb88bf6080497a819e
##### ../misc/cgo/testcshared
--- FAIL: TestGo2C2Go (4.85s)
    cshared_test.go:616: run: [go build -buildmode=c-shared -o /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/libtestgo2c2go.dylib go2c2go/go]
    cshared_test.go:641: run: [go build -o /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1 go2c2go/m1]
    cshared_test.go:642: command failed: [/var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1]
        signal: abort trap
        dyld: Library not loaded: libtestgo2c2go.dylib
          Referenced from: /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1
          Reason: image not found
        
FAIL
2018/12/02 08:32:51 Failed: exit status 1

Does this issue reproduce with the latest release (go1.11.2)?

N/A

System details

go version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/yoshiki/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yoshiki/gocode:/Users/yoshiki/exercises/gpl:/Users/yoshiki/oak"
GOPROXY=""
GORACE=""
GOROOT="/Users/yoshiki/tools/go"
GOTMPDIR=""
GOTOOLDIR="/Users/yoshiki/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000
uname -v: Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.14.1
BuildVersion:	18B75
lldb --version: lldb-1000.0.38.2
  Swift-4.2
@odeke-em
Copy link
Member

odeke-em commented Dec 2, 2018

Thank you for filing this issue @YoshikiShibata!

Kindly paging @ianlancetaylor @bcmills.

@YoshikiShibata
Copy link
Author

This problem is still happening. Why is nobody assigned to this issue?

@bcmills
Copy link
Contributor

bcmills commented Dec 3, 2018

Why is nobody assigned to this issue?

It was reported two days ago, at the beginning of the weekend. Please be patient.

@bcmills
Copy link
Contributor

bcmills commented Dec 3, 2018

Looking at the build dashboard, it appears that the failure was introduced in CL 152079, which was intended to fix #27019.

(CC @eliasnaur)

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Dec 3, 2018
@bcmills bcmills added this to the Go1.12 milestone Dec 3, 2018
@ianlancetaylor
Copy link
Contributor

@YoshikiShibata You reported the problem on Saturday. I didn't work on Saturday or Sunday, because they are the weekend. I'm working on it now.

@ianlancetaylor
Copy link
Contributor

As far as I can tell the test simply can't work on Darwin, so I'm going to arrange to skip it.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/152159 mentions this issue: misc/cgo/testcshared: don't run TestGo2C2Go on Darwin

@ianlancetaylor ianlancetaylor changed the title cgo: misc/cgo/testcshared fails with the latest tip version cmd/link: linking a c-shared archive into a Go program fails on Darwin Dec 3, 2018
@ianlancetaylor ianlancetaylor removed their assignment Dec 3, 2018
@ianlancetaylor ianlancetaylor added help wanted and removed Testing An issue that has been verified to require only test changes, not just a test failure. release-blocker labels Dec 3, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.12, Unplanned Dec 3, 2018
@ianlancetaylor
Copy link
Contributor

Keeping the release-blocker label until CL 152159 is submitted.

@ianlancetaylor
Copy link
Contributor

CL 152159 is submitted, removing release-blocker label.

gopherbot pushed a commit that referenced this issue Dec 3, 2018
Darwin doesn't support the multiple copies of the runtime package
implied by linking a c-shared library into a Go program.

Updates #29061

Change-Id: I6cf5d00babf82f1de05689c1345aaa5ae0b0659c
Reviewed-on: https://go-review.googlesource.com/c/152159
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Projects
None yet
Development

No branches or pull requests

5 participants