0

The environment is ubuntu 16.04 64bit, go version go1.12 linux/amd64

I am trying to switch my golang project from gopath to gomodule. One of the packages 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 first two files 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 two soft link file

I tried to go get the package, and successfully get all the libraries including soft link file

I expect go module download all c dynamic libraries files including soft link files, but I didn't get the soft link files


Update: I submitted a issue in github, and seemed that this is intentional, see issue #32050

lihaichao
  • 45
  • 1
  • 3

1 Answers1

0

Go (in modules mode as well as in GOPATH mode) is concerned only with Go source code and will download only Go packages (which might contain C code) but it never installs shared libraries on your system or does other installation work (like creating symlinks).

There is no way you can convince or force the go tool to do what you think it should do.

Install the required shared object files and the necessary symlinks in any other means you find convenient n your system.

Volker
  • 40,468
  • 7
  • 81
  • 87
  • thanks, but when i use go get, i got all the c dynamic libraries. I suppose go get or go module just download use vcs like git to download package, and don't concern what the package is, is it like this? – lihaichao May 15 '19 at 06:59
  • @lihaichao I have to admit I do not understand what you are asking. Running `go get` will install all Go related dependencies and _nothing_ else. No fonts, no shared libraries, no nothing. – Volker May 15 '19 at 07:07
  • I thought go get will fetching like https://github.com//test?go-get=1, and parsing meta tags of reply to get the git url, then use git to clone the package – lihaichao May 15 '19 at 07:17
  • So i suppose go get will not concern what kind of file is in the package – lihaichao May 15 '19 at 07:18
  • And right now, go module will download the c shared libraries of my package, but not all of them, go module only downloaded the shared libraries that isn't soft link – lihaichao May 15 '19 at 07:20
  • 1
    go get clones a repo. Whatever is in the repo is cloned. This is not a subtitute for installing stuff to your system. – Volker May 15 '19 at 07:30
  • oh, thanks. So is this mean that i can't put c shared libraries in my package? Is here an option about how go get install package? – lihaichao May 15 '19 at 07:50