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

Fix windows build following goreleaser migration #5487

Merged
merged 5 commits into from
Dec 3, 2020

Conversation

Tryneus
Copy link
Contributor

@Tryneus Tryneus commented Dec 2, 2020

This actually went smoother than expected, but still a couple changes to fix the windows build:

  • Change LD_FLAGS back to specifying -X within the env var, LD_FLAGS should be concatenable
  • Update the vscode_compile_task.sh build script to use goreleaser

Makefile Outdated
@@ -14,7 +14,7 @@ else
export GC_FLAGS = "all=-trimpath=${PWD}"
endif

export LD_FLAGS = github.com/pachyderm/pachyderm/src/client/version.AdditionalVersion=$(VERSION_ADDITIONAL)
export LD_FLAGS="-X github.com/pachyderm/pachyderm/src/client/version.AdditionalVersion=$(VERSION_ADDITIONAL)"
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem with -X here is that it will fail the pachctl release (goreleaser/pachctl.yaml). Hence the need to remove it from the Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, we should export an environment variable for the key/value pair without the -X (which is not LD_FLAGS), because this is an improper format for LD_FLAGS. I'll update this.

export LD_FLAGS="-X github.com/pachyderm/pachyderm/src/client/version.AdditionalVersion=${VERSION_ADDITIONAL}"

goreleaser release -p 1 --snapshot --skip-publish --rm-dist -f "${REPO_DIR}/goreleaser/docker.yml"
Copy link
Contributor

Choose a reason for hiding this comment

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

I am guessing there is a good reason why we cannot call make docker-build here? If you could, this code would look like...
cd $REPO_DIR
make docker-build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I wrote this to require as few extra tools as possible, and make doesn't exist on windows without jumping through a few hoops - unfortunately I think what you said is just the right thing to do, so I rewrote this to use make and we can get rid of all this duplication.

@netlify
Copy link

netlify bot commented Dec 3, 2020

Your website preview is ready! Hooray! 🎉

Built with commit 36f9151

https://deploy-preview-5487--pachyderm-docs.netlify.app

Copy link
Contributor

@nitinjainsj nitinjainsj left a comment

Choose a reason for hiding this comment

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

Code review that delete code are the best.

LGTM

@Tryneus Tryneus merged commit 4637262 into master Dec 3, 2020
@echohack echohack deleted the grey/fix-windows-build branch March 18, 2021 19:37
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