-
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
Fix bundling process #275
Fix bundling process #275
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx tackling this, I have a few questions.
src/s3ds.go
Outdated
@@ -1,4 +1,4 @@ | |||
package main | |||
package plugin | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src means nothing can you move it to ./plugin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Thanks for your advice! It's done in: b8cf0e9
go-ds-s3-plugin/main.go
Outdated
|
||
var Plugins = plugin.Plugins //nolint | ||
|
||
func main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious, s3ds.go
doesn't needed to do this, why does this needs it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr: Line 7 is needed, lines 9-11 can be removed. See 06217e6
Thanks for questioning this! I actually copied main.go from v0.9.0 and tried to understand why it was written like this:
- Importing the plugin without using it will give GO error. So line 7 was to suppress import error ("nolint"). I tried importing with blank identifier (underscore) as explicit package name. This worked but caused another error:
- Using plugin unbundled (like .ipfs/plugins/go-ds-s3-plugin) will fail when importing with blank identifier as described above. Kubo (f.E. ipfs version) thows error:
plugin: symbol Plugins not found in plugin
.
docker/Dockerfile
Outdated
RUN go get github.com/ipfs/go-ds-s3/plugin@latest | ||
RUN echo "\ns3ds github.com/ipfs/go-ds-s3/plugin 0" >> plugin/loader/preload_list | ||
RUN go get github.com/ipfs/go-ds-s3/go-ds-s3-plugin@latest | ||
RUN echo "\ns3ds github.com/ipfs/go-ds-s3/go-ds-s3-plugin 0" >> plugin/loader/preload_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that even working ? I thought it tried it and it refused to import it because it was main
.
It is still main
, what I expect to happen is github.com/ipfs/go-ds-s3/plugin
would be imported.
If this works then no .go
file need to be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh I just modified the path the same as I did in README.md
Creating the Docker Image is broken anyway because docker image ipfs/kubo v0.19.0
was not compatible with latest ipfs version (kubo/bin/container_daemon dependencies changed).
Following commit will fix docker image: b37ea16
For long term: I guess docker image is to be thought through because ipfs version is hard coded and parameter are unclear and incomplete (f.E. regionEndpoint is missing). But imo this is to be done in a separate PR. Let me know if you share this opinion.
README.md
Outdated
# Clone kubo. | ||
> git clone https://github.com/ipfs/kubo | ||
> cd kubo | ||
|
||
# Pull in the datastore plugin (you can specify a version other than latest if you'd like). | ||
> go get github.com/ipfs/go-ds-s3/plugin@latest | ||
> go get github.com/ipfs/go-ds-s3/go-ds-s3-plugin@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> go get github.com/ipfs/go-ds-s3/go-ds-s3-plugin@latest | |
> go get github.com/ipfs/go-ds-s3@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in 80ac067
|
||
# Add the plugin to the preload list. | ||
> echo -en "\ns3ds github.com/ipfs/go-ds-s3/plugin 0" >> plugin/loader/preload_list | ||
> echo -en "\ns3ds github.com/ipfs/go-ds-s3/go-ds-s3-plugin 0" >> plugin/loader/preload_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about import path here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing "/go-ds-s3-plugin" doesn't work here. Build error: plugin/loader/preload.go:28:21: undefined: plugins3ds.Plugins
I assume GO needs the specific path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting it to "github.com/ipfs/go-ds-s3/plugin" doesn't work as well.
-> I only manage to get it work with "github.com/ipfs/go-ds-s3/go-ds-s3-plugin".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR hasn't been merged nor released, so it can't be picked up automatically by go mod, did you tried adding a temporary replace github.com/ipfs/go-ds-s3 => ../go-ds-s3
to your Kubo go.mod
file ? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'm aware of that. I'm testing on a fork so I can mess around with master branch.
Temporary adding replace github.com/ipfs/go-ds-s3 => ../go-ds-s3
doesn't change the behavior described above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merge and this can be fixed in upcoming PR if still doesn't work.
Moving things around is probably breaking https://github.com/ipfs/go-ds-s3/blob/master/.github/workflows/release.yml |
@hsanjuan workflows won't be broken since path of plugin stays |
Thank you very much @josiasbruderer |
This fixes bundling process that was broken with
a2884d2
: see the issue regarding to bundling issue.