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

Dev version show build time #12871

Closed
wants to merge 2 commits into from
Closed

Conversation

lbajolet-hashicorp
Copy link
Contributor

In order to help differentiate between dev builds of Packer, this change adds a date/time when built as extra version metadata (we reuse this field since it was not referenced anywhere), and change a bit the logic of the version command so it is reported.

If defined, the version subcommand will now print the VersionMetadata as
part of the version string. This allows us to define data at
compile/link time, and show it to users.
The dev target used to report the current version, along with the
version's prerelease status.

However, the problem was that we had no way to differentiate easily
between two locally-built versions of Packer, as the version/prerelease
are typically static, which could lead to confusion sometimes.

To make it clearer which version of Packer is being used, especially for
pre-releases, we're now adding date and time information to the metadata
of a development build of Packer.
@lbajolet-hashicorp lbajolet-hashicorp force-pushed the dev_version_show_build_time branch from 0b6f7b7 to 8673509 Compare March 7, 2024 16:41
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

As discussed internally. I understand the idea and not opposed to including build time in the version.

But making a change to make dev feels off as it depends on the user actually running make dev and the tooling being in the right place.

If you want to revisit to set the version metadata for builds using Go. I can jump on board because then we have control over that.

You may be able to do something like packer version [-l|--long] to display full version info like

v1.10.s-dev+commitsha 
OS: darwin/arm64 
BuildDate=2024-01-26T15:54:24Z

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants