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

support fully static link build #394

Open
cruvie opened this issue Dec 12, 2023 · 2 comments
Open

support fully static link build #394

cruvie opened this issue Dec 12, 2023 · 2 comments

Comments

@cruvie
Copy link

cruvie commented Dec 12, 2023

It would be useful to build with fully static link, is there any way I can do to achive it?
I tried the following cmd, but get some errors.

 CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' .
/Users/cxxxxxtool.go:31:13: undefined: vips.NewAvifExportParams
/Users/cxxxxxtool.go:61:13: undefined: vips.NewJpegExportParams
/Users/cxxxxxtool.go:83:74: undefined: vips.ImageRef
/Users/cxxxxxtool.go:93:26: undefined: vips.NewImageFromReader
/Users/cxxxxxtool.go:108:82: undefined: vips.ImageRef
/Users/cxxxxxtool.go:119:39: undefined: vips.KernelAuto
@the-hotmann
Copy link

the-hotmann commented Jan 6, 2024

Duplicate: #339

But the problem remains - it seems this is not statically buildable.
This is a pitty as a lot of golang users really want to compile it down to one single statically binary to place it into a docker scratch container for additional security and less overhead.

@andrask
Copy link

andrask commented Jan 18, 2024

I may be mistaken, but one of the reasons for dynlinking is the licence. Libvips is LGPL, while this package is MIT. With static linking, all software that uses this package would automatically turn into LGPL software. There are probably technical reasons, too. But as I can see, libvips language bindings are usually MIT or similar licenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants