Skip to content
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

*: add Docker build environment #24

Merged
merged 2 commits into from
Apr 6, 2022
Merged

Conversation

mrd0ll4r
Copy link
Member

@mrd0ll4r mrd0ll4r commented Mar 1, 2022

I'm not 100% sure if it's worth executing the builder stage in CI every time.
I guess it's fine -- the more things we test continuously, the better.
At some point in the future we could make these available somehow...

This depends on #23

RUN go mod download && go mod verify

# Then copy sources and compile project
COPY . .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit wonky but I guess just copying all the things does no real harm either

# Compile metric export plugin
WORKDIR /usr/src/ipfs/metric-export-plugin
# Get and compile dependencies first, since we can cache those.
COPY go.mod go.sum ./
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal at the moment but just for completntess sake: This means that a new image is created everytime the code changes and the CI is executed, correct?
Maybe just having go-ipfs with a fixed tag inside the container and simply mounting the plugin source would be more efficient?

@mrd0ll4r
Copy link
Member Author

Some dependency of the format checker is broken, I'll try to re-run the CI and merge in a few days...

@mrd0ll4r
Copy link
Member Author

mrd0ll4r commented Apr 6, 2022

Ah, turns out this is because we use Go 1.16, and the latest version of mvdan.cc/gofumpt, which is v0.3.1 at the moment, uses a new syntax for go:build annotations, which the old compiler does not understand. This is popping up now because Go 1.18 was release, which means Go 1.16 is no longer supported and gofumpt released the new version. Both 1.17 and 1.18 understand the new annotations.

We cannot build with Go 1.17 due to the linker bugs with plugins.
We cannot yet build with Go 1.18 due to an outdated dependency on go-quic.

As a temporary workaround I'll fix the version of gofumpt to v0.3.0, which still compiles with Go 1.16.

@mrd0ll4r mrd0ll4r merged commit f02d5d8 into trudi-group:master Apr 6, 2022
@mrd0ll4r mrd0ll4r deleted the docker branch April 6, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants