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

single line regex to get current version in cmake script #732

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

hitsmaxft
Copy link
Contributor

@hitsmaxft hitsmaxft commented Dec 28, 2023

orgin cmake script's CMAKE_GIT_REPO_VERSION paring sometimes not working properly . here is my regex rewriting
do version in single regex with regex grouping

example of output from cmake -B build on my branch

PICO_SDK_PATH is /home/wsl/projects/gp2040ce/pico-sdk
PICO platform is rp2040.
GIT_REPO_VERSION is v0.7.6-6-g40721a4
CMAKE_GIT_REPO_VERSION is 0.7.6
Submodules updated

@hitsmaxft hitsmaxft marked this pull request as ready for review December 28, 2023 11:43
@hitsmaxft hitsmaxft changed the title single line regex to get current version single line regex to get current version in cmake script Dec 28, 2023
@bsstephan
Copy link
Contributor

The goal of main's version is to produce v0.7.6.6 for your example. What error are you seeing?

@hitsmaxft
Copy link
Contributor Author

hitsmaxft commented Dec 29, 2023

The goal of main's version is to produce v0.7.6.6 for your example. What error are you seeing?

output fallbakc to 0.0.0

I will upgrade regex to support 0.7.6.6

@bsstephan
Copy link
Contributor

That would be good. I have seen a surprising incidence rate of the 0.0.0 output so I can believe my successive hacks are causing a problem. If you get the regex to match to 0.7.6.6 in your example, this will probably be mergeable.

Copy link
Contributor

@arntsonl arntsonl 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, this catches all of the scenarios I can think of

@arntsonl arntsonl merged commit e103bce into OpenStickCommunity:main Dec 29, 2023
30 checks passed
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.

3 participants