Opened 8 months ago

Last modified 8 months ago

#64628 new defect

gnutls @3.6.16_3+dane+guile: compilation of guile objects fails

Reported by: cooljeanius (Eric Gallager) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: ryandesign (Ryan Schmidt), Schamschula (Marius Schamschula)
Port: gnutls

Description

I'm trying to upgrade from gnutls @3.6.16_2+dane+guile to gnutls @3.6.16_3+dane+guile and am experiencing this error:

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile'
/opt/local/bin/gmkdir -p "`dirname "modules/gnutls.scm"`" ; cat "modules/gnutls.in" |		\
	  /opt/local/bin/gsed -e's|[@]maybe_guileextensiondir[@]||g' \
	  > "modules/gnutls.scm.tmp"
mv "modules/gnutls.scm.tmp" "modules/gnutls.scm"
/opt/local/bin/gmkdir -p "`dirname "modules/gnutls.go"`" ;			\
	: && out=1 || out=- ;					\
	unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C			\
	GUILE_AUTO_COMPILE=0 		\
	GNUTLS_GUILE_EXTENSION_DIR="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src"	\
	/opt/local/bin/guild compile --target="x86_64-apple-darwin20"				\
	  -L "../guile/modules"				\
	  -L "../guile/modules"				\
	  -Wformat -Wunbound-variable -Warity-mismatch			\
	  -o "modules/gnutls.go" "modules/gnutls.scm" >&$out
/opt/local/bin/gmkdir -p "`dirname "modules/gnutls/extra.go"`" ;			\
	: && out=1 || out=- ;					\
	unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C			\
	GUILE_AUTO_COMPILE=0 		\
	GNUTLS_GUILE_EXTENSION_DIR="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src"	\
	/opt/local/bin/guild compile --target="x86_64-apple-darwin20"				\
	  -L "../guile/modules"				\
	  -L "../guile/modules"				\
	  -Wformat -Wunbound-variable -Warity-mismatch			\
	  -o "modules/gnutls/extra.go" "modules/gnutls/extra.scm" >&$out
