Opened 9 years ago

Closed 9 years ago

#3482 closed enhancement (fixed)

Change distfile creation to based on a checkout, without writing the repo

Reported by: gdt Owned by: strk
Priority: high Milestone: PostGIS 2.2.2
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

Currently, make_dist.sh requires creating a tag in svn. This means making a distfile is heavyweight, and it can only be done by a commiter. It's not easily possible for a non-committer to casually create one to test building with it (a la "make distcheck" in automake). Further, packagers should be able to create a distfile and try it with the packaging system, to catch issues prior to a release, especially if the release process doesn't strictly include a 7-day freeze.

This ticket asks that distfile creation be separated from tagging, so that it's reasonably possible to run a command that makes a distfile from the current checkout (including uncommitted changes), and to have that distfile be identical to what would be created by the process used for releases. The identical notion is about ensuring that as much of the path from repo to distfile to package is tested as possible, without skipping any steps that could lead to errors or variances.

Change History (14)

comment:1 by strk, 9 years ago

I don't think make_dist.sh writes to the SVN repo, or at least I'm pretty sure it wasn't meant to. Could you please verify your statement ?

comment:2 by strk, 9 years ago

(In [14728]) Add -b switch to create the dist file from a branch

See #3482

comment:3 by strk, 9 years ago

r14728 (in trunk) adds a -b switch to make_dist.sh so to be able to create a tarball from a branch. Please see how you like it. Maybe it could be further tweaked to re-determine the version to apply to the tarball and exploded directory.

comment:4 by robe, 9 years ago

Milestone: PostGIS FuturePostGIS 2.2.2

comment:5 by strk, 9 years ago

One more thing I could add is using GIT when available, as the VCS, so you do not need access to the osgeo repository in order to create distribution from arbitrary revisions. I use git-svn as my primary development tool for postgis, so for me it's easy, and there are git mirrors on both gitlab and github if you want to track them for packaging.

comment:6 by strk, 9 years ago

(In [14731]) Set version from Version.config for branch dists too

See #3482

comment:7 by strk, 9 years ago

(In [14732]) Automatically use GIT if a .git directory exists locally

See #3482

comment:8 by strk, 9 years ago

And with r14732 we have support for a local .git repository. Let me know if you're satisfied with this Greg, so we can backport to 2.2 branch.

comment:9 by pramsey, 9 years ago

Owner: changed from pramsey to strk

in reply to:  1 comment:10 by gdt, 9 years ago

Replying to strk:

I don't think make_dist.sh writes to the SVN repo, or at least I'm pretty sure it wasn't meant to. Could you please verify your statement ?

What I meant was: before, when I tried to make a release tarball from a branch, it wasn't obvious how to do it, and when I read the docs, it said to create a tag in the repo. So I really meant "procedure to create a release tarball requires writing".

The current state definitely avoids the writing requirement.

comment:11 by gdt, 9 years ago

I am satisfied with the logical change to work on branches. When I run it, I get far enough to run into other trouble (which I'm still working around), but I think the changes you made are sound and ready for backport to 2.2. (I did not check the git stuff.)

comment:12 by gdt, 9 years ago

I have successfully created a distfile (that seems ok, but I have not built it) with a few workarounds unrelated to this ticket's change. Thanks very much for addressing this so quickly.

comment:13 by gdt, 9 years ago

The other issue is hardcoded make, which is sort of the same thing of not carrying over user environment adapations from the build. The following patch makes it easier to work around this, while not really changing anything. With it and the ticket:3488 patch, I have built a distfile.

This is really just:

  • using CONFIGURE_ARGS with configure
  • changing make to ${MAKE}, and defaulting to make if unset
Index: make_dist.sh
===================================================================
--- make_dist.sh	(revision 14733)
+++ make_dist.sh	(working copy)
@@ -20,6 +20,15 @@
 version=dev
 git=no
 
+# Define in environment if necessary to get postgis to configure,
+# which is only done to build comments.
+#CONFIGURE_ARGS=
+
+# Define in environment if Gnu make is not make (e.g., gmake).
+if [ "$MAKE" = "" ]; then
+    MAKE=make
+fi
+
 [ -d ".git" ] && git=yes
 [ "$git" = "yes" ] && tag=svn-$tag
 
@@ -66,7 +75,7 @@
 owd="$PWD"
 cd "$outdir"
 ./autogen.sh
-./configure
+./configure ${CONFIGURE_ARGS}
 # generating postgis_svn_revision.h for >= 2.0.0 tags 
 if test -f utils/svn_repo_revision.pl; then 
 	echo "Generating postgis_svn_revision.h"
@@ -79,11 +88,11 @@
 echo "Generating documentation"
 owd="$PWD"
 cd "$outdir"/doc
-make comments
+${MAKE} comments
 if [ $? -gt 0 ]; then
 	exit 1
 fi
-make clean # won't drop the comment files
+${MAKE} clean # won't drop the comment files
 cd "$owd"
 
 # Run make distclean
@@ -90,7 +99,7 @@
 echo "Running make distclean"
 owd="$PWD"
 cd "$outdir"
-make distclean
+${MAKE} distclean
 if [ "$git" = "yes" ]; then
   echo "Removing .git dir"
   rm -rf .git

comment:14 by strk, 9 years ago

Resolution: fixed
Status: newclosed

(In [14739]) Update make_dist.sh from trunk

Closes #3165 and #3482

Note: See TracTickets for help on using tickets.