You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ha...@apache.org on 2020/09/07 13:30:38 UTC

svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Author: hartmannathan
Date: Mon Sep  7 13:30:38 2020
New Revision: 1881534

URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
Log:
Avoid 'configure' error: cannot run test program while cross compiling

The SVN_LIB_MACHO_ITERATE macro contains an AC_RUN_IFELSE test that
will raise the following build failure when cross-compiling:

checking for Mach-O dynamic module iteration functions... configure: error: in `/home/fabrice/buildroot/output/build/subversion-1.14.0':
configure: error: cannot run test program while cross compiling

To avoid this build failure, set the action-if-cross-compiling of
AC_RUN_IFELSE to a pessimistic value (no). Moreover, encapsulate this
call with AC_CACHE_CHECK as suggested by Thomas Petazzoni to allow the
user to override this value when cross-compiling for macosx target.

See discussion "build/ac-macros/macosx.m4: workaround AC_RUN_IFELSE"
started 2020/08/30, archived at (3 mail threads):
https://lists.apache.org/thread.html/r932d960924ac514c003d22f499a8f1317a6005b5084d2be6141730e1%40%3Cdev.subversion.apache.org%3E
https://lists.apache.org/thread.html/rbf56391984e7f8abc11ca78d48e09dd18d57d66390e6f5a63b046fa5%40%3Cdev.subversion.apache.org%3E
https://lists.apache.org/thread.html/r935bf45f5a70d8d6247e1cf6323a4c9a6383b9cbd96d424768dce1f5%40%3Cdev.subversion.apache.org%3E

build/ac-macros/macosx.m4
* (SVN_LIB_MACHO_ITERATE): Wrap AC_RUN_IFELSE with AC_CACHE_CHECK. New
    variable 'ac_cv_mach_o_dynamic_module_iteration_works' allows
    cache check.

Patch by: Fabrice Fontaine

Inspired by: Thomas Petazzoni
(See https://git.buildroot.net/buildroot/tree/package/subversion/0002-workaround-ac-run-ifelse.patch?h=2020.08-rc3)

Review by: hartmannathan
           danielsh (earlier versions of the patch)

Tested by: hartmannathan (native macosx build)

Modified:
    subversion/trunk/build/ac-macros/macosx.m4

Modified: subversion/trunk/build/ac-macros/macosx.m4
URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/macosx.m4?rev=1881534&r1=1881533&r2=1881534&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/macosx.m4 (original)
+++ subversion/trunk/build/ac-macros/macosx.m4 Mon Sep  7 13:30:38 2020
@@ -20,28 +20,31 @@ dnl
 dnl  Mac OS X specific checks
 
 dnl SVN_LIB_MACHO_ITERATE
-dnl Check for _dyld_image_name and _dyld_image_header availability
-AC_DEFUN(SVN_LIB_MACHO_ITERATE,
-[
-  AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
-  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-    #include <mach-o/dyld.h>
-    #include <mach-o/loader.h>
-  ]],[[
-    const struct mach_header *header = _dyld_get_image_header(0);
-    const char *name = _dyld_get_image_name(0);
-    if (name && header) return 0;
-    return 1;
-  ]])],[
-    AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
-              [Is Mach-O low-level _dyld API available?])
-    AC_MSG_RESULT([yes])
-  ],[
-    AC_MSG_RESULT([no])
-  ])
-])
-
-dnl SVN_LIB_MACOS_PLIST
+dnl Check for _dyld_image_name and _dyld_image_header availability
+AC_DEFUN(SVN_LIB_MACHO_ITERATE,
+[
+  AC_CACHE_CHECK([for Mach-O dynamic module iteration functions],
+    [ac_cv_mach_o_dynamic_module_iteration_works], [
+    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+      #include <mach-o/dyld.h>
+      #include <mach-o/loader.h>
+    ]],[[
+      const struct mach_header *header = _dyld_get_image_header(0);
+      const char *name = _dyld_get_image_name(0);
+      if (name && header) return 0;
+      return 1;
+    ]])],
+    [ac_cv_mach_o_dynamic_module_iteration_works=yes],
+    [ac_cv_mach_o_dynamic_module_iteration_works=no],
+    [ac_cv_mach_o_dynamic_module_iteration_works=no])
+  ])
+  if test "$ac_cv_mach_o_dynamic_module_iteration_works" = yes; then
+    AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
+              [Is Mach-O low-level _dyld API available?])
+  fi
+])
+
+dnl SVN_LIB_MACOS_PLIST
 dnl Assign variables for Mac OS property list support
 AC_DEFUN(SVN_LIB_MACOS_PLIST,
 [



Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Nathan Hartman <ha...@gmail.com>.
On Sat, Nov 14, 2020 at 4:51 AM Branko Čibej <br...@apache.org> wrote:
>
> On 13.11.2020 17:37, Nathan Hartman wrote:
> > On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
> >> On 07.09.2020 15:30, hartmannathan@apache.org wrote:
> >>> Author: hartmannathan
> >>> Date: Mon Sep  7 13:30:38 2020
> >>> New Revision: 1881534
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
> >>> Log:
> >>> Avoid 'configure' error: cannot run test program while cross compiling
> >>
> >> Your changes added CRLF line endings to a script that didn't have them
> >> previously.
> >>
> >> a) set svn:eol-style (and update the backport proposal)
> > Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)
>
>
> This fixes the issue on trunk, but when I merge the two revisions to
> 1.14.x ...
>
> $ svn diff
> svn: E135000: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> svn: E135000: Inconsistent line ending style
>
> $ svn ps svn:eol-style native build/ac-macros/macosx.m4
> svn: E200009: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> svn: E135000: Inconsistent line ending style
>
>
> Did we really mean this? that 'svn diff' errors out on inconsistent
> newlines? Really really? And that you can't make them consistent by
> setting the svn:eol-style property (which 'svn merge' already did')?
>
> -- Brane


To workaround the above problem ('svn diff' refuses to work due to
"inconsistent newlines" and/or addition of svn:eol-style property) I
created a backport branch wherein I manually fixed up the newlines.

This merges cleanly into 1.14.x and, after doing that, 'svn diff'
works. See below...

I re-nominated it in 1.14.x STATUS, "r1881534 (without CRLF problem)"
for your voting pleasure.

Cheers,
Nathan

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Branko Čibej wrote on Mon, 16 Nov 2020 16:15 +0100:
> On 15.11.2020 19:16, Nathan Hartman wrote:
> > On Sat, Nov 14, 2020 at 4:51 AM Branko Čibej <br...@apache.org> wrote:  
> >> On 13.11.2020 17:37, Nathan Hartman wrote:  
> >>> Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)  
> >>
> >> This fixes the issue on trunk, but when I merge the two revisions to
> >> 1.14.x ...
> >>
> >> $ svn diff
> >> svn: E135000: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> >> svn: E135000: Inconsistent line ending style
> >>
> >> $ svn ps svn:eol-style native build/ac-macros/macosx.m4
> >> svn: E200009: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> >> svn: E135000: Inconsistent line ending style
> >>
> >>
> >> Did we really mean this? that 'svn diff' errors out on inconsistent
> >> newlines? Really really? And that you can't make them consistent by
> >> setting the svn:eol-style property (which 'svn merge' already did')?  
> > Looks like a bug to me. I'll try to track it down... It has something
> > to do with eol-style processing. I also get "E200042: Additional
> > errors:" but there are no additional errors listed. Same result
> > happens regardless of the order of merging the two revisions, but
> > removing the svn-eol-style property makes 'svn diff' work normally.  
> 
> 
> Looks like this behaviour has been in the code for a long time. It's 
> correct that 'svn diff' doesn't try to "repair" the line endings, those 
> must show up in the diff, but failing is kind of wrong. It's correct for 
> 'svn commit' iff we have svn:eol-style set, but IMO wrong for 'svn diff'.
> 
> Also I *do not* understand how that could even be an issue in this case, 
> since the line endings were fixed in the repository. Does 'svn merge' do 
> something wrong?

The file ends up with svn:eol-style=native set (even before the
propset) but a mix of LF and CRLF on disk.  Passing it through
dos2unix(1) makes the error go away.  Seems like several different bugs:

- Merging the propset left the file with inconsistent newlines.

- «svn diff» treated the inconsistency as a fatal error, even under
  -x--ignore-eol-style.  It could have printed a diff (plus or minus
  a warning, when -x--ignore-eol-style isn't in effect).

- brane's idempotent «propset» failed.

Cheers,

Daniel

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Branko Čibej <br...@apache.org>.
On 15.11.2020 19:16, Nathan Hartman wrote:
> On Sat, Nov 14, 2020 at 4:51 AM Branko Čibej <br...@apache.org> wrote:
>> On 13.11.2020 17:37, Nathan Hartman wrote:
>>> Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)
>>
>> This fixes the issue on trunk, but when I merge the two revisions to
>> 1.14.x ...
>>
>> $ svn diff
>> svn: E135000: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
>> svn: E135000: Inconsistent line ending style
>>
>> $ svn ps svn:eol-style native build/ac-macros/macosx.m4
>> svn: E200009: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
>> svn: E135000: Inconsistent line ending style
>>
>>
>> Did we really mean this? that 'svn diff' errors out on inconsistent
>> newlines? Really really? And that you can't make them consistent by
>> setting the svn:eol-style property (which 'svn merge' already did')?
> Looks like a bug to me. I'll try to track it down... It has something
> to do with eol-style processing. I also get "E200042: Additional
> errors:" but there are no additional errors listed. Same result
> happens regardless of the order of merging the two revisions, but
> removing the svn-eol-style property makes 'svn diff' work normally.


Looks like this behaviour has been in the code for a long time. It's 
correct that 'svn diff' doesn't try to "repair" the line endings, those 
must show up in the diff, but failing is kind of wrong. It's correct for 
'svn commit' iff we have svn:eol-style set, but IMO wrong for 'svn diff'.

Also I *do not* understand how that could even be an issue in this case, 
since the line endings were fixed in the repository. Does 'svn merge' do 
something wrong?

-- Brane

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Nathan Hartman <ha...@gmail.com>.
On Sat, Nov 14, 2020 at 4:51 AM Branko Čibej <br...@apache.org> wrote:
>
> On 13.11.2020 17:37, Nathan Hartman wrote:
> > Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)
>
>
> This fixes the issue on trunk, but when I merge the two revisions to
> 1.14.x ...
>
> $ svn diff
> svn: E135000: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> svn: E135000: Inconsistent line ending style
>
> $ svn ps svn:eol-style native build/ac-macros/macosx.m4
> svn: E200009: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
> svn: E135000: Inconsistent line ending style
>
>
> Did we really mean this? that 'svn diff' errors out on inconsistent
> newlines? Really really? And that you can't make them consistent by
> setting the svn:eol-style property (which 'svn merge' already did')?

Looks like a bug to me. I'll try to track it down... It has something
to do with eol-style processing. I also get "E200042: Additional
errors:" but there are no additional errors listed. Same result
happens regardless of the order of merging the two revisions, but
removing the svn-eol-style property makes 'svn diff' work normally.

$ svn merge -c 1881534 https://svn.apache.org/repos/asf/subversion/trunk
--- Merging r1881534 into '.':
U    build/ac-macros/macosx.m4
--- Recording mergeinfo for merge of r1881534 into '.':
 U   .
$ svn merge -c 1883388 https://svn.apache.org/repos/asf/subversion/trunk
--- Merging r1883388 into '.':
 U   build/ac-macros/macosx.m4
--- Recording mergeinfo for merge of r1883388 into '.':
 G   .
$ svn st
 M      .
MM      build/ac-macros/macosx.m4
$ svn diff
svn: E135000: File
'/mount/ramdrive/svn-trunk/build/ac-macros/macosx.m4' has inconsistent
newlines
svn: E135000: Inconsistent line ending style
svn: E200042: Additional errors:
$ svn propdel svn:eol-style build/ac-macros/macosx.m4
property 'svn:eol-style' deleted from 'build/ac-macros/macosx.m4'.
$ svn diff
Index: build/ac-macros/macosx.m4
===================================================================
<snip>

Nathan

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Branko Čibej <br...@apache.org>.
On 13.11.2020 17:37, Nathan Hartman wrote:
> On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
>> On 07.09.2020 15:30, hartmannathan@apache.org wrote:
>>> Author: hartmannathan
>>> Date: Mon Sep  7 13:30:38 2020
>>> New Revision: 1881534
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
>>> Log:
>>> Avoid 'configure' error: cannot run test program while cross compiling
>>
>> Your changes added CRLF line endings to a script that didn't have them
>> previously.
>>
>> a) set svn:eol-style (and update the backport proposal)
> Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)


This fixes the issue on trunk, but when I merge the two revisions to 
1.14.x ...

$ svn diff
svn: E135000: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
svn: E135000: Inconsistent line ending style

$ svn ps svn:eol-style native build/ac-macros/macosx.m4
svn: E200009: File '.../build/ac-macros/macosx.m4' has inconsistent newlines
svn: E135000: Inconsistent line ending style


Did we really mean this? that 'svn diff' errors out on inconsistent 
newlines? Really really? And that you can't make them consistent by 
setting the svn:eol-style property (which 'svn merge' already did')?

-- Brane


Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
>
> On 07.09.2020 15:30, hartmannathan@apache.org wrote:
> > Author: hartmannathan
> > Date: Mon Sep  7 13:30:38 2020
> > New Revision: 1881534
> >
> > URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
> > Log:
> > Avoid 'configure' error: cannot run test program while cross compiling
>
>
> Your changes added CRLF line endings to a script that didn't have them
> previously.
>
> a) set svn:eol-style (and update the backport proposal)

Done in r1883388. Added to the backport proposal but I'll let you un-veto it :-)

Cheers,
Nathan

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Branko Čibej <br...@apache.org>.
On 13.11.2020 16:30, Nathan Hartman wrote:
> On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
>> a) set svn:eol-style (and update the backport proposal)
>> b) fix your editor :)
> Suggestion needed:
>
> All of these do not have svn:eol-style set:
>
> ax_boost_base.m4
> ax_boost_unit_test_framework.m4
> compiler.m4
> libsecret.m4
> lz4.m4
> macosx.m4
> py3c.m4
>
> Also svn:auto-props on trunk does not have *.m4:
>
> *.c = svn:eol-style=native
> *.cpp = svn:eol-style=native
> *.h = svn:eol-style=native
> *.hpp = svn:eol-style=native
> *.java = svn:eol-style=native
> *.py = svn:eol-style=native
> *.pl = svn:eol-style=native
> *.rb = svn:eol-style=native
> *.sql = svn:eol-style=native
> *.txt = svn:eol-style=native
> README = svn:eol-style=native
> BRANCH-README = svn:eol-style=native
> STATUS = svn:eol-style=native
>
> How big of a fix do we want?
>
> (1) Just macosx.m4?


For the backport fixup, just this, yes.


> (2) All the above *.m4?
> (3) All the above *.m4 and add *.m4 to auto-props?


In a separate commit. *.m4 files are only used on Unix, we should set 
auto props for them.

-- Brane

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
> a) set svn:eol-style (and update the backport proposal)
> b) fix your editor :)

Suggestion needed:

All of these do not have svn:eol-style set:

ax_boost_base.m4
ax_boost_unit_test_framework.m4
compiler.m4
libsecret.m4
lz4.m4
macosx.m4
py3c.m4

Also svn:auto-props on trunk does not have *.m4:

*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.hpp = svn:eol-style=native
*.java = svn:eol-style=native
*.py = svn:eol-style=native
*.pl = svn:eol-style=native
*.rb = svn:eol-style=native
*.sql = svn:eol-style=native
*.txt = svn:eol-style=native
README = svn:eol-style=native
BRANCH-README = svn:eol-style=native
STATUS = svn:eol-style=native

How big of a fix do we want?

(1) Just macosx.m4?
(2) All the above *.m4?
(3) All the above *.m4 and add *.m4 to auto-props?

Thanks,
Nathan

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Nov 13, 2020 at 9:20 AM Branko Čibej <br...@apache.org> wrote:
>
> On 07.09.2020 15:30, hartmannathan@apache.org wrote:
> > Author: hartmannathan
> > Date: Mon Sep  7 13:30:38 2020
> > New Revision: 1881534
> >
> > URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
> > Log:
> > Avoid 'configure' error: cannot run test program while cross compiling
>
>
> Your changes added CRLF line endings to a script that didn't have them
> previously.
>
> a) set svn:eol-style (and update the backport proposal)
> b) fix your editor :)

Ugh. Ok I'll fix it :-)

Thanks for catching that

Nathan

Re: svn commit: r1881534 - /subversion/trunk/build/ac-macros/macosx.m4

Posted by Branko Čibej <br...@apache.org>.
On 07.09.2020 15:30, hartmannathan@apache.org wrote:
> Author: hartmannathan
> Date: Mon Sep  7 13:30:38 2020
> New Revision: 1881534
>
> URL: http://svn.apache.org/viewvc?rev=1881534&view=rev
> Log:
> Avoid 'configure' error: cannot run test program while cross compiling


Your changes added CRLF line endings to a script that didn't have them 
previously.

a) set svn:eol-style (and update the backport proposal)
b) fix your editor :)

-- Brane