Discussion:
Subversion 1.9.5 --with-serf problem
Gretton, Liam
2017-06-07 10:44:07 UTC
Permalink
I've been packaging 1.9.5 for our environment, having missed a few versions since 1.8.13.

At some point since 1.8.13 the logic in the configure script for dealing with the --with-serf option has changed.

Now pkg-config overrides the use of the --with-serf value and this breaks the build if serf has been built in a sandbox (i.e. with the --install-sandbox option) as $serf_prefix within configure takes the value of the intended location of serf rather than where it's actually located.

It may be that there's a neat solution to this that I've not figured out, but if not it would be useful to revert that behaviour if possible and always honour the --with-serf value.
--
Liam Gretton ***@le.ac.uk
Systems Specialist http://www.le.ac.uk/its
IT Services Tel: +44 (0)116 2522254
University of Leicester, University Road
Leicestershire LE1 7RH, United Kingdom
Daniel Shahaf
2017-06-07 12:33:21 UTC
Permalink
Post by Gretton, Liam
At some point since 1.8.13 the logic in the configure script for dealing with the --with-serf option has changed.
Now pkg-config overrides the use of the --with-serf value and this breaks the build if serf has been built in a sandbox (i.e. with the --install-sandbox option) as $serf_prefix within configure takes the value of the intended location of serf rather than where it's actually located.
Could you explain in more detail what use-case is broken? The configure
logic for serf (build/ac-macros/serf.m4), when --with-serf=foo is
passed, first tries foo/lib/pkgconfig/serf-1.pc and if that fails falls
back to looking for serf under foo without pkg-config. At no point does
it try the system pkg-config dirs.

Are you saying that you installed serf to a non-empty $(DESTDIR), and
then configure finds a *.pc file under that directory that points the
build system to the designated installation path (= the same path
without the $(DESTDIR) prefix)?

In that case, the following patch might work, although it needs
to be amended to explain the above.

The AC_MSG_CHECKING() could probably use better wording,
suggestions welcome.

Cheers,

Daniel

[[[
* build/ac-macros/serf.m4: An explicit prefix should take precedence over
pkg-config.

Found by: Liam Gretton
]]]

[[[
Index: build/ac-macros/serf.m4
===================================================================
--- build/ac-macros/serf.m4 (revision 1797913)
+++ build/ac-macros/serf.m4 (working copy)
@@ -70,12 +70,16 @@ AC_DEFUN(SVN_LIB_SERF,
])

if test "$serf_skip" = "no" ; then
- SVN_SERF_PKG_CONFIG()
- if test -n "$serf_prefix" && test "$serf_found" = "no" ; then
+ dnl Try the prefix if one was provided.
+ if test -n "$serf_prefix" ; then
SVN_SERF_PREFIX_CONFIG()
fi
+ dnl Either --with-serf wasn't passed, or was passed without argument.
+ if test "$serf_found" = "no" ; then
+ SVN_SERF_PKG_CONFIG()
+ fi

- AC_MSG_CHECKING([was serf enabled])
+ AC_MSG_CHECKING([whether to build libsvn_ra_serf])
if test "$serf_found" = "yes"; then
AC_MSG_RESULT([yes])
else
]]]
Gretton, Liam
2017-06-07 14:02:42 UTC
Permalink
Thanks very much for this patch, it does indeed fix the problem for me.

My use case is pretty much as you describe. I'm building a Subversion client RPM which includes serf.

During the %build phase serf is built as so:

scons PREFIX=%{prefix} install --install-sandbox=%{buildroot}

It therefore installs into %buildroot rather than %prefix, but the serf-1.pc file used by pkg-config will contain %prefix paths. When the subversion configure step runs I use --with-serf=%buildroot but because it now uses pkg-config in preference to the --with-serf value, %prefix is assumed and the include files etc don't get found.

--
Liam Gretton ***@le.ac.uk
Systems Specialist http://www.le.ac.uk/its
IT Services Tel: +44 (0)116 2522254
University of Leicester, University Road
Leicestershire LE1 7RH, United Kingdom
-----Original Message-----
Sent: 07 June 2017 13:33
Subject: [PATCH] Re: Subversion 1.9.5 --with-serf problem
Could you explain in more detail what use-case is broken? The configure
logic for serf (build/ac-macros/serf.m4), when --with-serf=foo is
passed, first tries foo/lib/pkgconfig/serf-1.pc and if that fails falls
back to looking for serf under foo without pkg-config. At no point does
it try the system pkg-config dirs.
Are you saying that you installed serf to a non-empty $(DESTDIR), and
then configure finds a *.pc file under that directory that points the
build system to the designated installation path (= the same path
without the $(DESTDIR) prefix)?
In that case, the following patch might work, although it needs
to be amended to explain the above.
The AC_MSG_CHECKING() could probab
Andreas Stieger
2017-06-07 14:48:11 UTC
Permalink
Post by Gretton, Liam
Thanks very much for this patch, it does indeed fix the problem for me.
My use case is pretty much as you describe.
I'm building a Subversion client RPM which includes serf.
scons PREFIX=%{prefix} install --install-sandbox=%{buildroot}
It therefore installs into %buildroot rather than %prefix, but the serf-1.pc
file used by pkg-config will contain %prefix paths. When the subversion
configure step runs I use --with-serf=%buildroot but because it now uses
pkg-config in preference to the --with-serf value, %prefix is assumed and the
include files etc don't get found.
You are building two packages in one. "scons PREFIX=%{prefix} install --install-sandbox=%{buildroot}" assumes that you will extract the files installed to %{buildroot} to make a serf rpm, then use the -devel to build the subversion one (at which point all paths with check out).

For reference:
https://build.opensuse.org/package/view_file/openSUSE:Factory/libserf/libserf.spec
https://build.opensuse.org/package/view_file/openSUSE:Factory/subversion/subversion.spec

If you really want to use the serf built in the combined package, point --with-serf= to the serf (source) build tree, not the (install) build root.

Andreas

Continue reading on narkive:
Loading...