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

Replace go-bindata with //go:embed from Go 1.16 #392

Closed
wants to merge 5 commits into from

Conversation

simon04
Copy link
Contributor

@simon04 simon04 commented Mar 30, 2021

Fixes #381.

cc: @salemhilal

Comment on lines +23 to -29
ui/.build/ui: node_modules $(wildcard ui/assets/**/*)
mkdir -p ui/.build
rsync -r ui/assets/* ui/.build/ui
npx webpack $(WEBPACK_ARGS)
$< -o $@ -pkg ui -prefix .build/ui -nomemcopy .build/ui/...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this rule needs some tuning for proper rebuilds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate more on what you mean here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try. Since ui/.build/ui is a directory, I'm not sure under which circumstances make will figure out that the target needs to be rebuilt. Maybe it would be better to only check the JavaScript bundle generated by webpack?

@simon04 simon04 force-pushed the go-embed branch 2 times, most recently from 8e80da4 to 607adc0 Compare March 30, 2021 20:01
jobs:
go-build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.14", "1.13", "1.12"]
go: ["1.16"]
Copy link
Contributor

Choose a reason for hiding this comment

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

While it's true that we probably don't need to be supporting Go 1.12 or 1.13, I'm wary of dropping support for everything but the latest version. I believe the two most recent Go versions are officially supported. This might make a little more sense once Go 1.17 is out.

Copy link

Choose a reason for hiding this comment

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

Walking around and reminding that Go 1.17 was released.

rsync -r ui/assets/* .build/ui
ui/.build/ui: node_modules $(wildcard ui/assets/**/*)
mkdir -p ui/.build
rsync -r ui/assets/* ui/.build/ui
npx webpack $(WEBPACK_ARGS)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the original motivation around using bindata in the first place is so that we could ensure built static assets were present and usable immediately after go install, without requiring an additional build step / installing node_modules / etc. I'm admittedly fuzzy about whether or not Go Modules have a post-build lifecycle step, but I think that context is important for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have had success with pkger.

@dschott68
Copy link
Contributor

replaced by #430

@dschott68 dschott68 closed this May 5, 2023
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.

Use //go:embed from Go 1.16
5 participants