macOS PowerPC and 10.5 x86: Regression: CMake 3.28 fails at configure with some ports conditional on env PATH: `Can't fork a new process to execute (Resource temporarily unavailable)`
UPD 2024.01.08. It seems that the problem is caused by environment variables during configure stage: specifically, if the PATH has /opt/local/sbin
or even /opt/local/abcd
(pointing to non-existing folder) prior to system directories, CMake fails to work correctly. If the PATH does not have /opt/local/sbin
or it is placed after system directories, CMake works correctly.
Notice, having /opt/local/bin
in front works perfectly fine.
Contents of /opt/local/sbin
is inconsequential: even if it is empty, the error persists, conditional on the PATH being set as described.
Outcomes so far are reproducible locally with no deviations, and do not depend on Macports build system (i.e., running CMake manually succeeds or fails depending on the PATH). See below for details and logs.
Could someone please help with addressing this?
Something has broken down in 3.28.x branch, since this error did not occur with any of the earlier versions (I have 3.24 and 3.27 installed, both work fine, everything else being identical).
The problem shows up only with a few select ports: so far, c-ares
and libical
. AFAICT, however, it is clearly a CMake issue, since earlier versions build named ports with no problem.
The errors happen at configure stage, and look like this:
-- Looking for include file assert.h
-- Looking for include file assert.h - not found
-- Looking for include file errno.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_c4da1/fast
-- Looking for include file errno.h - not found
-- Looking for include file fcntl.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_c671c/fast
-- Looking for include file fcntl.h - not found
-- Looking for include file inttypes.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_328ec/fast
-- Looking for include file inttypes.h - not found
-- Looking for include file limits.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_c3809/fast
-- Looking for include file limits.h - not found
-- Looking for include file malloc.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_8370c/fast
-- Looking for include file malloc.h - not found
-- Looking for include file memory.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_8a69d/fast
-- Looking for include file memory.h - not found
-- Looking for include file netdb.h
-- Looking for include file netdb.h - not found
-- Looking for include file netinet/in.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_1960f/fast
-- Looking for include file netinet/in.h - not found
-- Looking for include file net/if.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_d2bb0/fast
-- Looking for include file net/if.h - not found
-- Looking for include file signal.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_9bfbd/fast
-- Looking for include file signal.h - not found
-- Looking for include file socket.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_d127a/fast
-- Looking for include file socket.h - not found
-- Looking for include file stdbool.h
CMake Error: Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_57d80/fast
-- Looking for include file stdbool.h - not found
CMake log has the following:
kind: "try_compile-v1"
backtrace:
- "/opt/local/share/cmake-3.28/Modules/CheckIncludeFiles.cmake:132 (try_compile)"
- "CMakeLists.txt:195 (CHECK_INCLUDE_FILES)"
checks:
- "Looking for include file assert.h"
directories:
source: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-4WB5tV"
binary: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-4WB5tV"
cmakeVariables:
CMAKE_C_FLAGS: "-pipe -Os -DNDEBUG -I/opt/local/include -Wall -Wextra -Wcast-align -Wconversion -Wdeclaration-after-statement -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunused -Wvariadic-macros -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Qunused-arguments"
CMAKE_EXE_LINKER_FLAGS: "-L/opt/local/lib -Wl,-headerpad_max_install_names"
CMAKE_MODULE_PATH: "/opt/local/share/cmake/Modules;/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/c-ares-1.21.0/cmake/"
CMAKE_OSX_ARCHITECTURES: "ppc"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.6"
CMAKE_OSX_SYSROOT: "/"
CMAKE_WARN_DEPRECATED: "FALSE"
buildResult:
variable: "HAVE_ASSERT_H"
cached: true
stdout: |
Change Dir: '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-4WB5tV'
Run Build Command(s): /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_73ded/fast
/usr/bin/make -f CMakeFiles/cmTC_73ded.dir/build.make CMakeFiles/cmTC_73ded.dir/build
make: posix_spawn: /usr/bin/make: Resource temporarily unavailable
exitCode: 2
-
kind: "try_compile-v1"
backtrace:
- "/opt/local/share/cmake-3.28/Modules/CheckIncludeFiles.cmake:132 (try_compile)"
- "CMakeLists.txt:196 (CHECK_INCLUDE_FILES)"
checks:
- "Looking for include file errno.h"
directories:
source: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-A8w3xO"
binary: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-A8w3xO"
cmakeVariables:
CMAKE_C_FLAGS: "-pipe -Os -DNDEBUG -I/opt/local/include -Wall -Wextra -Wcast-align -Wconversion -Wdeclaration-after-statement -Wfloat-equal -Wformat-security -Winit-self -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-overflow -Wstrict-prototypes -Wundef -Wunused -Wvariadic-macros -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Qunused-arguments"
CMAKE_EXE_LINKER_FLAGS: "-L/opt/local/lib -Wl,-headerpad_max_install_names"
CMAKE_MODULE_PATH: "/opt/local/share/cmake/Modules;/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/c-ares-1.21.0/cmake/"
CMAKE_OSX_ARCHITECTURES: "ppc"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.6"
CMAKE_OSX_SYSROOT: "/"
CMAKE_WARN_DEPRECATED: "FALSE"
buildResult:
variable: "HAVE_ERRNO_H"
cached: true
stdout: |
Change Dir: '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/build/CMakeFiles/CMakeScratch/TryCompile-A8w3xO'
Run Build Command(s): /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_68d2c/fast
resource temporarily unavailable
Generator: execution of make failed. Make command was: /opt/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_68d2c/fast
exitCode: 1
-
This is not a compiler problem (happened both with up-to-date gcc-13
and old Apple gcc-4.2
), since the only scenario to get the breakage is with CMake 3.28. Same compilers, same versions, everything identical, but with CMake 3.27 or earlier – everything works fine.
P. S. Before someone says that old macOS is not supported – this is not a request for some feature or specific support, but merely to fix a regression. I do not know if it currently shows up on other platforms, but potentially it can; and it is desirable to have a healthy code. Whether supported officially or not, CMake has been working on every macOS from 10.5+ very reliably – until 3.28.