Opened 3 months ago

Closed 3 months ago

#70577 closed defect (fixed)

nnn includes a non-existing header: fatal error: sys/_types/_timespec.h: No such file or directory

Reported by: barracuda156 Owned by: Sergey Fedorov <barracuda@…>
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: nnn

Description

Upstream issue: https://github.com/jarun/nnn/issues/1920

--->  Building nnn
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/nnn-4.9" && /usr/bin/make -j6 -w all CFLAGS_OPTIMIZATION="" O_PCRE=1 CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/cc/opt/local/bin/gcc-mp-14" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/cxx/opt/local/bin/g++-mp-14" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/objc/opt/local/bin/gcc-mp-14" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/objcxx/opt/local/bin/g++-mp-14" FC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/fc/opt/local/bin/gfortran-mp-14" F77="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/f77/opt/local/bin/gfortran-mp-14" F90="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/f90/opt/local/bin/gfortran-mp-14" INSTALL="/usr/bin/install -c" 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/nnn-4.9'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nnn/nnn/work/compwrap/cc/opt/local/bin/gcc-mp-14 -I/opt/local/include -I/opt/local/include/LegacySupport -DPCRE -DMACOS_BELOW_1012 -Os -I/opt/local/include/LegacySupport -arch ppc -std=c11 -Wall -Wextra -Wshadow  -D_DARWIN_C_SOURCE -DNCURSES_WIDECHAR -L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport -arch ppc -o nnn misc/macos-legacy/mach_gettime.c src/nnn.c -lreadline -lpcre -L/opt/local/lib -Wl,-search_paths_first -lncurses -lpthread
In file included from misc/macos-legacy/mach_gettime.c:1:
misc/macos-legacy/mach_gettime.h:5:10: fatal error: sys/_types/_timespec.h: No such file or directory
    5 | #include <sys/_types/_timespec.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from src/nnn.c:112:
src/../misc/macos-legacy/mach_gettime.h:5:10: fatal error: sys/_types/_timespec.h: No such file or directory
    5 | #include <sys/_types/_timespec.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [nnn] Error 1

Change History (3)

comment:1 Changed 3 months ago by barracuda156

The correct header may be sys/stat.h, but it does not save us, since there is a conflict between nnn fallback for clock_gettime and legacysupport.

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_nnn/nnn/work/compwrap/cc/opt/local/bin/gcc-mp-14 -isystem/opt/local/include/LegacySupport -I/opt/local/include -DPCRE -DMACOS_BELOW_1012 -Os -arch ppc -std=c11 -Wall -Wextra -Wshadow  -D_DARWIN_C_SOURCE -DNCURSES_WIDECHAR -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch ppc -o nnn misc/macos-legacy/mach_gettime.c src/nnn.c -lreadline -lpcre -L/opt/local/lib -Wl,-search_paths_first -lncurses -lpthread
In file included from src/nnn.c:112:
src/../misc/macos-legacy/mach_gettime.h:14:9: warning: "CLOCK_REALTIME" redefined
   14 | #define CLOCK_REALTIME CALENDAR_CLOCK
      |         ^~~~~~~~~~~~~~
In file included from /usr/include/sys/time.h:197,
                 from /opt/local/include/LegacySupport/sys/time.h:27,
                 from src/nnn.c:52:
/opt/local/include/LegacySupport/time.h:59:9: note: this is the location of the previous definition
   59 | #define CLOCK_REALTIME _CLOCK_REALTIME
      |         ^~~~~~~~~~~~~~
src/../misc/macos-legacy/mach_gettime.h:15:9: warning: "CLOCK_MONOTONIC" redefined
   15 | #define CLOCK_MONOTONIC SYSTEM_CLOCK
      |         ^~~~~~~~~~~~~~~
/opt/local/include/LegacySupport/time.h:61:9: note: this is the location of the previous definition
   61 | #define CLOCK_MONOTONIC _CLOCK_MONOTONIC
      |         ^~~~~~~~~~~~~~~
src/../misc/macos-legacy/mach_gettime.h:17:13: error: conflicting types for 'clockid_t'; have 'int'
   17 | typedef int clockid_t;
      |             ^~~~~~~~~
/opt/local/include/LegacySupport/time.h:76:3: note: previous declaration of 'clockid_t' with type 'clockid_t'
   76 | } clockid_t;
      |   ^~~~~~~~~
src/../misc/macos-legacy/mach_gettime.h:21:8: error: redefinition of 'struct timespec'
   21 | struct timespec { time_t tv_sec; long tv_nsec; };
      |        ^~~~~~~~
In file included from /usr/include/sys/stat.h:79,
                 from /opt/local/include/LegacySupport/sys/stat.h:27,
                 from src/nnn.c:47:
/usr/include/sys/_structs.h:88:1: note: originally defined here
   88 | _STRUCT_TIMESPEC
      | ^~~~~~~~~~~~~~~~
src/../misc/macos-legacy/mach_gettime.h:23:5: error: conflicting types for 'clock_gettime'; have 'int(int,  struct timespec *)'
   23 | int clock_gettime(clockid_t clk_id, struct timespec *tp);
      |     ^~~~~~~~~~~~~
/opt/local/include/LegacySupport/time.h:80:12: note: previous declaration of 'clock_gettime' with type 'int(clockid_t,  struct timespec *)'
   80 | extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
      |            ^~~~~~~~~~~~~
src/nnn.c: In function 'invertselbuf':
src/nnn.c:1830:58: warning: operand of '?:' changes signedness from 'int' to 'uint_t' {aka 'unsigned int'} due to unsignedness of other operand [-Wsign-compare]
 1830 |                 endpos = (i + 1 == nmarked ? selbufpos : marked[i + 1].startpos - pselbuf);
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/nnn.c: In function 'nextsel':
src/nnn.c:3194:63: error: passing argument 6 of 'kevent' from incompatible pointer type [-Wincompatible-pointer-types]
 3194 |                                    event_data, NUM_EVENT_FDS, &gtimeout) > 0)
      |                                                               ^~~~~~~~~
      |                                                               |
      |                                                               struct timespec *
In file included from src/nnn.c:51:
/usr/include/sys/event.h:295:44: note: expected 'const struct timespec *' but argument is of type 'struct timespec *'
  295 |                     const struct timespec *timeout);
      |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [nnn] Error 1

comment:2 Changed 3 months ago by barracuda156

I think we should just throw away that hackish fallback completely and not bother about wrong headers :)

comment:3 Changed 3 months ago by Sergey Fedorov <barracuda@…>

Owner: set to Sergey Fedorov <barracuda@…>
Resolution: fixed
Status: newclosed

In 729cd08735384b5dbca98905a2086fe9348274e8/macports-ports (master):

nnn: fix for older systems

Closes: #70577

Note: See TracTickets for help on using tickets.