goland unable to run package

Answered

I am getting this error: dyld[62775]: Library not loaded: @rpath/libclntsh.dylib.18.1
 Referenced from: <D31AAC0B-477E-3B85-933F-A98DA4F3BF43> /Users/priyanshgupta/Library/Caches/JetBrains/GoLand2023.3/tmp/GoLand/___11go_build…..
 Reason: no LC_RPATH's found

I want to know which rpath is being used here so that I can move my library to that directory. The other possible solution could be to set @rpath using some build config (want to change CGO_LDFLAGS). Can someone please help how to do that. Any help is appreciated, thanks. 

My go-sdk version: go-1.17.13 (amd)

I am using following goland version:

GoLand 2023.3.2
Build #GO-233.13135.104, built on December 20, 2023
Licensed to Salesforce, Inc.

Runtime version: 17.0.9+7-b1087.9 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
 ide.completion.variant.limit=500
 suggest.all.run.configurations.from.context=true
 ide.experimental.ui=true
GoLand 2023.3.2
Build #GO-233.13135.104, built on December 20, 2023
Licensed to Salesforce, Inc.

Runtime version: 17.0.9+7-b1087.9 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
 ide.completion.variant.limit=500
 suggest.all.run.configurations.from.context=true
 ide.experimental.ui=true
 

 

0
4 comments

Hi,

Does it compile if you run your application via CLI? How can I reproduce this issue locally?

0

Yes it works when I run from cli. You can reproduce this by using this go package: gopkg.in/rana/ora.v4.. This package requires oracle instant client to be installed. Now the only problem that I am facing here is that during runtime it is not able to find the oracle instant client libraries. You should be able to reproduce this by using some shared library in your go code and place these shared libraries in some random directory so that during runtime it will fail to locate those. That is why I asked if there is a way to specify this rpath which need to be used during runtime to locate the shared libraries.

0

But anyway,s for now I unblocked myself by removing modules in codebase that needs use of gopkg.in/rana/ora.v4 , but still I would need this in future and hence it is better to know how to set this rpath. Also it will help me if I can know which rpath is being used during runtime, if I know that then I can create soft-links for my shared libraries to that particular directory.

0

Have you tried to launch GoLand from CLI in that case? Please see: https://www.jetbrains.com/help/go/working-with-the-ide-features-from-command-line.html

GoLand will inherit your CLI environment including all specified variables (PATH, RPATH, etc.).

0

Please sign in to leave a comment.