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

Set GDAL_DEV_SUFFIX to the pre-release suffix if a corresponding Git tag was found #11335

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

SunBlack
Copy link
Contributor

@SunBlack SunBlack commented Nov 22, 2024

As noted in #11315 as a side note, I wondered why we are getting as ${GDAL_VERSION} 3.10.0dev and not just 3.10.0 when checking out a release tag via:

git clone --depth 1 --branch v3.10.0 https://github.com/OSGeo/gdal.git .

Reason is, that the suffix dev will be always added when the .git directory is present even the GDAL_RELEASE_NAME (within gdal_version.h.in) doesn't contain it anymore. Therefore I added a logic to parse the git tags.

Results (from CMake output) when switching between different tags or current master:

  • master:
    -- GDAL_VERSION          = 3.11.0dev
    -- GDAL_ABI_FULL_VERSION = 311
    
  • Tag 3.10.0
    -- GDAL_VERSION          = 3.10.0
    -- GDAL_ABI_FULL_VERSION = 310
    
  • Tag 3.10.0RC3 (same Git revision as the release version)
    -- GDAL_VERSION          = 3.10.0
    -- GDAL_ABI_FULL_VERSION = 310
    
  • Tag 3.10.0RC2
    -- GDAL_VERSION          = 3.10.0RC2
    -- GDAL_ABI_FULL_VERSION = 310
    
  • Tag 3.10.0beta1
    -- GDAL_VERSION          = 3.10.0beta1
    -- GDAL_ABI_FULL_VERSION = 310
    

As far as I can see ${GDAL_DEV_SUFFIX} is only used to setup ${GDAL_VERSION} and didn't found any code which parses ${GDAL_VERSION} (so it is only handled as string), so I think there should be no side effect.

// Note: Not sure about the coding guide lines related to CMake, as sometimes the indentation is two spaces and sometimes 4, sometimes the temporary variables are uppercase, sometimes lowercase, not sure about line length limit, ....

@rouault rouault added the backport release/3.10 Backport to release/3.10 branch label Nov 22, 2024
@rouault rouault merged commit 17f6835 into OSGeo:master Nov 22, 2024
35 of 37 checks passed
@SunBlack SunBlack deleted the preReleaseSuffix branch November 22, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release/3.10 Backport to release/3.10 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants