#3863 closed defect (fixed)
git builds always need upgrade
Reported by: | komzpa | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.4.2 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
We're building 2.4.0 from git.
postgis_scripts_installed() lists it as '2.4.0dev'; postgis_scripts_released() lists it as '2.4.0dev r0'.
Standard upgrade dev → devnext → dev passes, but still needs upgrade.
Change History (13)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
okay not seeing an issue with extension building.
I used winnie's postgis 2.4.0alpha build and SELECT postgis_full_version(); showed alpha and the r number.
Then I copied over the latest dev build and did
ALTER EXTENSION postgis UPDATE;
POSTGIS="2.4.0dev r15800" PGSQL="100" GEOS="3.7.0dev-CAPI-1.11.0 81c6d4a" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.2.1, released 2017/06/23" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER
Her PostGIS 2.4.0 source for builds are pulled from git.osgeo.org/gogs
I looked at the tarball for PostGIS 2.4.0rc1 that debbie built which I used git.osgeo.org/gogs to build from and that has the revision number in it as well.
Komzzpa — what does the file postgis_svn_revision.h read? I suspect in your case it reads 0
which means the routine that pulls the revision number utils/svn_repo_revision.pl is not working for you.
There is logic to read both svn and git in that script. Looks like for git it uses git log
${git_exe}\" log --grep=git-svn -1 | grep git-svn | cut -d@ -f2 | cut -d' ' -f1
Note that with each mirror this gets tacked on to the git log
— this is the last one
git-svn-id: http://svn.osgeo.org/postgis/trunk@15802 b70326c6-7e19-0410-871a-916f4a2858ee
So that command to parse out the number after @ probably isn't working for you.
comment:3 by , 7 years ago
Milestone: | PostGIS 2.4.0 → PostGIS 2.4.1 |
---|
comment:4 by , 7 years ago
Owner: | changed from | to
---|
comment:5 by , 7 years ago
Just occurred to me what might be Komzzpa problem. Since we pull the svn revision number from the git-svn-id, any git branch that is not in svn would not have a revision number and then I think it would exhibit the issue he is seeing.
Since Debbie and Winnie only build by the mirrored branches, I wouldn't be seeing the issue in them.
comment:6 by , 7 years ago
okay that's not it. I built from git in a checked out experimental branch and still got revision numbers. Maybe git log just doesn't work on Komzzpa's system.
I should also add I looked at pull requests run from travis of Komzzpa's and they have revision numbers too like this pull request regress run - https://travis-ci.org/postgis/postgis/builds/286578260?utm_source=github_status&utm_medium=notification
One other thought is maybe Komzzpa isn't running
sh autogen.sh
and it works cause he's got some old configure script lying around.
comment:7 by , 7 years ago
If you try to build without .git directory you`ll get 'r0' revision number. Is it possible to store revision number as macros?
comment:8 by , 7 years ago
I suspect the same could be said about building from svn. That's what we have tarballs for since those already have the revision number stamped.
I don't see how we could accomplish without having our build bot stamping all the time.
Eventually once it's in git, we'd probably just switch to using git hashes anyway, though would that work without having .git folder? Not having a .git to me would defeat the purpose of building from git in the first place.
comment:9 by , 7 years ago
Milestone: | PostGIS 2.4.1 → PostGIS 2.4.2 |
---|
comment:10 by , 7 years ago
Confirmed: either you build from a tarball (which should have the revision already provided) or you build from a GIT (with .git dir) or SVN (with .svn dir) checkout. Other kind of builds are not expected to ever yeld anything but "0" as the revision number. Besides, if "0" is consistent between library and scripts you should still not get the "needs upgrade" message, so that message is still meaningful as it's telling you that scripts and libs are coming from different builds.
comment:11 by , 7 years ago
re-reading the original ticket description I see there's a lack of "r" in one of the outputs. So this is a real bug. It's due to this snippet in sqldefines.h:
#if POSTGIS_SVN_REVISION #define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.5.0dev'::text || ' r' || POSTGIS_SVN_REVISION::text AS version $$ #else #define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.5.0dev'::text AS version $$ #endif
That logic (considering r0 as special) is not present in the implementation of postgis_scripts_installed, thus the discrepancy and the misleading warning.
This might not be a global issue, might be something specific with how komzpa is setup. Discussed on IRC with him.
Travis who also builds from github does show revision numbers. Though I forget what magic strk put in place to make that happen.
winnie also build from git (git.osgeo.org) and she shows revision numbers as well.
I'm going to install the extension files from winnie to make sure it's not happening during the generation of the extension files.
Komzpaa, are you absolutely sure your make install is working and installing latest scripts. As I mentioned on IRC, even if revision number wasn't coming thru, I should still at least see a PGSQL=100 since PostGIS 2.4.0beta. Yours is not showing that which makes me question if they are the latest.
— dialog from IRC below