Skip to content

Release nickname? #2507

Open
Open
@rsbivand

Description

@rsbivand
Member

See https://mastodon.social/@EvenRouault/114037298138503303 ; unsure where to put this as versions are numeric, maybe a startup message?

Activity

rsbivand

rsbivand commented on Feb 20, 2025

@rsbivand
MemberAuthor

Maybe add to sf_extSoftVersion?

rsbivand

rsbivand commented on Feb 24, 2025

@rsbivand
MemberAuthor

As built against GDAL 3.11.0dev:

> sf::sf_extSoftVersion()
                  GEOS                   GDAL                 proj.4 
              "3.13.0" "3.11.0dev-26fc9a3fed"                "9.5.1" 
        GDAL_with_GEOS             USE_PROJ_H                   PROJ 
                "true"                 "true"                "9.5.1" 
> sf:::CPL_gdal_version()
[1] "3.11.0dev-26fc9a3fed"
> terra::gdal()
[1] "3.11.0dev-26fc9a3fed"

However:

> library(gdalraster)
GDAL 3.11.0dev-26fc9a3fed "Trans rights are human rights", released 2025/02/20, GEOS 3.13.0, PROJ 9.5.1
> gdalraster::gdal_version()
[1] "GDAL 3.11.0dev-26fc9a3fed \"Trans rights are human rights\", released 2025/02/20"
[2] "3110000"                                                                         
[3] "20250220"                                                                        
[4] "3.11.0dev-26fc9a3fed"

see USDAForestService/gdalraster#627.

And:

$ gdalinfo --version
GDAL 3.11.0dev-26fc9a3fed "Trans rights are human rights", released 2025/02/20
$ ogrinfo --version
GDAL 3.11.0dev-26fc9a3fed "Trans rights are human rights", released 2025/02/20
rsbivand

rsbivand commented on Feb 24, 2025

@rsbivand
MemberAuthor

And:

> sf:::CPL_gdal_version("RELEASE_NAME")
[1] "3.11.0dev-26fc9a3fed"
> sf:::CPL_gdal_version("RELEASE_NICKNAME")
[1] "Trans rights are human rights"
> 
> sf:::CPL_gdal_version("--version")
[1] "GDAL 3.11.0dev-26fc9a3fed \"Trans rights are human rights\", released 2025/02/20"

So if we would like to expose the GDAL nickname, the code does that already.

rsbivand

rsbivand commented on Feb 24, 2025

@rsbivand
MemberAuthor

This is useful:

> cat(sf:::CPL_gdal_version("BUILD_INFO"))
OGR_ENABLED=YES
CURL_ENABLED=YES
CURL_VERSION=8.9.1
GEOS_ENABLED=YES
GEOS_VERSION=3.13.0-CAPI-1.19.0
PROJ_BUILD_VERSION=9.5.1
PROJ_RUNTIME_VERSION=9.5.1
COMPILER=GCC 14.2.1 20250110 (Red Hat 14.2.1-7)

or

> sf:::CPL_gdal_version("BUILD_INFO") |>
 gsub("=", ":", x=_) |>
 strsplit("\\n") |>
 unlist() |>
 textConnection() |>
 read.dcf() |>
 as.data.frame()
  OGR_ENABLED CURL_ENABLED CURL_VERSION GEOS_ENABLED       GEOS_VERSION
1         YES          YES        8.9.1          YES 3.13.0-CAPI-1.19.0
  PROJ_BUILD_VERSION PROJ_RUNTIME_VERSION
1              9.5.1                9.5.1
                                COMPILER
1 GCC 14.2.1 20250110 (Red Hat 14.2.1-7)

After this, showConnections() indicates that the connection opened by textConnection() was closed.

Beyond that, https://github.com/OSGeo/gdal/blob/26fc9a3fedb57ab8b90604684fdd1fc4fb81c1f4/gcore/gdal_misc.cpp#L3006 shows that if correctly spelled values of pszRequest are not available, it defaults to "--version" also before OSGeo/gdal@a37a65e. I tried sf:::CPL_gdal_version("RELEASE_NICKNAME") with 3.10.1 with no problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rsbivand

        Issue actions

          Release nickname? · Issue #2507 · r-spatial/sf