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/go, runtime/cgo: go module didn't download cgo soft links of dynamic library #32050

Closed
lihaic opened this issue May 15, 2019 · 2 comments
Closed

Comments

@lihaic
Copy link

@lihaic lihaic commented May 15, 2019

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

$ go version
go version go1.12 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/lhc/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/lhc/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build969375030=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I am trying to switch my golang project from gopath to gomodule. One of the package my project imported is using cgo to call ffmpeg, the package have several dynamic ffmpeg libraries, for example:libavcodec.so ,libavcodec.so.57 ,libavcodec.so.57.107.100 , the fisrt two file is soft link file The problem is when i go build my golang project, go module only download libavcodec.so.57.107.100, it didn't download the other two soft link file

What did you expect to see?

I expect go module download all c dynamic libraries files including soft link files

What did you see instead?

i didn't get the soft link files

ps:1. When i use go get to get the package, i got all the dynamic libraries successfully, including all the soft link files
ps:2. Here is all the dynamic libraries i want and i get.

ls ~/go/src/plugins/ffmpeg Output
$ ls ~/go/src/plugins/ffmpeg
libavcodec.so             libavdevice.so            libavfilter.so            libavformat.so            libavutil.so            libswresample.so          libswscale.so
libavcodec.so.57          libavdevice.so.57         libavfilter.so.6          libavformat.so.57         libavutil.so.55         libswresample.so.2        libswscale.so.4
libavcodec.so.57.107.100  libavdevice.so.57.10.100  libavfilter.so.6.107.100  libavformat.so.57.83.100  libavutil.so.55.78.100  libswresample.so.2.9.100  libswscale.so.4.8.100
ls ~/go/pkg/mod/gitlab.com/plugins/ffmpeg Output
$ ls ~/go/pkg/mod/gitlab.com/plugins/ffmpeg
libavcodec.so.57.107.100  libavdevice.so.57.10.100  libavfilter.so.6.107.100  libavformat.so.57.83.100  libavutil.so.55.78.100  libswresample.so.2.9.100  libswscale.so.4.8.100
@andybons andybons changed the title go module didn't download cgo soft links of dynamic library correctly cmd/go, runtime/cgo: go module didn't download cgo soft links of dynamic library correctly May 15, 2019
@andybons

This comment has been minimized.

Copy link
Member

@andybons andybons commented May 15, 2019

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented May 15, 2019

This behavior is intentional. See #24057 (comment) (via #27093).

@bcmills bcmills closed this May 15, 2019
@bcmills bcmills changed the title cmd/go, runtime/cgo: go module didn't download cgo soft links of dynamic library correctly cmd/go, runtime/cgo: go module didn't download cgo soft links of dynamic library May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.