Backtrace:
In ice-9/boot-9.scm:
    705:2 19 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8 18 (_ #(#(#<directory (guile-user) 101271140>)))
    155:9 17 (_ _)
In srfi/srfi-1.scm:
    640:9 16 (for-each #<procedure 1017d7a40 at scripts/compile.scm:261:14 (file)> ("modules/gnutls.scm"))
In scripts/compile.scm:
   264:26 15 (_ _)
In system/base/target.scm:
     57:6 14 (with-target _ _)
In system/base/compile.scm:
    152:6 13 (compile-file _ #:output-file _ #:from _ #:to _ #:env _ #:opts _ #:canonicalization _)
     43:4 12 (call-once _)
In ice-9/boot-9.scm:
    841:4 11 (with-throw-handler _ _ _)
In system/base/compile.scm:
    59:11 10 (_)
   155:11  9 (_ #<closed: file 101498850>)
   235:18  8 (read-and-compile #<input: gnutls.scm 25> #:from _ #:to _ #:env _ #:opts _)
   183:32  7 (compile-fold (#<procedure compile-tree-il (x e opts)>) (eval-when (expand load eval) (define %libdir (or (getenv "GNUTLS_GUILE_EXTENSION_DIR"))) (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING") (load-extension (if %libdir (?) #) #))) # #)
In ice-9/boot-9.scm:
   2312:4  6 (save-module-excursion #<procedure 101842e00 at language/scheme/compile-tree-il.scm:29:3 ()>)
In language/scheme/compile-tree-il.scm:
    31:15  5 (_)
In ice-9/psyntax.scm:
  1262:36  4 (expand-top-sequence ((eval-when (expand load eval) (define %libdir (or (getenv "GNUTLS_GUILE_EXTENSION_DIR"))) (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING") (load-extension (if %libdir (string-append %libdir "/guile-gn?") #) #)))) _ ?)
  1209:24  3 (parse _ (("placeholder" placeholder)) ((top) #(ribcage (%libdir) ((top)) (((hygiene gnutls) . #<syntax %libdir>)))) _ c (compile load eval) (hygiene gnutls))
   285:10  2 (parse _ (("placeholder" placeholder)) ((top) #(ribcage (%libdir) ((top)) (((hygiene gnutls) . #<syntax %libdir>)))) _ c&e (compile load) (hygiene gnutls))
In unknown file:
           1 (load-extension "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src/guile-gnutls-v-2" "scm_init_gnutls")
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
In procedure dynamic-link: file: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src/guile-gnutls-v-2", message: "file not found"
make[3]: *** [modules/gnutls.go] Error 1
make[3]: *** Waiting for unfinished jobs....
Backtrace:
In ice-9/psyntax.scm:
   285:10 19 (parse _ (("placeholder" placeholder)) (()) _ c&e (compile load) (hygiene #{ g77}#))
In ice-9/eval.scm:
   293:34 18 (_ #<module (#{ g77}#) 1084400a0>)
In ice-9/boot-9.scm:
   2874:4 17 (define-module* _ #:filename _ #:pure _ #:version _ #:imports _ #:exports _ #:replacements _ #:re-exports _ #:autoloads _ #:duplicates _ #:transformer _)
  2071:24 16 (call-with-deferred-observers _)
  2887:24 15 (_)
   222:17 14 (map1 (((gnutls))))
  2800:17 13 (resolve-interface (gnutls) #:select _ #:hide _ #:prefix _ #:renamer _ #:version _)
In ice-9/threads.scm:
    390:8 12 (_ _)
In ice-9/boot-9.scm:
  2726:13 11 (_)
In ice-9/threads.scm:
    390:8 10 (_ _)
In ice-9/boot-9.scm:
  2994:20  9 (_)
   2312:4  8 (save-module-excursion _)
  3014:26  7 (_)
In unknown file:
           6 (primitive-load-path "gnutls" #<procedure 10931f3a0 at ice-9/boot-9.scm:3001:37 ()>)
In ice-9/eval.scm:
   721:20  5 (primitive-eval (eval-when (expand load eval) (define %libdir (or (getenv "GNUTLS_GUILE_EXTENSION_DIR"))) (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING") (load-extension (if %libdir (string-append %libdir "/guile-gnutls-v-2") #) #))))
In ice-9/psyntax.scm:
  1262:36  4 (expand-top-sequence ((eval-when (expand load eval) (define %libdir (or (getenv "GNUTLS_GUILE_EXTENSION_DIR"))) (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING") (load-extension (if %libdir (string-append %libdir "/guile-gn?") #) #)))) _ ?)
  1209:24  3 (parse _ (("placeholder" placeholder)) ((top) #(ribcage (%libdir) ((top)) (((hygiene gnutls) . #<syntax %libdir>)))) _ e (eval) (hygiene gnutls))
   285:10  2 (parse _ (("placeholder" placeholder)) ((top) #(ribcage (%libdir) ((top)) (((hygiene gnutls) . #<syntax %libdir>)))) _ c&e (eval) (hygiene gnutls))
In unknown file:
           1 (load-extension "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src/guile-gnutls-v-2" "scm_init_gnutls")
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
In procedure dynamic-link: file: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src/guile-gnutls-v-2", message: "file not found"
make[3]: *** [modules/gnutls/extra.go] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16" && /usr/bin/make -j16 -w all 
Exit code: 2
Error: Failed to build gnutls: command execution failed
DEBUG: Error code: CHILDSTATUS 96710 2

I'll attach the full log next.

Attachments (1)

gnutls-main.log (6.5 MB) - added by cooljeanius (Eric Gallager) 8 months ago.
main.log for gnutls

Change History (8)

Changed 8 months ago by cooljeanius (Eric Gallager)

Attachment: gnutls-main.log added

main.log for gnutls

comment:1 Changed 8 months ago by Schamschula (Marius Schamschula)

Cc: ryandesign added

The +guile variant has been an issue for quite some time. I don't build it myself for that very reason.

Ryan made the guile specific change that caused the latest revision bump in [35edbee0b1af40d247ba890d562722af5843406c/macports-ports].

Last edited 8 months ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:2 Changed 8 months ago by ryandesign (Ryan Schmidt)

gnutls @3.6.16_2+guile and earlier did not actually use guile if you were compiling with clang from Xcode 12 and later. [35edbee0b1af40d247ba890d562722af5843406c/macports-ports] correctly fixed that problem: gnutls @3.6.16_3+guile and later will now actually try to use guile. It builds fine for me with the +guile variant on macOS 10.15.7 with Xcode 12.4.

I see that the reporter here is using macOS 11.6.2 with Xcode 13.2.1 and is also using the +dane variant. Building with +guile and +dane variants still works for me on macOS 10.15.7.

The relevant error in the log seems to me to be:

:info:build In procedure dynamic-link: file: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gnutls/gnutls/work/gnutls-3.6.16/guile/src/guile-gnutls-v-2", message: "file not found"

This "file not found" when trying to load guile-gnutls-v-2 was mentioned elsewhere as well, for example https://lists.gnupg.org/pipermail/gnutls-devel/2018-March/008552.html. There it says:

In particular, libltdl sometimes erroneously reports “file not found” when the problem is something else (unresolved symbol, etc.)

This made me wonder if we we're looking at another instance of the well-known macOS 11+ libtool bug with undefined symbols. However, I was unable to reproduce the issue on another machine with macOS 11.6.3 and Xcode 12.5, so that doesn't seem like a likely cause.

My machines only have 8 processors; the log here is using 16 parallel jobs. Maybe that is relevant? Eric, please try continuing the build with parallel building disabled:

sudo port upgrade gnutls build.jobs=1

comment:3 in reply to:  2 Changed 8 months ago by cooljeanius (Eric Gallager)

Replying to ryandesign:

My machines only have 8 processors; the log here is using 16 parallel jobs. Maybe that is relevant? Eric, please try continuing the build with parallel building disabled:

sudo port upgrade gnutls build.jobs=1

OK, I tried this, but still get the same error...

comment:4 Changed 8 months ago by ryandesign (Ryan Schmidt)

Alright, so it's not a parallel build problem.

Does the problem persist if you clean and try again in trace mode?

sudo port clean gnutls
sudo port -t upgrade gnutls

There are a handful of differences between your configure output and mine. Maybe one of these is responsible. Yours finds a number of things that mine doesn't:

:info:configure checking valgrind/memcheck.h usability... yes
:info:configure checking valgrind/memcheck.h presence... yes
:info:configure checking for valgrind/memcheck.h... yes
:info:configure checking for libev... yes
:info:configure checking how to link with libev... -lev
:info:configure checking for CMOCKA... yes

Using trace mode should hide all these undeclared dependencies.

comment:5 Changed 8 months ago by cooljeanius (Eric Gallager)

Trace mode doesn't fix it, either... here are my hidden files reports:

Configure step:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/ar
  /opt/local/bin/bash
  /opt/local/bin/bison
  /opt/local/bin/ggrep
  /opt/local/bin/gmkdir
  /opt/local/bin/gsed
  /opt/local/bin/lipo
  /opt/local/bin/nm
  /opt/local/bin/nmedit
  /opt/local/bin/otool
  /opt/local/bin/ranlib
  /opt/local/bin/strip
  /opt/local/include/Block.h
  /opt/local/include/ev.h
  /opt/local/include/valgrind/memcheck.h
  /opt/local/lib/libev.a
  /opt/local/lib/libev.dylib
  /opt/local/lib/libunwind.dylib
  /opt/local/lib/pkgconfig/cmocka.pc
  /opt/local/lib/pkgconfig/glib-2.0.pc
  /opt/local/lib/pkgconfig/gobject-2.0.pc
  /private/var/select/sh

Build step:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/ar
  /opt/local/bin/gzip
  /opt/local/bin/lipo
  /opt/local/bin/ranlib
  /opt/local/include/Block.h
  /opt/local/lib/libunwind.dylib
  /private/var/select/sh

comment:6 Changed 8 months ago by ryandesign (Ryan Schmidt)

I can confirm this problem on macOS Monterey x86_64 using the Xcode 13.2 command line tools. At this point I would probably report the problem to the developers of gnutls (or guile?) since the incompatibility with Xcode 13.x is probably something they'll have to resolve.

comment:7 in reply to:  6 Changed 8 months ago by cooljeanius (Eric Gallager)

Replying to ryandesign:

I can confirm this problem on macOS Monterey x86_64 using the Xcode 13.2 command line tools. At this point I would probably report the problem to the developers of gnutls (or guile?) since the incompatibility with Xcode 13.x is probably something they'll have to resolve.

OK, I opened this bug: https://gitlab.com/gnutls/gnutls/-/issues/1322

Note: See TracTickets for help on using tickets.