Skip to content

Add a project version to the build. #887

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmundkur
Copy link
Collaborator

The last release on github used 0.7, so the version is set to 0.7.0.

Add an option to the c_emulator to report the version.

Copy link

github-actions bot commented Apr 25, 2025

Test Results

400 tests  ±0   400 ✅ ±0   1m 53s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b046baa. ± Comparison against base commit 8ff2a70.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

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

I don't feel strongly about this but I think there is no need for a separate library, unless you have plans for using it elsewhere later?

But since you've already put in the effort to add a new library I don't think we necessarily need to simplify this down to a single header.

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

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

Tiny formatting nit otherwise LGTM

@jordancarlin
Copy link
Collaborator

There have already been significant changes since version 0.7 (including adding the new config system), so I wonder if we'd be better off calling it 0.8.0-dev or something along those lines. See #109 for lots of discussion about a version string.

@pmundkur pmundkur force-pushed the version_info branch 2 times, most recently from 89ba1b6 to 0876fb4 Compare April 28, 2025 20:43
)

if (git_error)
message(FATAL_ERROR "Failed to run git describe: ${git_error}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This means you can no longer build the downloaded archive.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This means you can no longer build the downloaded archive.

Should be fixed now.

@pmundkur pmundkur force-pushed the version_info branch 2 times, most recently from c83ef37 to ffeffce Compare April 28, 2025 21:30
Uses `git describe` to get the version according to git,
and sanitizes it for CMake project function for potential
future use with CPack.

Adds an option to the c_emulator to report the (git) version.

This requires the github checkout action to fetch a clean
history at least upto the last tag.  For now, fetch all history.

For builds of a downloaded archive without git history, use
an archive version.
@pmundkur
Copy link
Collaborator Author

There have already been significant changes since version 0.7 (including adding the new config system), so I wonder if we'd be better off calling it 0.8.0-dev or something along those lines. See #109 for lots of discussion about a version string.

Unfortunately, a "-dev" suffix doesn't quite work with CMake's semver check, nor does git describe's commit suffix. I tried to leave open the option to using CPack in the future by sanitizing the git version for CMake but using it in the emulator.

@@ -0,0 +1,45 @@
# Set a default version for archive builds that do not have
# git history. Increment this appropriately at tag-and-release time.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we have to do this anyway is there much benefit to using git describe?

I wonder if it's simpler just to update it manually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think git describe would be useful for users who don't wait for released versions, e.g. the ACT folks (see #850). I think they also originated the discussion in #109.

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.

4 participants