Opened 3 years ago

Closed 7 months ago

#62997 closed defect (fixed)

htop @3.0.5_0: Unable to build on 10.4 Tiger ppc

Reported by: Sinccis Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: tiger ppc Cc: evanmiller (Evan Miller)
Port: htop

Description

I tried to install package htop with command sudo port install htop after running sudo port selfupdate and it fails due to the following error:

:info:build depbase=`echo AvailableColumnsPanel.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:build /opt/local/bin/gcc-apple-4.2 -std=gnu99 -DHAVE_CONFIG_H -I.  -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -Wall -Wcast-align -Wcast-qual -Wextra -Wfloat-equal -Wformat=2 -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/opt/local/etc\" -I"./darwin" -D_APPLE_C_SOURCE -D_XOPEN_SOURCE=600 -I/opt/local/include -pipe -Os -arch ppc -MT AvailableColumnsPanel.o -MD -MP -MF $depbase.Tpo -c -o AvailableColumnsPanel.o AvailableColumnsPanel.c &&\
:info:build mv -f $depbase.Tpo $depbase.Po
:info:build In file included from Object.h:16,
:info:build                  from Panel.h:14,
:info:build                  from AvailableColumnsPanel.h:10,
:info:build                  from AvailableColumnsPanel.c:8:
:info:build XUtils.h: In function 'String_contains_i':
:info:build XUtils.h:43: warning: implicit declaration of function 'strcasestr'
:info:build XUtils.h:43: warning: comparison between pointer and integer
:info:build In file included from /usr/include/sys/ucred.h:64,
:info:build                  from /usr/include/sys/sysctl.h:71,
:info:build                  from ./darwin/DarwinProcess.h:10,
:info:build                  from ./darwin/Platform.h:17,
:info:build                  from AvailableColumnsPanel.c:18:
:info:build /usr/include/bsm/audit.h: At top level:
:info:build /usr/include/bsm/audit.h:219: error: expected specifier-qualifier-list before 'u_char'
:info:build /usr/include/bsm/audit.h:229: error: expected specifier-qualifier-list before 'u_char'
:info:build In file included from /usr/include/sys/sysctl.h:71,
:info:build                  from ./darwin/DarwinProcess.h:10,
:info:build                  from ./darwin/Platform.h:17,
:info:build                  from AvailableColumnsPanel.c:18:
:info:build /usr/include/sys/ucred.h:76: error: expected specifier-qualifier-list before 'u_long'
:info:build /usr/include/sys/ucred.h:95: error: expected specifier-qualifier-list before 'u_int'
:info:build In file included from /usr/include/sys/sysctl.h:72,
:info:build                  from ./darwin/DarwinProcess.h:10,
:info:build                  from ./darwin/Platform.h:17,
:info:build                  from AvailableColumnsPanel.c:18:
:info:build /usr/include/sys/proc.h:108: error: expected specifier-qualifier-list before 'u_int'
:info:build In file included from ./darwin/DarwinProcess.h:10,
:info:build                  from ./darwin/Platform.h:17,
:info:build                  from AvailableColumnsPanel.c:18:
:info:build /usr/include/sys/sysctl.h:690: error: expected declaration specifiers or '...' before 'u_int'
:info:build make[1]: *** [AvailableColumnsPanel.o] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_htop/htop/work/htop-dev-htop-ce6d60e'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_htop/htop/work/htop-dev-htop-ce6d60e'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_htop/htop/work/htop-3.0.5" && /usr/bin/make -j1 -w all
:info:build Exit code: 2
:error:build Failed to build htop: command execution failed
:debug:build Error code: CHILDSTATUS 29409 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"

Attachments (1)

main.log (48.5 KB) - added by Sinccis 3 years ago.
Full build log

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by Sinccis

Attachment: main.log added

Full build log

comment:1 Changed 3 years ago by kencu (Ken)

Hello, and welcome. I don't recall seeing you around here before, and you're in the right place for older macOS systems support! I'm going to pitch this comment towards a new user.

Tiger PPC and Intel have quite good support on MacPorts, but hiccups are still to be expected as fewer users are on these systems. Also there is no buildbot, so you have to build everything, which generates some challenges. Nevertheless, a great many things do build and work properly.

The single most common issue with Tiger PPC is that the default compiler that MacPorts uses, Apple's fork of gcc-4.2 that is known on the system as apple-gcc42, is more than 15 years out of date now. A lot of software won't build with that old gcc version, and virtually nobody upstream ever tests it.

Luckily, it is rather easy to try a newer compiler. You do this:

sudo port clean htop

sudo port -v install htop configure.compiler=macports-gcc-7

Now of course to do that, you do need to have gcc7 installed. You probably do, but in case you might not, you can install it with:

sudo port -v install gcc7

In the case of htop, unfortunately, that does not fix the build in the end (but it often will work).

The next line of defense we have is the LegacySupport PortGroup and system, which makes older systems look and work more like newer systems. As it turns out, htop already uses LegacySupport.

Sometimes, the software will have some optional features that can be turned off on older systems, such has high-level encryption that uses Apple's Security Frameworks, or similar. That is easy enough, if it exists -- I did not investigate htop for this.

So the easy fixes are not, unfortunately, going to be the ones that work here. It will require someone interested in htop who has a Tiger system (VM or real) to sit down with the code and sort out why it is failing, and generate a patch.

There are interested users, and hopefully you might become one of them, that generate such fixes. If they are not too squirrely, sometimes the upstream projects might accept them -- but don't hold your breath on that, because it is Tiger after all, obsolete for 15 years now.

For today, htop is not building on Tiger.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to neverpanic
Status: newassigned

comment:3 Changed 3 years ago by evanmiller (Evan Miller)

Cc: evanmiller added

comment:4 Changed 3 years ago by evanmiller (Evan Miller)

It looks like u_char and friends aren't being defined. Tiger's <sys/types.h> has:

#ifndef _POSIX_C_SOURCE
typedef unsigned char       u_char;
typedef unsigned short      u_short;
typedef unsigned int        u_int;
...

I suspect that _POSIX_C_SOURCE is getting defined during the compilation via -D_XOPEN_SOURCE=600, which the typedefs above from being included.

comment:5 Changed 3 years ago by kencu (Ken)

leopard and newer have a DARWIN_C_SOURCE override to get around this issue; Tiger's headers do not.

Building on Tiger against the 10.5 SDK would be the easiest way around this, but I have not been able to make that work for gcc (try it and you'll see why).

So the best I have come up with is to undefine POSIX_C_SOURCE either globally or before including the problem header...

comment:6 Changed 3 years ago by evanmiller (Evan Miller)

After fixing the typedef issues, I banged up against the absence of libproc on Tiger. You can see that DarwinProcess.c needs both proc_pidpath and proc_pidinfo. This issue is discussed in #58160, where the forecast for backporting these functions on PPC does not look great.

It might be possible to patch htop to disable certain features on Tiger. However, absent a significant patch, I'd suggest that the maintainers disable this port on Tiger for now.

comment:7 Changed 3 years ago by evanmiller (Evan Miller)

In 2a6500378e00f10c750193ec5a7e7c0bc8b5713e/macports-legacy-support (master):

Define u_char etc on Tiger using Leopard rules

A number of ports run into trouble compiling on Tiger because
_XOPEN_SOURCE results in _POSIX_C_SOURCE being defined, thus hiding the
u_char, u_int, and other typedefs. Leopard and later provide a
workaround in the form of _DARWIN_C_SOURCE; follow this behavior.

See: #52070
See: #62997

comment:8 Changed 3 years ago by neverpanic (Clemens Lang)

Is this fixed now?

comment:9 Changed 7 months ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: assignedclosed

I'm going to assume this is fixed.

In any case, my policy for support is the last three releases of macOS, i.e. the set that is actively maintained by Apple with security updates. 10.4 is not in that set, so if it isn't fixed, I'm happy to accept pull requests that will fix it, but I will not work on that myself.

Note: See TracTickets for help on using tickets.