-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Prebuilt binary do not load plugin #7305
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
|
Ok, I tried one more time
then I try one more time to use go1.13.10 to build my plugin with a local go-ipfs source code,everything is ok, it shows up the message in my Init code, also if I made some crash in my Init, the ipfs command crash immediately. |
How are you installing the plugin exactly? What are you naming it? Is it marked as executable? |
I tried one more time from scratch, and it still gets the same behaviour. SetupAssume work at For IPFS binary
Just setup an ipfs v0.5.1 at
Install Go1.13.10
For IPFS build from source
Just setup an ipfs v0.5.1 from source at
For the testing plugin
TestTest 1: ipfs v0.5.1 from source
You should see the plugin is loaded. Test 2: ipfs v0.5.1 binary
You can see that the plugin Init did not run, even I inject some crash code in the Init function in |
That's very strange.
|
For the non-executable test, it clearly shows that the prebuilt binary does not try to access the so file, no errors occurred. But for the build from source one, an error occurs:
|
Ok, that means your build isn't even trying to load the plugins. My guess is that something is wrong with your IPFS_PATH environment variable. Try running the pre-built go-ipfs binary with |
In macOS, I use ipfs v0.5.1 from source
it worked as expected, it loads the plugin folder and file ipfs v0.5.1 binary
it don't even try to load any of plugin folders |
Could you run |
|
So... at this point, my remaining guess is some weird security feature where go-ipfs can't access files it didn't create. What happens if you run the pre-built go-ipfs binary against the repo created with the one you built from source? What about the other way (run your go-ipfs build against ~/test/.ipfs/`)? I don't expect plugin loading to work, bug I'm curious to see what happens. |
ipfs v0.5.1 from source
it tried to load and got an expected error since the plugin was built for the wrong target:
ipfs v0.5.1 binary
as expectation, it only loads the config file but nothing about plugins |
🤦 I know what's going on. The macos build was cross compiled while the linux build was compiled on linux. That means the linux build has CGO support while the macos build doesn't. Plugins require cgo support, so we disable plugin support when CGO is disabled. We need to:
See: golang/go#19569 |
Version information:
go-ipfs version: 0.5.1
Repo version: 9
System version: amd64/darwin
Golang version: go1.13.10
Description:
I made an IPLD plugin for my own usage, it is based on the go-ipfs-example-plugin repo and I tune it so that it can run on IPFS v0.5.1
First, I made a local copy of go-ipfs v0.5.1 and made my plugin import this local copy. After build and install my own plugin to $IPFS_PATH/plugins and run by my build from source go-ipfs daemon, everything works perfectly
However, when I tried to import the official go-ipfs v0.5.1 rather than my local copy and run by prebuilt binary of macOS 64bit binary, the plugin just did not loaded in, and even did not call the
Init
of the pluginBy the way, both build from source go-ipfs and prebuilt binary are using the same $IPFS_PATH, and share the same config file
The text was updated successfully, but these errors were encountered: