Menu

#191 Most tests fail

autogen
pending
None
1
2020-09-15
2018-09-17
No

Most tests fail on macOS 10.13:

============================================================================
Testsuite summary for GNU AutoGen 5.18.16
============================================================================
# TOTAL: 24
# PASS:  3
# SKIP:  0
# XFAIL: 0
# FAIL:  21
# XPASS: 0
# ERROR: 0
============================================================================
1 Attachments

Discussion

  • Bruce Korb

    Bruce Korb - 2018-09-17

    What ditritus do you get with:

    cd $top_builddir/autoopts/test
    make verbose TESTS=alias
    

    It looks like it is configured to use gettext but cannot find the library at link time.

     
  • Ryan Carsten Schmidt

    I agree... Attached is the output of running that.

    I see that autoopts/test/Makefile contains the line LIBS = -lm -lintl -ldl but maybe $LIBS isn't being used by the tests.

    I tried adding -lintl to LDFLAGS when invoking ./configure, which does get -lintl to appear in the autoopts/test/Makefile LDFLAGS line, but that too seems to be ignored by the tests.

     
  • Bruce Korb

    Bruce Korb - 2020-09-14

    Is this still a problem? Noone else reports it.

     
  • Ryan Carsten Schmidt

    I tried the tests again now on macOS 10.13 and got the same failing results.

     
  • Bruce Korb

    Bruce Korb - 2020-09-15
    • status: open --> accepted
    • assigned_to: Bruce Korb
     
  • Bruce Korb

    Bruce Korb - 2020-09-15

    Once I have a release nearly ready, I'll try it on my Mac.

     
  • Bruce Korb

    Bruce Korb - 2020-09-15
    • status: accepted --> closed
     
  • Bruce Korb

    Bruce Korb - 2020-09-15

    I don't think you've got "gettext" installed properly.

    >>alias-compile> ccache /usr/bin/clang -pipe -Os -arch x86_64 -fno-strict-aliasing -DHAVE_CONFIG_H -DTEST_TEST_ALIAS_OPTS -I/path/to/autogen-5.18.16 -I/path/to/autogen-5.18.16/agen5 -I/path/to/autogen-5.18.16/autoopts -I/opt/local/include -o alias alias.c /path/to/autogen-5.18.16/autoopts/libopts_la-libopts.o
    Undefined symbols for architecture x86_64:
      "_gettext", referenced from:
          _AO_gettext in alias-24d154.o
      "_libintl_dgettext", referenced from:
          _print_one_paragraph in libopts_la-libopts.o
      "_libintl_gettext", referenced from:
          _print_one_paragraph in libopts_la-libopts.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
     
  • Ryan Carsten Schmidt

    Well I'm the maintainer of gettext in MacPorts and I have over 150 other ports installed that use gettext, so I think gettext is installed correctly.

    I agree that the tests are failing because gettext symbols can't be found, but I think the reason for that is that the -L/opt/local/lib -lintl flags are not being used here in the tests. I don't know why that is though.

     
  • Bruce Korb

    Bruce Korb - 2020-09-15
    • status: closed --> accepted
     
  • Bruce Korb

    Bruce Korb - 2020-09-15

    I don't think you've got "gettext" installed properly.

    >>alias-compile> ccache /usr/bin/clang -pipe -Os -arch x86_64 -fno-strict-aliasing -DHAVE_CONFIG_H -DTEST_TEST_ALIAS_OPTS -I/path/to/autogen-5.18.16 -I/path/to/autogen-5.18.16/agen5 -I/path/to/autogen-5.18.16/autoopts -I/opt/local/include -o alias alias.c /path/to/autogen-5.18.16/autoopts/libopts_la-libopts.o
    Undefined symbols for architecture x86_64:
      "_gettext", referenced from:
          _AO_gettext in alias-24d154.o
      "_libintl_dgettext", referenced from:
          _print_one_paragraph in libopts_la-libopts.o
      "_libintl_gettext", referenced from:
          _print_one_paragraph in libopts_la-libopts.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
     
  • Ryan Carsten Schmidt

    Just to add, if nobody else sees this problem on macOS, maybe that's because nobody else is running the tests on macOS, or those who are aren't trying to do so with gettext. macOS doesn't ship with gettext so the user would have to install it themselves and configure autogen to use it.

    If I just run

    ./configure --disable-dependency-tracking ac_cv_func_utimensat=no
    make -j8
    make check
    

    then it doesn't find gettext and all tests succeed (except one, for which I've filed bug #200). But if I have gettext installed with MacPorts and run

    CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure --disable-dependency-tracking ac_cv_func_utimensat=no
    make -j8
    make check
    

    then it does find gettext and the tests fail because of not using -L/opt/local/lib -lintl.

     
  • Bruce Korb

    Bruce Korb - 2020-09-15

    Since I'm not seeing it, would you be kind enough to try this patch?
    I think it should get the LD flags into the command line.

    diff --git a/autoopts/test/Makefile.am b/autoopts/test/Makefile.am
    index 33633e49..8c7ba791 100644
    --- a/autoopts/test/Makefile.am
    +++ b/autoopts/test/Makefile.am
    @@ -34,6 +34,16 @@ TESTS      = \
         nls.test     rc.test       shell.test     stdopts.test   \
         time.test    usage.test    vendor.test    vers.test
    
    +TESTS_ENVIRONMENT = TERM='' \
    +   CFLAGS='$(CFLAGS)' \
    +   COMPILE='$(COMPILE)' \
    +   EXPRLIST="$(EXPRLIST)" \
    +   LDFLAGS='$(LDFLAGS)' \
    +   SHELL="$(POSIX_SHELL)" \
    +   srcdir="$(srcdir)" \
    +   top_builddir="$(top_builddir)" \
    +   top_srcdir="$(top_srcdir)"
    +
     getopt.test : ../$(libsrc)
     ../$(libsrc):
        cd .. ; echo $(MAKE) $(libsrc) ; $(MAKE) $(libsrc) >/dev/null 2>&1
    diff --git a/autoopts/test/defs.in b/autoopts/test/defs.in
    index a026d89f..da5a159b 100644
    --- a/autoopts/test/defs.in
    +++ b/autoopts/test/defs.in
    @@ -283,7 +283,7 @@ compile()
       test "X${Dnam}"  = "X" && Dnam="${testname}"
    
       d=`echo TEST_TEST_${Dnam}_OPTS | ${TR} '[a-z]-' '[A-Z]_'`
    -  cc_cmd="${CC} ${CFLAGS} -D$d ${INC} -o ${Cexe} ${Csrc}.c ${LIB}"
    +  cc_cmd="${CC} ${CFLAGS} ${LDFLAGS} -D$d ${INC} -o ${Cexe} ${Csrc}.c ${LIB}"
       eval ${cc_cmd} || \
         failure cannot compile ${Csrc}.c
       if test $# -gt 0
    
     
  • Ryan Carsten Schmidt

    Thanks, that's promising. It got -L/opt/local/lib into the compile flags, but still not -lintl. With a little experimentation, I found that the changes to Makefile.am were not needed and the following changes let the tests (except getopt.test) pass:

    --- a/autoopts/test/defs.in
    +++ b/autoopts/test/defs.in
    @@ -283,7 +283,7 @@ compile()
       test "X${Dnam}"  = "X" && Dnam="${testname}"
    
       d=`echo TEST_TEST_${Dnam}_OPTS | ${TR} '[a-z]-' '[A-Z]_'`
    -  cc_cmd="${CC} ${CFLAGS} -D$d ${INC} -o ${Cexe} ${Csrc}.c ${LIB}"
    +  cc_cmd="${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -D$d ${INC} -o ${Cexe} ${Csrc}.c ${LIB}"
       eval ${cc_cmd} || \
         failure cannot compile ${Csrc}.c
       if test $# -gt 0
    --- a/autoopts/test/library.test
    +++ b/autoopts/test/library.test
    @@ -126,7 +126,7 @@
          return EXIT_SUCCESS; }
        _EOCode_
    
    -${CC} ${CFLAGS} ${INC} -o ${testname} ${testname}-main.c ${testname}-lib.o ${LIB}
    +${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} ${INC} -o ${testname} ${testname}-main.c ${testname}-lib.o ${LIB}
     test $? -eq 0 || failure cannot compile ${testname}-main.c
    
     ./${testname} -c || failure library option not detected
    
     
  • Bruce Korb

    Bruce Korb - 2020-09-15
    • status: accepted --> pending
     
  • Bruce Korb

    Bruce Korb - 2020-09-15

    I've applied your patches, thank you. It rebuilds without problems on my platform, so they'll be included when I get 5.20 pushed out. Thanks again.

     

Log in to post a comment.

MongoDB Logo MongoDB