davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.28k stars 199 forks source link

govips is trying to link 8.13.3 when I have 8.14.2_1 installed #355

Closed AttilaTheFun closed 1 year ago

AttilaTheFun commented 1 year ago

I was trying to run CGO_CFLAGS_ALLOW=-Xpreprocessor go test -v ./... but govips seems to be attempting to link vips 8.13.3 which I don't even have installed. I currently only have vips 8.14.2_1 installed through homebrew:

logan@Logans-MBP vips % pwd
/opt/homebrew/Cellar/vips
logan@Logans-MBP vips % ls
8.14.2_1

How does it locate the vips dylib to use?

logan@Logans-MBP govips % CGO_CFLAGS_ALLOW=-Xpreprocessor go test -v ./...
VIPS 64 found /opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13
VIPS 64 using configure-time prefix
VIPS 64 VIPS_PREFIX = /opt/homebrew/Cellar/vips/8.13.3
VIPS 64 VIPS_LIBDIR = /opt/homebrew/Cellar/vips/8.13.3/lib
VIPS 64 prefix = /opt/homebrew/Cellar/vips/8.13.3
VIPS 64 libdir = /opt/homebrew/Cellar/vips/8.13.3/lib
VIPS 64 searching "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-jxl.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-poppler.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-heif.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-openslide.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-magick.so"
VIPS 64 searching "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-plugins-8.13"
govips 64 vips 8.13.3 started with concurrency=10 cache_max_files=0 cache_max_mem=0 cache_max=0
govips 64 registered image type loader type=gif
govips 64 registered image type loader type=magick
govips 64 registered image type loader type=png
govips 64 registered image type loader type=svg
govips 64 registered image type loader type=tiff
govips 64 registered image type loader type=webp
govips 64 registered image type loader type=heif
govips 64 registered image type loader type=jpeg
govips 64 registered image type loader type=pdf
govips 64 registered image type loader type=heif
govips 64 registered image type loader type=jp2k
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/image (cached) [no tests to run]
?       github.com/davidbyttow/govips/v2/examples/jpeg  [no test files]
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/logging       (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/thumbnail     (cached) [no tests to run]
?       github.com/davidbyttow/govips/v2/examples/tiff  [no test files]
# github.com/davidbyttow/govips/v2/vips/mem_tests.test
/opt/homebrew/Cellar/go/1.19.2/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: directory not found for option '-L/opt/homebrew/Cellar/vips/8.13.3/lib'
ld: library not found for -lvips
clang: error: linker command failed with exit code 1 (use -v to see invocation)
logan@Logans-MBP govips % go test -v ./...
VIPS 64 found /opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13
VIPS 64 using configure-time prefix
VIPS 64 VIPS_PREFIX = /opt/homebrew/Cellar/vips/8.13.3
VIPS 64 VIPS_LIBDIR = /opt/homebrew/Cellar/vips/8.13.3/lib
VIPS 64 prefix = /opt/homebrew/Cellar/vips/8.13.3
VIPS 64 libdir = /opt/homebrew/Cellar/vips/8.13.3/lib
VIPS 64 searching "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-jxl.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-poppler.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-heif.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-openslide.so"
VIPS 64 loading "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-modules-8.13/vips-magick.so"
VIPS 64 searching "/opt/homebrew/Cellar/vips/8.13.3/lib/vips-plugins-8.13"
govips 64 vips 8.13.3 started with concurrency=10 cache_max_files=0 cache_max_mem=0 cache_max=0
govips 64 registered image type loader type=gif
govips 64 registered image type loader type=magick
govips 64 registered image type loader type=png
govips 64 registered image type loader type=svg
govips 64 registered image type loader type=tiff
govips 64 registered image type loader type=webp
govips 64 registered image type loader type=heif
govips 64 registered image type loader type=jpeg
govips 64 registered image type loader type=pdf
govips 64 registered image type loader type=heif
govips 64 registered image type loader type=jp2k
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/image (cached) [no tests to run]
?       github.com/davidbyttow/govips/v2/examples/jpeg  [no test files]
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/logging       (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/davidbyttow/govips/v2/examples/thumbnail     (cached) [no tests to run]
?       github.com/davidbyttow/govips/v2/examples/tiff  [no test files]
# github.com/davidbyttow/govips/v2/vips/mem_tests.test
/opt/homebrew/Cellar/go/1.19.2/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: directory not found for option '-L/opt/homebrew/Cellar/vips/8.13.3/lib'
ld: library not found for -lvips
clang: error: linker command failed with exit code 1 (use -v to see invocation)

# github.com/davidbyttow/govips/v2/vips.test
/opt/homebrew/Cellar/go/1.19.2/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: directory not found for option '-L/opt/homebrew/Cellar/vips/8.13.3/lib'
ld: library not found for -lvips
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL    github.com/davidbyttow/govips/v2/vips [build failed]
FAIL    github.com/davidbyttow/govips/v2/vips/mem_tests [build failed]
FAIL
AttilaTheFun commented 1 year ago

Maybe it's related to this? https://github.com/golang/go/issues/36572

AttilaTheFun commented 1 year ago

This turned out to be a result of vscode's integrated shell being misconfigured.