Opened 3 years ago

Closed 3 years ago

#61680 closed defect (fixed)

runit @2.1.2: error: implicit declaration of function 'execve' is invalid in C99

Reported by: fgatherlet (fgatherlet) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: catalina bigsur haspatch Cc: jacobvosmaer (Jacob Vosmaer)
Port: runit

Description

I cannot install runit. Maybe because of C99 implicit declaration check.

$ sudo port install runit
--->  Fetching archive for runit
--->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://kmq.jp.packages.macports.org/runit
--->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://packages.macports.org/runit
--->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/runit/runit
--->  Fetching distfiles for runit
--->  Verifying checksums for runit
--->  Extracting runit
--->  Configuring runit
--->  Building runit
Error: Failed to build runit: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port runit failed

main.log is

version:1
:debug:sysinfo macOS 10.15 (darwin/19.6.0) arch i386
:debug:sysinfo MacPorts 2.6.4
:debug:sysinfo Xcode none
:debug:sysinfo SDK 10.15
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.15
:debug:main runit has no conflicts
:debug:main Executing org.macports.main (runit)
:debug:main dropping privileges: euid changed to 502, egid changed to 501.
:debug:archivefetch archivefetch phase started at Fri Nov 27 19:26:30 JST 2020
:msg:archivefetch --->  Fetching archive for runit
:debug:archivefetch Executing org.macports.archivefetch (runit)
:debug:archivefetch euid/egid changed to: 0/0
:debug:archivefetch chowned /opt/local/var/macports/incoming to macports
:debug:archivefetch euid/egid changed to: 502/501
:info:archivefetch --->  runit-2.1.2_0.darwin_19.x86_64.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
:msg:archivefetch --->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://kmq.jp.packages.macports.org/runit
:debug:archivefetch Fetching archive failed: The requested URL returned error: 404 Not Found
:msg:archivefetch --->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://packages.macports.org/runit
:debug:archivefetch Fetching archive failed: The requested URL returned error: 404 
:msg:archivefetch --->  Attempting to fetch runit-2.1.2_0.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/runit/runit
:debug:archivefetch Fetching archive failed: The requested URL returned error: 404 Not Found
:debug:archivefetch Privilege de-escalation not attempted as not running as root.
:debug:fetch fetch phase started at Fri Nov 27 19:26:32 JST 2020
:notice:fetch --->  Fetching distfiles for runit
:debug:fetch Executing org.macports.fetch (runit)
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Fri Nov 27 19:26:32 JST 2020
:notice:checksum --->  Verifying checksums for runit
:debug:checksum Executing org.macports.checksum (runit)
:info:checksum --->  Checksumming runit-2.1.2.tar.gz
:debug:checksum Calculated (rmd160) is cc9535d17e42707a2fb6e9d0a19f19596788ed77
:debug:checksum Correct (rmd160) checksum for runit-2.1.2.tar.gz
:debug:checksum Calculated (sha256) is 6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18
:debug:checksum Correct (sha256) checksum for runit-2.1.2.tar.gz
:debug:checksum Privilege de-escalation not attempted as not running as root.
:debug:extract extract phase started at Fri Nov 27 19:26:32 JST 2020
:notice:extract --->  Extracting runit
:debug:extract Executing org.macports.extract (runit)
:info:extract --->  Extracting runit-2.1.2.tar.gz
:debug:extract setting option extract.args to '/opt/local/var/macports/distfiles/runit/runit-2.1.2.tar.gz'
:debug:extract Environment: 
:debug:extract CC_PRINT_OPTIONS='YES'
:debug:extract CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/.CC_PRINT_OPTIONS'
:debug:extract CPATH='/opt/local/include'
:debug:extract DEVELOPER_DIR='/Library/Developer/CommandLineTools'
:debug:extract LIBRARY_PATH='/opt/local/lib'
:debug:extract MACOSX_DEPLOYMENT_TARGET='10.15'
:debug:extract SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
:info:extract Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/runit/runit-2.1.2.tar.gz' | /usr/bin/tar -xf - 
:debug:extract system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/runit/runit-2.1.2.tar.gz' | /usr/bin/tar -xf - 
:debug:extract euid/egid changed to: 0/0
:debug:extract chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work to macports
:debug:extract euid/egid changed to: 502/501
:debug:extract Privilege de-escalation not attempted as not running as root.
:debug:patch patch phase started at Fri Nov 27 19:26:32 JST 2020
:debug:patch Executing org.macports.patch (runit)
:debug:patch Privilege de-escalation not attempted as not running as root.
:debug:configure configure phase started at Fri Nov 27 19:26:32 JST 2020
:notice:configure --->  Configuring runit
:debug:configure Preferred compilers: clang macports-clang-9.0 macports-clang-8.0 macports-clang-7.0 macports-clang-6.0 macports-clang-5.0
:debug:configure Using compiler 'Xcode Clang'
:debug:configure Executing org.macports.configure (runit)
:debug:configure Privilege de-escalation not attempted as not running as root.
:debug:build build phase started at Fri Nov 27 19:26:32 JST 2020
:notice:build --->  Building runit
:debug:build Executing proc-pre-org.macports.build-build-0
:debug:build system: cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2 && echo 'cc -Xlinker -x' >src/conf-ld
:info:build --->  Patching Makefile: s| -static||g
:debug:build Executing reinplace: /usr/bin/sed {s| -static||g} </opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2/src/Makefile >@file12
:debug:build euid/egid changed to: 0/0
:debug:build chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2/src/Makefile to macports
:debug:build euid/egid changed to: 502/501
:debug:build euid/egid changed to: 0/0
:debug:build setting attributes on /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2/src/Makefile
:debug:build euid/egid changed to: 502/501
:debug:build Executing org.macports.build (runit)
:debug:build Environment: 
:debug:build CC_PRINT_OPTIONS='YES'
:debug:build CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/.CC_PRINT_OPTIONS'
:debug:build CPATH='/opt/local/include'
:debug:build DEVELOPER_DIR='/Library/Developer/CommandLineTools'
:debug:build LIBRARY_PATH='/opt/local/lib'
:debug:build MACOSX_DEPLOYMENT_TARGET='10.15'
:debug:build SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
:info:build Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2" && package/compile 
:debug:build system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2" && package/compile 
:info:build Linking ./src/* into ./compile...
:info:build Compiling everything in ./compile...
:info:build + cd compile
:info:build + exec make
:info:build sh find-systype.sh > systype
:info:build rm -f compile
:info:build sh print-cc.sh > compile
:info:build chmod 555 compile
:info:build rm -f choose
:info:build cat warn-auto.sh choose.sh \
:info:build 	> choose
:info:build chmod 555 choose
:info:build ./choose c trydrent direntry.h1 direntry.h2 > direntry.h
:info:build rm -f load
:info:build sh print-ld.sh > load
:info:build chmod 555 load
:info:build ./choose cl tryflock hasflock.h1 hasflock.h2 > hasflock.h
:info:build ./choose cl trymkffo hasmkffo.h1 hasmkffo.h2 > hasmkffo.h
:info:build ./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h
:info:build ./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h
:info:build ./compile chkshsgr.c
:info:build chkshsgr.c:10:19: warning: incompatible pointer types passing 'short [4]' to parameter of type 'gid_t *' (aka 'unsigned int *') [-Wincompatible-pointer-types]
:info:build   if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
:info:build                   ^
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:456:27: note: passing argument to parameter here
:info:build int      getgroups(int, gid_t []);
:info:build                               ^
:info:build chkshsgr.c:10:44: warning: incompatible pointer types passing 'short [4]' to parameter of type 'const gid_t *' (aka 'const unsigned int *') [-Wincompatible-pointer-types]
:info:build   if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
:info:build                                            ^
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:715:34: note: passing argument to parameter here
:info:build int      setgroups(int, const gid_t *);
:info:build                                      ^
:info:build 2 warnings generated.
:info:build ./load chkshsgr 
:info:build ./chkshsgr || ( cat warn-shsgr; exit 1 )
:info:build ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
:info:build ./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h
:info:build ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
:info:build ./choose c trysysel select.h1 select.h2 > select.h
:info:build ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
:info:build ./choose c tryreboot reboot_system.h1 reboot_system.h2 > \
:info:build 	  reboot_system.h
:info:build ( ./compile tryuwtmpx.c 2>/dev/null && cat uw_tmp.h2 >uw_tmp.h ) || \
:info:build 	( ./compile tryuwtmp.c 2>/dev/null && cat uw_tmp.h1 >uw_tmp.h )
:info:build rm -f tryuwtmp.o tryuwtmpx.o
:info:build ./compile trysocketlib.c
:info:build ( ./load trysocketlib >/dev/null 2>&1 || \
:info:build 	  ( ./load trysocketlib -lxnet >/dev/null 2>&1 && echo '-lxnet' ) || \
:info:build 	  ( ./load trysocketlib -lsocket -lnsl >/dev/null 2>&1 && \
:info:build 	    echo '-lsocket -lnsl' ) \
:info:build 	) >socket.lib
:info:build rm -f trysocketlib.o trysocketlib
:info:build rm -f sysdeps
:info:build cat systype compile load socket.lib >>sysdeps
:info:build grep sysdep direntry.h >>sysdeps
:info:build grep sysdep haswaitp.h >>sysdeps
:info:build grep sysdep hassgact.h >>sysdeps
:info:build grep sysdep hassgprm.h >>sysdeps
:info:build grep sysdep select.h >>sysdeps
:info:build grep sysdep uint64.h >>sysdeps
:info:build grep sysdep iopause.h >>sysdeps
:info:build grep sysdep hasmkffo.h >>sysdeps
:info:build grep sysdep hasflock.h >>sysdeps
:info:build grep sysdep hasshsgr.h >>sysdeps
:info:build grep sysdep reboot_system.h >>sysdeps
:info:build grep sysdep uw_tmp.h >>sysdeps
:info:build cat sysdeps
:info:build darwin-19.6.0-darwin.kernel.version.19.6.0..thu.oct.29.22.56.45.pdt.2020;.root.xnu-6153.141.2.2~1.release_x86_64-:i386-:-:x86_64-:-
:info:build #!/bin/sh
:info:build # WARNING: This file was auto-generated. Do not edit!
:info:build exec gcc -O2 -Wall -c ${1+"$@"}
:info:build #!/bin/sh
:info:build # WARNING: This file was auto-generated. Do not edit!
:info:build main="$1"; shift
:info:build exec cc -Xlinker -x -o "$main" "$main".o ${1+"$@"}
:info:build /* sysdep: +dirent */
:info:build /* sysdep: +waitpid */
:info:build /* sysdep: +sigaction */
:info:build /* sysdep: +sigprocmask */
:info:build /* sysdep: +sysselect */
:info:build /* sysdep: -ulong64 */
:info:build /* sysdep: -poll */
:info:build /* sysdep: +mkfifo */
:info:build /* sysdep: +flock */
:info:build /* sysdep: -shortsetgroups */
:info:build /* sysdep: +std reboot */
:info:build /* sysdep: -utmpx */
:info:build ./compile chpst.c
:info:build chpst.c:311:33: warning: unsequenced modification and access to 'subgetoptarg' [-Wunsequenced]
:info:build           if (optarg[scan_ulong(++optarg, &ul)]) usage(); nicelvl =ul;
:info:build               ~~~~~~            ^
:info:build 1 warning generated.
:info:build ./compile uidgid.c
:info:build ./compile alloc.c
:info:build ./compile alloc_re.c
:info:build ./compile buffer.c
:info:build ./compile buffer_0.c
:info:build ./compile buffer_1.c
:info:build ./compile buffer_2.c
:info:build ./compile buffer_get.c
:info:build ./compile buffer_put.c
:info:build buffer_put.c:18:17: warning: if statement has empty body [-Wempty-body]
:info:build     if (w == 0) ; /* luser's fault */
:info:build                 ^
:info:build buffer_put.c:18:17: note: put the semicolon on a separate line to silence this warning
:info:build 1 warning generated.
:info:build ./compile buffer_read.c
:info:build ./compile buffer_write.c
:info:build ./compile coe.c
:info:build ./compile env.c
:info:build ./compile error.c
:info:build ./compile error_str.c
:info:build ./compile fd_copy.c
:info:build ./compile fd_move.c
:info:build ./compile fifo.c
:info:build ./compile lock_ex.c
:info:build ./compile lock_exnb.c
:info:build rm -f makelib
:info:build sh print-ar.sh > makelib
:info:build chmod 555 makelib
:info:build ./compile ndelay_off.c
:info:build ./compile ndelay_on.c
:info:build ./compile open_append.c
:info:build ./compile open_read.c
:info:build ./compile open_trunc.c
:info:build ./compile open_write.c
:info:build ./compile openreadclose.c
:info:build ./compile pathexec_env.c
:info:build ./compile pathexec_run.c
:info:build pathexec_run.c:18:5: error: implicit declaration of function 'execve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build     execve(file,argv,envp);
:info:build     ^
:info:build pathexec_run.c:35:5: error: implicit declaration of function 'execve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build     execve(tmp.s,argv,envp);
:info:build     ^
:info:build 2 errors generated.
:info:build make: *** [pathexec_run.o] Error 1
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/work/admin/runit-2.1.2" && package/compile 
:info:build Exit code: 2
:error:build Failed to build runit: command execution failed
:debug:build Error code: CHILDSTATUS 77132 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/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_runit/runit/main.log for details.

Change History (3)

comment:1 in reply to:  description Changed 3 years ago by jacobvosmaer (Jacob Vosmaer)

This patch works for me:

diff --git src/pathexec_run.c src/pathexec_run.c
index 1770ac7..70ac7a8 100644
--- src/pathexec_run.c
+++ src/pathexec_run.c
@@ -1,5 +1,6 @@
 /* Public domain. */
 
+#include <unistd.h>
 #include "error.h"
 #include "stralloc.h"
 #include "str.h"
diff --git src/prot.c src/prot.c
index 79a88c5..139dac3 100644
--- src/prot.c
+++ src/prot.c
@@ -1,5 +1,6 @@
 /* Public domain. */
 
+#include <unistd.h>
 #include "hasshsgr.h"
 #include "prot.h"
 
diff --git src/seek_set.c src/seek_set.c
index 19b8265..a1a36d0 100644
--- src/seek_set.c
+++ src/seek_set.c
@@ -1,6 +1,7 @@
 /* Public domain. */
 
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define SET 0 /* sigh */

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jacobvosmaer added
Keywords: bigsur haspatch added
Owner: set to ryandesign
Status: newaccepted

Thanks for the patch!

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 841ca477424cac003a602291b54e27cca1379d0a/macports-ports (master):

runit: Fix implicit declaration of functions

Closes: #61680

Also add size to checksums, use MacPorts flags, add universal variant,
don't compress manpages manually because MacPorts does so automatically,
and use notes instead of post-install ui_msg.

Note: See TracTickets for help on using tickets.