Search code examples
macportsgnutls

Failed to build gnutls (MacPorts on 10.15)


So I need to install some ports and gnutls appears as one dependency. However no matter what I do it always fails to build without me understanding why it is so. I'm an occasional user of MacPorts (I mainly follow the instructions so I can build other things) and I'm certainly not aware of all the edge cases.

This is the end of the log where it seems that it needs some files that are missing.

:info:build In file included from gost/gosthash94.c:42:
:info:build gost/nettle-write.h:40:10: fatal error: 'nettle/nettle-stdint.h' file not found
:info:build #include <nettle/nettle-stdint.h>
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build 1 error generated.
:info:build In file included from gost/gost28147.c:40:
:info:build gost/nettle-write.h:40:10: fatal error: 'nettle/nettle-stdint.h' file not found
:info:build #include <nettle/nettle-stdint.h>
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build make[4]: *** [gost/gosthash94.lo] Error 1
:info:build make[4]: *** Waiting for unfinished jobs....
:info:build In file included from gost/streebog.c:46:
:info:build gost/nettle-write.h:40:10: fatal error: 'nettle/nettle-stdint.h' file not found
:info:build #include <nettle/nettle-stdint.h>
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build 1 error generated.
:info:build make[4]: *** [gost/streebog.lo] Error 1
:info:build 1 error generated.
:info:build make[4]: *** [gost/gost28147.lo] Error 1
:info:build make[4]: Leaving directory `/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6/lib/nettle'
:info:build make[3]: *** [all-recursive] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6/lib'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6/lib'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_seb_ports_devel_gnutls/gnutls/work/gnutls-3.6.6" && /usr/bin/make -j8 -w all 
:info:build Exit code: 2
:error:build Failed to build gnutls: command execution failed
:debug:build Error code: CHILDSTATUS 1742 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_Users_seb_ports_devel_gnutls/gnutls/main.log for details.

Also I'm not sure why when I port search gnutls I end up with 3 ports but notably these 2 :

gnutls @3.6.6 (devel, security)
    GNU Transport Layer Security Library

gnutls @3.6.11.1 (devel, security)
    GNU Transport Layer Security Library

It seems that port install gnutls is trying to install 3.6.6 but why since it seems 3.6.11 is more recent ? Trying

$ sudo port install gnutls @3.6.11.1
Warning: cltversion: The Command Line Tools are installed, but MacPorts cannot determine the version.
Warning: cltversion: For a possible fix, please see: https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
--->  Computing dependencies for gnutls
--->  Building gnutls
Error: Failed to build gnutls: command execution failed
Error: See /opt/local/var/macports/logs/_Users_seb_ports_devel_gnutls/gnutls/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gnutls failed

ends up the same way.

selfupdate and upgrade outdated seem to work as excepted:

$ sudo port selfupdate
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.6.2 installed,
MacPorts base version 2.6.2 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
$ sudo port upgrade outdated
Nothing to upgrade.
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

Sorry if this is a trivial for some, but I'd appreciate some guidance in order to solve this one. Thanks ahead of time for your support, and I'm happy to provide more information if needed.


Solution

  • So I found that one can update manually a port that is falling behind the currently-available version. I followed the instructions here and everything is now in order.