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(snap): set Pebble version before snap builds #450

Merged

Conversation

cjdcordeiro
Copy link
Collaborator

Problem

When doing a snapcraft remote-build, Snapcraft will create a copy of the project in Launchpad before running the snap build.
The problem is that Snapcraft seems to ignore tags while creating the copy of the project, which means the go generate ./cmd in the snapcraft.yaml's override-build will never dynamically generate the right version.

Solution

This PR enforces the execution of go generate ./cmd as a pre-requisite for running the snap build. I.e., for both local and remote builds, go generate ./cmd must be run first, such that the VERSION and version_generated.go files are staged in the repo, prior to the snap build, such that the override-build script can simply rely on that information and thus ignore the missing Git refs in the LP's project.

Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for your help with this, @cjdcordeiro!

@benhoyt benhoyt merged commit ffb99d9 into canonical:master Jul 16, 2024
11 checks passed
@cjdcordeiro cjdcordeiro deleted the ROCKS-1311/fix-snap-versioning branch July 16, 2024 08:28
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