Opened 2 weeks ago

Last modified 15 hours ago

#62991 new defect

m4 @1.4.19+universal: configure: error: Cannot find a type to use in place of socklen_t

Reported by: FaradayLight (Faraday Light) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: arm64 bigsur Cc: larryv (Lawrence Velázquez)
Port: m4

Description (last modified by larryv (Lawrence Velázquez))

M4 failed to configure reporting the following error:

Error: Failed to configure m4: configure failure: command execution failed

The error is created after performing the following:

sudo port clean m4
sudo port upgrade m4

The error was first detected by running the following:

sudo port upgrade gnutls

Thus gnutls is also affected.

Attachments (5)

config.log (2.9 MB) - added by FaradayLight (Faraday Light) 2 weeks ago.
config.log
main.log (45.4 KB) - added by FaradayLight (Faraday Light) 2 weeks ago.
main.log
config.2.log (2.7 MB) - added by ryanmcgrath (Ryan McGrath) 11 days ago.
Extra debugging logs, if it helps.
main.2.log (50.0 KB) - added by ryanmcgrath (Ryan McGrath) 11 days ago.
main_test.log (1.1 MB) - added by FaradayLight (Faraday Light) 8 days ago.

Change History (35)

Changed 2 weeks ago by FaradayLight (Faraday Light)

Attachment: config.log added

config.log

Changed 2 weeks ago by FaradayLight (Faraday Light)

Attachment: main.log added

main.log

comment:1 Changed 2 weeks ago by FaradayLight (Faraday Light)

From the config.log:

configure:6336: checking whether the compiler is clang
configure:6358: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch arm64 -arch x86_64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk conftest.c >&5                                                                                                                                                                                              
conftest.c:13:12: error: unknown type name 'barfbarf'

comment:2 Changed 2 weeks ago by leavenode

1.4.19 just failed to build on Tiger. 1.4.18 is working fine. gnutls upgraded and installed just fine.

From the build log for 1.4.19

:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/lib'
:info:build depbase=`echo sigsegv.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:build /opt/local/bin/gcc-apple-4.2 -std=gnu99  -I.   -I/opt/local/include  -pipe -Os -arch ppc -MT sigsegv.o -MD -MP -MF $depbase.Tpo -c -o sigsegv.o sigsegv.c &&\
:info:build mv -f $depbase.Tpo $depbase.Po
:info:build sigsegv.c: In function 'sigsegv_handler':
:info:build sigsegv.c:938: error: 'struct mcontext' has no member named '__ss'
:info:build make[3]: *** [sigsegv.o] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/lib'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/lib'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19" && /usr/bin/make -j1 -w all 
:info:build Exit code: 2
:error:build Failed to build m4: command execution failed
:debug:build Error code: CHILDSTATUS 9996 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback 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/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/main.log for details.

comment:3 Changed 2 weeks ago by kencu (Ken)

the Tiger thing is different -- I think I know what will fix that.

comment:4 Changed 2 weeks ago by jmroot (Joshua Root)

Are your Command Line Tools perhaps outdated? See wiki:ProblemHotlist#reinstall-clt

comment:5 Changed 2 weeks ago by FaradayLight (Faraday Light)

Hi, No I checked that the tools where up today and ran the upgrade after a 'clean' to make sure, but I still got the reported error.

I have also since run 'port diagnose' but that has returned a blank.

This is the version number I get from running the check on the CLT receipt: 12.5.0.0.1.1617976050

Last edited 2 weeks ago by FaradayLight (Faraday Light) (previous) (diff)

comment:6 Changed 2 weeks ago by FaradayLight (Faraday Light)

Having said that, I have just run the pkgutil check without the filter and get the following:

tacitus@malory templates_dev % pkgutil --pkg-info=com.apple.pkg.CLTools_Executables --pkg-info=com.apple.pkg.CLTools_Base --pkg-info=com.apple.pkg.DeveloperToolsCLI --pkg-info=com.apple.pkg.DeveloperToolsCLILeo
package-id: com.apple.pkg.CLTools_Executables
version: 12.5.0.0.1.1617976050
volume: /
location: /
install-time: 1622292831
groups: com.apple.FindSystemFiles.pkg-group 

No receipt for 'com.apple.pkg.CLTools_Base' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

I have been installing Xcode updates via App Store.

From - pkgutil --pkgs | grep CL - I get this list:

com.apple.pkg.CLTools_Executables
com.apple.pkg.CLTools_SDK_macOS110
com.apple.pkg.CLTools_SDK_macOS1015
com.apple.pkg.CLTools_macOS_SDK
Last edited 2 weeks ago by FaradayLight (Faraday Light) (previous) (diff)

comment:7 Changed 2 weeks ago by FaradayLight (Faraday Light)

Using the -v switch on another upgrade attempt I get these entries:

checking whether POSIX threads API is available... yes
checking whether setlocale (LC_ALL, NULL) is multithread-safe... no
checking whether setlocale (category, NULL) is multithread-safe... yes
checking whether imported symbols can be declared weak... no
checking host CPU and C ABI... grep: conftest.s: No such file or directory
arm
checking whether C symbols are prefixed with underscore at the linker level... ggrep: conftest.s: No such file or directory
no
checking whether iswblank is declared... no
checking whether iswdigit is ISO C compliant... no
checking whether iswxdigit is ISO C compliant... ./configure: line 38230: test: !=: unary operator expected
./configure: line 38230: test: !=: unary operator expected
guessing yes
checking whether malloc (0) returns nonnull... (cached) no
checking whether mbrtowc handles incomplete characters... ./configure: line 39070: test: !=: unary operator expected
./configure: line 39108: test: !=: unary operator expected
guessing yes
checking whether mbrtowc works as well as mbtowc... guessing yes
checking whether mbrtowc handles a NULL pwc argument... ./configure: line 39267: test: !=: unary operator expected
guessing yes
checking whether mbrtowc handles a NULL string argument... ./configure: line 39340: test: !=: unary operator expected
guessing yes
checking whether mbrtowc has a correct return value... ./configure: line 39403: test: !=: unary operator expected
./configure: line 39403: test: !=: unary operator expected
guessing yes
checking whether mbrtowc returns 0 when parsing a NUL character... guessing yes
checking whether mbrtowc stores incomplete characters... ./configure: line 39662: test: !=: unary operator expected
guessing no
checking whether sleep is declared... no
checking for socklen_t... no
checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19" && ./configure --prefix=/opt/local --disable-dependency-tracking --disable-silent-rules --program-prefix=g --with-packager=MacPorts --with-packager-version="revision 1" --with-packager-bug-reports=https://trac.macports.org/wiki/Tickets ac_cv_libsigsegv=no 
Exit code: 1

comment:8 in reply to:  3 Changed 2 weeks ago by kencu (Ken)

Replying to kencu:

the Tiger thing is different -- I think I know what will fix that.

Off topic but I have Tiger fixed so we can forget about that comment here.

comment:9 Changed 2 weeks ago by FaradayLight (Faraday Light)

There is another machine I have access to:

MacBook Pro 16inch, 2019

macOS 11.4

Xcode 12.5

macOS SDK 20.4

M4 upgraded to 1.4.19 without issue on this machine.

comment:10 Changed 2 weeks ago by jmroot (Joshua Root)

Cc: larryv added

comment:11 Changed 11 days ago by ryanmcgrath (Ryan McGrath)

I experience the same configure errors on a 2020 M1 MBP - macOS 11.4, Xcode 12.5, reinstalled command line tools recently as well.

The inability to install this +universal is a bit of a sticking point as it blocks a number of other packages. I spent some time looking into it but unfortunately have no real clue what's up - it builds and runs fine if I grab the source and jump through the steps myself, though.

Changed 11 days ago by ryanmcgrath (Ryan McGrath)

Attachment: config.2.log added

Extra debugging logs, if it helps.

Changed 11 days ago by ryanmcgrath (Ryan McGrath)

Attachment: main.2.log added

comment:12 in reply to:  11 ; Changed 10 days ago by larryv (Lawrence Velázquez)

Sorry for the trouble, but I have access to neither Big Sur nor an Apple Silicon machine. Do you experience the same issue non-universally (e.g., sudo port clean m4 && sudo port configure m4)?

Replying to ryanmcgrath:

The inability to install this +universal is a bit of a sticking point as it blocks a number of other packages.

What other ports require m4, a port that installs no libraries, to be universal?

comment:13 Changed 10 days ago by larryv (Lawrence Velázquez)

Description: modified (diff)

comment:14 Changed 10 days ago by FaradayLight (Faraday Light)

I am not familiar with the MacPorts platform or tooling so I have been doing a bit reading-up for the weekend. I am also not familiar the the recent changes to m4/autoconf or the macOS Command Line Tools SDK so I could not be definite about it, but descriptions of similar problems elsewhere and a trawl of the logs suggest it it is not M4 itself.

My thinking at the moment is to attempt to remove MacPorts and re-install it and the ports from scratch to see if perhaps something is just out of kilter.

Last edited 10 days ago by FaradayLight (Faraday Light) (previous) (diff)

comment:15 in reply to:  12 Changed 9 days ago by ryanmcgrath (Ryan McGrath)

Replying to larryv:

Sorry for the trouble, but I have access to neither Big Sur nor an Apple Silicon machine. Do you experience the same issue non-universally (e.g., sudo port clean m4 && sudo port configure m4)?

Replying to ryanmcgrath:

The inability to install this +universal is a bit of a sticking point as it blocks a number of other packages.

What other ports require m4, a port that installs no libraries, to be universal?

I can circle back and confirm this, but I was running into this with installing the universal build of curl.

Installing non-universal does work, notably.

comment:16 Changed 9 days ago by kencu (Ken)

"+universal" will get passed to m4 if you try to install something else "+universal" that needs m4.

In that case, "+universal" gets passed up the chain to all the build and lib deps.

It's a difficult-to-anticipate hiccup of the way variants work in macports.

All you can do is install the build-tool-deps first (cmake, m4, etc, etc) and then try to install your port +universal. Usually that will sort things out.

Last edited 9 days ago by kencu (Ken) (previous) (diff)

comment:17 Changed 9 days ago by kencu (Ken)

We could change base to look for "installs_libs no" in a Portfile and if so, ignore "+universal" if it is noted to be passed up from some other build request....

how to do that exactly I have no idea.

"Patches Welcome" :>

Last edited 9 days ago by kencu (Ken) (previous) (diff)

comment:18 Changed 9 days ago by kencu (Ken)

A similar issue can occur with +java and +debug and +docs and similar variants that you often might mean to have apply only to the port you are installing, but it brings those variants in on any dep with that variant as well.

No doubt one can quickly come up with an opposite case where not having this behaviour breaks everything.

Last edited 9 days ago by kencu (Ken) (previous) (diff)

comment:19 Changed 9 days ago by tomio-arisaka (Tomio Arisaka)

I made a patch for M1 Mac.

$ diff -u Portfile.orig Portfile
--- Portfile.orig	2021-05-30 04:56:03.000000000 +0900
+++ Portfile	2021-06-05 02:37:51.000000000 +0900
@@ -1,5 +1,6 @@
 PortSystem		1.0
 PortGroup		clang_dependency 1.0
+PortGroup               muniversal 1.0
 
 name            m4
 version         1.4.19
@@ -33,6 +34,13 @@
     patchfiles-append      patch-m4-use-older-regnames-on-tiger.diff
 }
 
+platform arm {
+    set merger_configure_args(arm64)   --host=aarch64-apple-darwin
+    set merger_configure_args(x86_64)  --host=x86_64-apple-darwin
+    set merger_configure_env(arm64)    CC_FOR_BUILD=${configure.cc}
+    set merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc}
+}
+
 configure.args  --disable-silent-rules \
                 --program-prefix=g \
                 --with-packager=MacPorts \

It works well for me.

MacBook-Pro:~ $ port installed m4
The following ports are currently installed:
  m4 @1.4.19_1
  m4 @1.4.19_1+universal (active)
MacBook-Pro:~ $ 
MacBook-Pro:~ $ file `which m4`
/usr/bin/m4: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/m4 (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/m4 (for architecture arm64e):	Mach-O 64-bit executable arm64e
MacBook-Pro:~ $ 

comment:20 in reply to:  19 Changed 8 days ago by FaradayLight (Faraday Light)

Replying to tomio-arisaka:

I made a patch for M1 Mac.

$ diff -u Portfile.orig Portfile
--- Portfile.orig	2021-05-30 04:56:03.000000000 +0900
+++ Portfile	2021-06-05 02:37:51.000000000 +0900
@@ -1,5 +1,6 @@
 PortSystem		1.0
 PortGroup		clang_dependency 1.0
+PortGroup               muniversal 1.0
 
 name            m4
 version         1.4.19
@@ -33,6 +34,13 @@
     patchfiles-append      patch-m4-use-older-regnames-on-tiger.diff
 }
 
+platform arm {
+    set merger_configure_args(arm64)   --host=aarch64-apple-darwin
+    set merger_configure_args(x86_64)  --host=x86_64-apple-darwin
+    set merger_configure_env(arm64)    CC_FOR_BUILD=${configure.cc}
+    set merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc}
+}
+
 configure.args  --disable-silent-rules \
                 --program-prefix=g \
                 --with-packager=MacPorts \

It works well for me.

MacBook-Pro:~ $ port installed m4
The following ports are currently installed:
  m4 @1.4.19_1
  m4 @1.4.19_1+universal (active)
MacBook-Pro:~ $ 
MacBook-Pro:~ $ file `which m4`
/usr/bin/m4: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/m4 (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/m4 (for architecture arm64e):	Mach-O 64-bit executable arm64e
MacBook-Pro:~ $ 

Hi,

I am not familiar with the process so I may have gotten this wrong somewhere.

I applied above patch after manually stepping through the fetch, checksum, extract, patch steps. The package configured successfully, and proceeded without error through the manual steps of build and destroot, but it failed in test with:

:info:test Checking ./236.improved_f                                                                                                                                                                              
:info:test Checking ./stackovf.test
:info:test Stack soft limit set to 300K
:info:test Pass
:info:test Skipped checks were:
:info:test   ./125.changeword ./126.changeword ./127.changeword ./128.changeword ./129.changeword ./130.changeword
:info:test Failed checks were:
:info:test   ./198.sysval:err
:info:test make[3]: *** [check-local] Error 1
:info:test make[2]: *** [check-am] Error 2
:info:test make[1]: *** [check-recursive] Error 1
:info:test make: *** [check] Error 2
:info:test Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19-arm64" && /usr/bin/make check 
:info:test Exit code: 2
:error:test Failed to test m4: command execution failed
:debug:test Error code: NONE
:debug:test Backtrace: command execution failed
:debug:test     while executing
:debug:test "$procedure $targetname"
:error:test See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/main.log for details.

related to the above:

:info:test Checking ./197.sysval                                                                                                                                                                                  
:info:test Checking ./198.sysval
:info:test @ ../doc/m4.texi:6751: Origin of test
:info:test ./198.sysval: stderr mismatch
:info:test --- m4-tmp.66915/m4-xerr 2021-06-05 21:00:59.000000000 +0100
:info:test +++ m4-tmp.66915/m4-err  2021-06-05 21:00:59.000000000 +0100
:info:test @@ -0,0 +1 @@
:info:test +sh: line 1: 68899 Killed: 9               /bin/sh -c 'kill -9 $$'
:info:test Checking ./199.mkstemp

Please see attached main_test.log

Last edited 8 days ago by FaradayLight (Faraday Light) (previous) (diff)

Changed 8 days ago by FaradayLight (Faraday Light)

Attachment: main_test.log added

comment:21 Changed 7 days ago by FaradayLight (Faraday Light)

M4 still fails the test phase after removal of all ports followed by a reinstall (with the manual patching and installing of M4 as detailed above).

Last edited 7 days ago by FaradayLight (Faraday Light) (previous) (diff)

comment:22 in reply to:  21 ; Changed 7 days ago by larryv (Lawrence Velázquez)

:info:test Checking ./198.sysval
:info:test @ ../doc/m4.texi:6751: Origin of test
:info:test ./198.sysval: stderr mismatch
:info:test --- m4-tmp.66915/m4-xerr	2021-06-05 21:00:59.000000000 +0100
:info:test +++ m4-tmp.66915/m4-err	2021-06-05 21:00:59.000000000 +0100
:info:test @@ -0,0 +1 @@
:info:test +sh: line 1: 68899 Killed: 9               /bin/sh -c 'kill -9 $$'
:info:test Failed checks were:
:info:test   ./198.sysval:err
:info:test make[3]: *** [check-local] Error 1

This is a bug in the test suite. It will be fixed in the next release.

comment:23 in reply to:  22 Changed 7 days ago by FaradayLight (Faraday Light)

Replying to larryv:

:info:test Checking ./198.sysval
:info:test @ ../doc/m4.texi:6751: Origin of test
:info:test ./198.sysval: stderr mismatch
:info:test --- m4-tmp.66915/m4-xerr	2021-06-05 21:00:59.000000000 +0100
:info:test +++ m4-tmp.66915/m4-err	2021-06-05 21:00:59.000000000 +0100
:info:test @@ -0,0 +1 @@
:info:test +sh: line 1: 68899 Killed: 9               /bin/sh -c 'kill -9 $$'
:info:test Failed checks were:
:info:test   ./198.sysval:err
:info:test make[3]: *** [check-local] Error 1

This is a bug in the test suite. It will be fixed in the next release.

Excellent.

Many thanks.

comment:24 in reply to:  12 Changed 7 days ago by FaradayLight (Faraday Light)

Replying to larryv:

Sorry for the trouble, but I have access to neither Big Sur nor an Apple Silicon machine. Do you experience the same issue non-universally (e.g., sudo port clean m4 && sudo port configure m4)?

Replying to ryanmcgrath:

The inability to install this +universal is a bit of a sticking point as it blocks a number of other packages.

What other ports require m4, a port that installs no libraries, to be universal?

Hi, I tested the speck command sequence you suggest, but the package fails to complete the configure phase:

% sudo port clean m4 && sudo port configure m4
Password:
--->  Cleaning m4
--->  Computing dependencies for m4
--->  Fetching distfiles for m4
--->  Verifying checksums for m4
--->  Extracting m4
--->  Configuring m4
Error: Failed to configure m4: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/config.log
Error: Failed to configure m4: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port m4 failed

The patch provided by tomio-arisaka above resolves the immediate installation problem.

Would you be willing to accept and apply tomio-arisaka's patch to the Portfile to resolve this ticket?

comment:25 Changed 7 days ago by kencu (Ken)

Faraday, remove +universal from your variants.conf (and then reinstall all your ports, which will download buildbot versions). Then you will have no, or at least much less, trouble.

Last edited 7 days ago by kencu (Ken) (previous) (diff)

comment:26 Changed 7 days ago by FaradayLight (Faraday Light)

Hi, I have commented out the setting in variants and that has resolved the issues I have been experiencing.

comment:27 Changed 6 days ago by ryanmcgrath (Ryan McGrath)

I wound up just shoving the patched m4 in as a Portfile in my local ports setup, which does work for me as well.

comment:28 in reply to:  27 ; Changed 6 days ago by FaradayLight (Faraday Light)

Replying to ryanmcgrath:

I wound up just shoving the patched m4 in as a Portfile in my local ports setup, which does work for me as well.

Hi, M4 built without the patch on arm64 after commenting-out the +unversal option in the resources.conf; could you check if the setting has been applied in your resources.conf as well?

comment:29 in reply to:  28 Changed 15 hours ago by ryandesign (Ryan Schmidt)

Port: m4 added; M4 removed
Summary: m4 @ 1.4.19+universal Failed to configurem4 @1.4.19+universal: configure: error: Cannot find a type to use in place of socklen_t

The actual error in the log is:

:info:configure checking for socklen_t... no
:info:configure checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t

I feel like we've seen this with tons of other ports. Check other tickets.

Replying to FaradayLight:

Hi, M4 built without the patch on arm64 after commenting-out the +unversal option in the resources.conf; could you check if the setting has been applied in your resources.conf as well?

variants.conf.

comment:30 Changed 15 hours ago by kencu (Ken)

Most likely running the universal build using the muninversal PG as per 62991#comment:19 is going to be the fix here.

Note: See TracTickets for help on using tickets.