-
Notifications
You must be signed in to change notification settings - Fork 67
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
trouble building for 0.4.21 #17
Comments
I checked on my machine with |
What go version are you using? go 1.11 has a bunch of issues with go mod.
That's odd. It should be editing the go-ds-s3's go.mod file, not go-ipfs's.
That should have been fixed in go 1.12.
It looks like edit: hm, not every build |
|
One thing I can think of is that when compiling go-ipfs with go modules (again, on the diff --git a/go.mod b/go.mod
index 9c94e261f..570d0ec8f 100644
--- a/go.mod
+++ b/go.mod
@@ -122,6 +122,7 @@ require (
go.uber.org/multierr v1.1.0 // indirect
go4.org v0.0.0-20190313082347-94abd6928b1d // indirect
golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5
+ google.golang.org/appengine v1.4.0 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28
gotest.tools/gotestsum v0.3.4
) It's weird, but I don't see why it would make the plugin fail to load. |
That's an annoying go modules bug. Now I'm stumped. |
Just to be sure, I redid the whole process on another machine (but still a debian with the same go version), same thing on every point. |
Alternatively, if you can make it works, could you provide a working binary so I can at least evaluate this plugin ? |
Yeah, I'm getting version issues too (goprocess for me). To get this working, either:
We should probably make the dist build scripts use |
Ah, the issue is the build environment. We need to trim the paths here. |
This one works ! I can at least get some errors specific to the plugin, so it's actually loaded and running !
|
|
Ok, so I've now reproduced every single build issue. Here's a partial fix: #18 Unfortunately, I'm now seeing the filestore protobuf issue. |
I'm guessing the filestore/pb issue is due to the build paths: When building with go mod, the path is |
So, I deleted my |
A short guide on how to use this plugin would be very welcome. I inferred what the config should looks like from the code but I end up with errors like |
Unfortunately, we create a "lockfile" to prevent the datastore configuration from being modified after init (as some modifications will require migrations). The goal was to introduce an auto-migration feature we never finished that and it's not exactly a high priority. In this case, you can replace the contents of the We need to document this either way but I'd like to provide a nicer way to use this plugin first. |
I got it working, thanks :) For the next guy, something like the following works: {
"Datastore": {
...
"Spec": {
"mounts": [
{
"child": {
"type": "s3ds",
"region": "us-east-1",
"bucket": "blablabla", <-- no arn
"accessKey": "",
"secretKey": ""
},
"mountpoint": "/blocks",
"prefix": "s3.datastore",
"type": "measure"
},
...
|
Another note on this: compiling as explained in #18 (comment) worked for me because my $GOPATH was empty. That is, is works if the path trimming is effectively disabled. When I tried to compile with $GOPATH set, I couldn't load the plugin anymore, even after recompiling go-ipfs with ipfs/kubo#6412 cherry picked. |
For the next guy as well, the required permissions are:
|
I'm also having similar but different build issues for v0.4.21. Is there a chance for PL to distribute go-ipfs builds with this plugin already included? I'm guessing this is going to be a very popular plugin for commercial users. |
Could you try again with 0.4.22 and go 1.12.7? I think I've finally gotten the build working out of the box (at least I can get it to work in CI). Unfortunately, it still requires the exact go version. Given that, I think we're going to need to distribute compiled plugins to keep users from pulling their hair out. |
The latest builds fine out of the box (with go 1.12.6). Thank you! |
Whilst it builds fine with go 1.12.6 it won't load in ipfs (0.4.22 downloaded from dists.ipfs.io):
go 1.12.7 is not available on golang's download page, So I tried 1.12.8, but that gives the same error. :-( |
Download link: https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz But yeah, that's why we need to pre-build. |
@Stebalien Thanks for the link. That version loaded. Is there any concept of binary compatibility for plugins with go? i.e. If I want to use this plugin with a later version of ipfs, do I need to use the exact go version to build which was used on that ipfs version? Now though, it fails with:
This is immediately after an ipfs init, and then changing the config as above. |
Unfortunately, yes. Specifically, the packages used need to be the same which means the standard library can't change.
There's a second file, If you don't care about the repo, you can copy the config out of the repo, delete the repo, and then run |
For others (though I will document all this when done), you need to overwrite
|
I think @magik6k had such a tool. |
https://github.com/ipfs/ipfs-ds-convert But I don't think it supports anything but badger by default. It should probably use go-ipfs plugins. |
Closing as building has now been fixed against go-ipfs v0.4.22. |
New attempt to build this, but I still have troubles:
Basically what's happening is that
/home/michael/go/pkg/mod/**/**/*
is read only on my system (debian), for a good reason IMHO. This is not something I have done specifically, it's how go modules behave normally.I tried to remove the
set-target
script from the makefile and updatego.mod
myself:It seems to be a problem with the
-i
flag ofgo build -buildmode=plugin -i -o "s3plugin.so" "plugin/main.go"
, in a similar fashion as golang/go#27285. Again, this seems to attempt to write the files shipped by go, which is a bad idea.Removing the
-i
flag, the build finally succeed:Alas, loading the plugin fail:
Note that I compiled myself the go-ipfs binay, same machine, same environment, exactly from the v0.4.21 tag.
Any help ?
The text was updated successfully, but these errors were encountered: