Opened 7 months ago

Last modified 7 months ago

#56463 assigned defect

htop: compiler on older systems

Reported by: iEFdev (Eric F) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.4.4
Keywords: lion legacy-os Cc:
Port: htop

Description

When installing htop on older systems (like my Lion), the bundled compiler creates a version where no processes are shown in the window. The bundled version of gcc is 4.2. If I test to build it manually using a newer version of gcc it works fine (I tested with gcc5 and gcc7), and when using the bundled version to mimic MP - it fails.

To reproduce:

# cd cloned repo or src dir from gh-tarball
autogen.sh
./configure CC=/usr/bin/gcc    # to mimic mp
make
./htop                         # nope

make clean
./configure CC=gcc             # /opt/local/bin/gcc-mp-{5,7}
make
./htop                         # yes

I guess the Portfile needs another compiler version to use instead of ther bundled one, but I don't know what min version it would need. I just tried with the 2 I have installed.

Perhaps more systems are affected?

Change History (6)

comment:1 Changed 7 months ago by raimue (Rainer Müller)

Cc: neverpanic removed
Keywords: lion legacy-os added; Lion removed
Owner: set to neverpanic
Status: newassigned

comment:2 Changed 7 months ago by ryandesign (Ryan Schmidt)

MacPorts does not use gcc as the default compiler on Lion. /usr/bin/gcc is not gcc on Lion and later. For Xcode 4.0.x–4.2.2 MacPorts uses llvm-gcc, while for Xcode 4.3 and newer we use clang.

We don't generally want to build ports with FSF GCC. If any compiler is unsatisfactory for whatever reason, the port should blacklist it and let MacPorts choose the next best compiler, which, if all Xcode compilers are unsatisfactory, will be a newer version of clang provided by MacPorts.

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

I don't have a Lion system to test on, so if somebody can figure out what the correct compilers to blacklist are, I'm happy to do that.

comment:4 Changed 7 months ago by pmetzger (Perry E. Metzger)

Perhaps kencu could help?

comment:5 in reply to:  2 Changed 7 months ago by iEFdev (Eric F)

Replying to ryandesign:

MacPorts does not use gcc as the default compiler on Lion. /usr/bin/gcc is not gcc on Lion and later.

Yes, I know, but that was what I had installed. But, now it looks like gcc5+ is the one(s) that works…

 

We don't generally want to build ports with FSF GCC. If any compiler is unsatisfactory for whatever reason, the port should blacklist it and let MacPorts choose the next best compiler, which, if all Xcode compilers are unsatisfactory, will be a newer version of clang provided by MacPorts.

I don't know if this is right/correct or not, but I tried to blacklist some, to find one who would work.

To blacklist I looked a bit at the Wine port, here, and also used these two pages.

As I added more compilers to the blacklist, it eventually wanted me to install {clang,llvm}-5.0 - so I did that, but that one didn't work either. Seems like gcc5 is the lowest working one.

  • Portfile

    old new  
    22
    33PortSystem          1.0
    44PortGroup           github 1.0
     5PortGroup           compiler_blacklist_versions 1.0
    56
    67github.setup        hishamhm htop 2.2.0
    78checksums           rmd160  13d2fc4d5414db6ac5653ef87a6216f4e2090bbf \
     
    3031pre-configure {
    3132    system -W ${worksrcpath} "sh autogen.sh"
    3233}
     34
     35compiler.blacklist-append {clang < 800} \
     36                          {*gcc-[3-4].*} \
     37                          {*clang-3.[0-9]} \
     38                          {*clang-4.[0-2]}
     39compiler.fallback-append  macports-gcc-5

That's what I used in the end.

I haven't got anything newer to try with, so I don't know which version is used on those systems. This is what I have installed (and tried with):

$ port installed {gcc,clang,llvm}*
The following ports are currently installed:
  clang-3.4 @3.4.2_12+analyzer+arm_runtime (active)
  clang-3.7 @3.7.1_5+analyzer (active)
  clang-3.8 @3.8.1_9+analyzer (active)
  clang-3.9 @3.9.1_8+analyzer+libstdcxx (active)
  clang-4.0 @4.0.1_5+analyzer+libstdcxx (active)
  clang-5.0 @5.0.1_1+analyzer+libstdcxx (active)
  clang_select @2_0 (active)
  gcc5 @5.5.0_0 (active)
  gcc7 @7.3.0_0 (active)
  gcc_select @0.1_8 (active)
  llvm-3.4 @3.4.2_12 (active)
  llvm-3.7 @3.7.1_4 (active)
  llvm-3.8 @3.8.1_3 (active)
  llvm-3.9 @3.9.1_5 (active)
  llvm-4.0 @4.0.1_2 (active)
  llvm-5.0 @5.0.1_0 (active)
  llvm_select @2_0 (active)

But again, I don't know if this is right/correct or not… Feels like there should be a simplier way to do it, & that I'm prob doing something wrong here. But hopefully it is helpful in some way. :)

Anyway, the error… It's been like this since htop became 2.0 -> So it's not just the last update.

comment:6 Changed 7 months ago by kencu (Ken)

I use htop on 10.6.8. My system is configured with LibcxxOnOlderSystems, and the default compiler is set to macports-clang-3.9, so it ignores everything that is set regarding compiler choices in the Portfile.

On this setup, htop builds and runs correctly.

Note: See TracTickets for help on using tickets.