-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
[Bug] Version check in G__gisinit & G__no_gisinit is too strict for non-git builds #2610
Comments
Something like this may suffice: --- a/configure.ac
+++ b/configure.ac
@@ -139,7 +139,7 @@ changequote([,])
GRASS_VERSION_GIT="exported"
# get git short hash + date of last change in GRASS headers
# (and anything else in include)
-GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
+GRASS_HEADERS_GIT_HASH="${GRASS_VERSION_NUMBER}"
GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
AC_PATH_PROG(GIT, git, no)
if test "$GIT" != "no" ; then Which results in a
Instead of:
Or you could just use the version in --- a/include/grass/gis.h
+++ b/include/grass/gis.h
@@ -44,7 +44,7 @@ static const char *GRASS_copyright __attribute__ ((unused))
/* GRASS version, GRASS date, git short hash of last change in GRASS headers
* (and anything else in include)
*/
-#define GIS_H_VERSION GRASS_HEADERS_VERSION
+#define GIS_H_VERSION GRASS_VERSION_STRING
/* git date of last change in GRASS headers
* (and anything else in include)
*/ |
For some background discussion see #325 in which |
If you really need to detect changes to the headers, using a checksum of the sources may be an option, e.g.: $ find include/grass/ -type f | sort | xargs cat | sha1sum - | cut -d' ' -f1
38bf7f86a1c488548e9cb8902d014a41ae855266 |
Changes to headers should trigger an increase in the minor version number. I prefer your suggested change to |
Value is used in version check which fails when the value changes. Fixes: OSGeo#2610
As reported in #2610, rebuilding the GRASS sources (from the release tarballs) with no changes break the gdal-grass plugins because the `GIS_H_VERSION` value changes. Non-git builds use the current timestamp in `GRASS_HEADERS_GIT_HASH` which is also used for `GRASS_HEADERS_DATE`. This PR uses `GRASS_VERSION_NUMBER` for `GRASS_HEADERS_GIT_HASH` as a better value for non-git builds, that value won't change for simple rebuilds of the source tree.
As reported in OSGeo#2610, rebuilding the GRASS sources (from the release tarballs) with no changes break the gdal-grass plugins because the `GIS_H_VERSION` value changes. Non-git builds use the current timestamp in `GRASS_HEADERS_GIT_HASH` which is also used for `GRASS_HEADERS_DATE`. This PR uses `GRASS_VERSION_NUMBER` for `GRASS_HEADERS_GIT_HASH` as a better value for non-git builds, that value won't change for simple rebuilds of the source tree.
As reported in OSGeo#2610, rebuilding the GRASS sources (from the release tarballs) with no changes break the gdal-grass plugins because the `GIS_H_VERSION` value changes. Non-git builds use the current timestamp in `GRASS_HEADERS_GIT_HASH` which is also used for `GRASS_HEADERS_DATE`. This PR uses `GRASS_VERSION_NUMBER` for `GRASS_HEADERS_GIT_HASH` as a better value for non-git builds, that value won't change for simple rebuilds of the source tree.
As reported in OSGeo#2610, rebuilding the GRASS sources (from the release tarballs) with no changes break the gdal-grass plugins because the `GIS_H_VERSION` value changes. Non-git builds use the current timestamp in `GRASS_HEADERS_GIT_HASH` which is also used for `GRASS_HEADERS_DATE`. This PR uses `GRASS_VERSION_NUMBER` for `GRASS_HEADERS_GIT_HASH` as a better value for non-git builds, that value won't change for simple rebuilds of the source tree.
As reported in OSGeo#2610, rebuilding the GRASS sources (from the release tarballs) with no changes break the gdal-grass plugins because the `GIS_H_VERSION` value changes. Non-git builds use the current timestamp in `GRASS_HEADERS_GIT_HASH` which is also used for `GRASS_HEADERS_DATE`. This PR uses `GRASS_VERSION_NUMBER` for `GRASS_HEADERS_GIT_HASH` as a better value for non-git builds, that value won't change for simple rebuilds of the source tree.
Describe the bug
Every time GRASS is rebuilt, even when there are no changes, the timestamp recorded in
GRASS_HEADERS_VERSION
changes which breaks the gdal-grass plugins:The timestamp is not used for git builds, the commit hash for the last commit affecting the
include
directory is used.The error should not be triggered when there were no changes to the GRASS source tree that actually require rebuilding the gdal-grass plugins.
The GDAL version check only requires that the gdal-grass plugins are rebuilt when the major and or minor version changes which suggest ABI breakages.
Non-git builds of GRASS should use something like
GRASS_VERSION_NUMBER
forGRASS_HEADERS_VERSION
which doesn't change when GRASS is rebuilt.To Reproduce
Steps to reproduce the behavior:
ogrinfo
on a GRASS datasetExpected behavior
No error is trigggered.
System description
Additional context
Maintaining gdal-grass packages is very painful, because they need to be rebuilt every time GRASS is.
The text was updated successfully, but these errors were encountered: