You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@apache.org> on 2019/04/09 22:07:23 UTC
Re: apr-1.7.0 breaks subversion build
[moved from users@]
On 09.04.2019 18:07, Stefan Sperling wrote:
> On Tue, Apr 09, 2019 at 05:52:30PM +0200, Stefan Sperling wrote:
>> You are right, this looks like a problem in Subversion's configure script.
>> It assumes that APR uses "d", "ld" or "lld" for this format string which
>> is now a wrong assumption.
> Pierre, could you please try this patch against Subversion and let
> me know if it helps?
>
> Index: build/ac-macros/swig.m4
> ===================================================================
> --- build/ac-macros/swig.m4 (revision 1857217)
> +++ build/ac-macros/swig.m4 (working copy)
> @@ -132,6 +132,10 @@ AC_DEFUN(SVN_FIND_SWIG,
> dnl Sun Forte adds an extra space before substituting APR_INT64_T_FMT
> dnl gcc-2.95 adds an extra space after substituting APR_INT64_T_FMT
> dnl thus the egrep patterns have a + in them.
> + dnl
> + dnl APR >= 1.7.0 uses PRId64 from inttypes.h on many platforms, so if
> + dnl we fail to match APR_INT64_T_FMT to a known format string, try to
> + dnl deduce the format string from inttypes.h instead of apr.h.
> SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
> CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
> AC_CACHE_CHECK([for apr_int64_t Python/C API format string],
> @@ -154,6 +158,24 @@ AC_DEFUN(SVN_FIND_SWIG,
> MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> [svn_cv_pycfmt_apr_int64_t="i"])
> fi
> + if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> + AC_EGREP_CPP([MaTcHtHiS +\"lld\" +EnDeNd],
> + [#include <inttypes.h>
> + MaTcHtHiS PRId64 EnDeNd],
> + [svn_cv_pycfmt_apr_int64_t="L"])
> + fi
> + if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> + AC_EGREP_CPP([MaTcHtHiS +\"ld\" +EnDeNd],r
> + [#include <inttypes.h>
> + MaTcHtHiS PRId64 EnDeNd],
> + [svn_cv_pycfmt_apr_int64_t="l"])
> + fi
> + if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> + AC_EGREP_CPP([MaTcHtHiS +\"d\" +EnDeNd],
> + [#include <inttypes.h>
> + MaTcHtHiS PRId64 EnDeNd],
> + [svn_cv_pycfmt_apr_int64_t="i"])
> + fi
> ])
> CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
> if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
This is nonsense. We should replace the single use of
SVN_APR_INT64_T_PYCFMT in swigutil_py.c with "L" and cast to
PY_LONG_LONG and be done with it. Such checks will always have failing
edge cases, so let's just get rid of them.
-- Brane
Re: apr-1.7.0 breaks subversion build
Posted by Branko Čibej <br...@apache.org>.
On 15.04.2019 11:44, Stefan Sperling wrote:
> On Mon, Apr 15, 2019 at 11:34:01AM +0200, Branko Čibej wrote:
>> On 12.04.2019 11:28, Stefan Sperling wrote:
>>> On Wed, Apr 10, 2019 at 12:07:23AM +0200, Branko Čibej wrote:
>>>> This is nonsense. We should replace the single use of
>>>> SVN_APR_INT64_T_PYCFMT in swigutil_py.c with "L" and cast to
>>>> PY_LONG_LONG and be done with it. Such checks will always have failing
>>>> edge cases, so let's just get rid of them.
>>> Agreed. See https://svn.apache.org/r1857391 Does this look good?
>> Better. Except that, IIRC, PY_LONG_LONG might not be defined on some
>> platform/compiler combinations.
> Comments in python's own header files suggest that PY_LONG_LONG will work
> with C compilers which support a 'long long' type. This isn't C89 but I
> would say this a safe assumption for all compilers we intend to support
> going forward, isn't it? In any case, our code base already relies on
> 'long long' types in other places, e.g. swig bindings and lz4.
Ack. That was my basically my point.
Re: apr-1.7.0 breaks subversion build
Posted by Stefan Sperling <st...@elego.de>.
On Mon, Apr 15, 2019 at 11:34:01AM +0200, Branko Čibej wrote:
> On 12.04.2019 11:28, Stefan Sperling wrote:
> > On Wed, Apr 10, 2019 at 12:07:23AM +0200, Branko Čibej wrote:
> >> This is nonsense. We should replace the single use of
> >> SVN_APR_INT64_T_PYCFMT in swigutil_py.c with "L" and cast to
> >> PY_LONG_LONG and be done with it. Such checks will always have failing
> >> edge cases, so let's just get rid of them.
> > Agreed. See https://svn.apache.org/r1857391 Does this look good?
>
> Better. Except that, IIRC, PY_LONG_LONG might not be defined on some
> platform/compiler combinations.
Comments in python's own header files suggest that PY_LONG_LONG will work
with C compilers which support a 'long long' type. This isn't C89 but I
would say this a safe assumption for all compilers we intend to support
going forward, isn't it? In any case, our code base already relies on
'long long' types in other places, e.g. swig bindings and lz4.
Re: apr-1.7.0 breaks subversion build
Posted by Branko Čibej <br...@apache.org>.
On 12.04.2019 11:28, Stefan Sperling wrote:
> On Wed, Apr 10, 2019 at 12:07:23AM +0200, Branko Čibej wrote:
>> This is nonsense. We should replace the single use of
>> SVN_APR_INT64_T_PYCFMT in swigutil_py.c with "L" and cast to
>> PY_LONG_LONG and be done with it. Such checks will always have failing
>> edge cases, so let's just get rid of them.
> Agreed. See https://svn.apache.org/r1857391 Does this look good?
Better. Except that, IIRC, PY_LONG_LONG might not be defined on some
platform/compiler combinations.
On the other hand, we can fix that if and when someone reports it. The
current change is already much better than what we tried doing before.
-- Brane
Re: apr-1.7.0 breaks subversion build
Posted by Stefan Sperling <st...@elego.de>.
On Wed, Apr 10, 2019 at 12:07:23AM +0200, Branko Čibej wrote:
> This is nonsense. We should replace the single use of
> SVN_APR_INT64_T_PYCFMT in swigutil_py.c with "L" and cast to
> PY_LONG_LONG and be done with it. Such checks will always have failing
> edge cases, so let's just get rid of them.
Agreed. See https://svn.apache.org/r1857391 Does this look good?