Opened 16 months ago

Last modified 16 months ago

#67833 assigned defect

calc @2.14.2.1: make: [charbit.h] Error 127 (ignored), make: *** [longbits.h] Error 127

Reported by: barracuda156 Owned by: pmetzger (Perry E. Metzger)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: powerpc Cc:
Port: calc

Description

Issue with upstream: https://github.com/lcn2/calc/issues/83

--->  Extracting calc-2.14.2.1.tar.bz2
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work" && /opt/local/bin/lbzip2 -dc '/opt/local/var/macports/distfiles/calc/calc-2.14.2.1.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf - 
/usr/bin/gnutar: calc-2.14.2.1/cal/regress.cal: implausibly old time stamp 1970-01-01 08:00:00
--->  Applying patches to calc
--->  Applying patch-Makefile.local.diff
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/patch -p0 < '/opt/PPCSnowLeopardPorts/math/calc/files/patch-Makefile.local.diff'
patching file Makefile.local
Hunk #1 succeeded at 38 (offset 1 line).
--->  Patching Makefile.local: s|___PREFIX___|/opt/local|
--->  Configuring calc
--->  Building calc
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1'
forming have_limits.h
have_limits.h formed
forming have_ban_pragma.h
have_ban_pragma.h formed
forming charbit.h
make: [charbit.h] Error 127 (ignored)
charbit.h formed
forming have_unistd.h
have_unistd.h formed
forming have_stdlib.h
have_stdlib.h formed
forming longbits.h
make: *** [longbits.h] Error 127
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
Exit code: 2

Same failure with gcc 12.3.0.

Change History (12)

comment:1 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)

The port is outdated; maybe updating would help:

% port livecheck calc
calc seems to have been updated (port version: 2.14.1.5, new version: 2.14.2.1)

The port uses no configure script and a custom Makefile and doesn't use the makefile portgroup and doesn't manually send all MacPorts flags to the build system; this could relate to the problem.

But it builds fine for me with Xcode clang or MacPorts gcc 12 on macOS 12.

Disabling silent rules may provide insight into what went wrong on your system. According to the Makefile, this is how to do that:

# Disable silent rules
build.args-append   Q= H=@ S= E= V=@

This may be too much detail for general use; maybe only some of those should be added to the Portfile; but maximal detail should help pinpoint this problem.

comment:2 in reply to:  1 ; Changed 16 months ago by barracuda156

Replying to ryandesign:

The port is outdated; maybe updating would help:

I was actually trying to build the new version (I think the old one failed already). Turned out Makefile hardcodes Clang – no surprise, it breaks down on PPC. https://github.com/lcn2/calc/issues/83

This fixes the build:

reinplace "s|LCC= clang|LCC= ${configure.cc}|" ${worksrcpath}/Makefile

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

Although the Portfile doesn't use the makefile portgroup, which would set the CC environment variable (which would be overridden by the Makefile, but the portgroup could be configured to override the Makefile instead), the Portfile does override CC manually. The Makefile does say:

LCC= clang
CC= ${PURIFY} ${LCC} ${CCWERR}

So one assumes from reading that that the build will use CC and that overriding CC as we do would be sufficient. However the build actually seems to use LCC too. So the port should either override only LCC or should override both LCC and CC. (I haven't checked what this ${PURIFY} and ${CCWERR} are doing yet and whether we would want to keep them.)

comment:4 in reply to:  2 ; Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: calc build fails on PPC: make: [charbit.h] Error 127 (ignored), make: *** [longbits.h] Error 127calc @2.14.2.1: make: [charbit.h] Error 127 (ignored), make: *** [longbits.h] Error 127

Replying to barracuda156:

I was actually trying to build the new version (I think the old one failed already).

If you've modified a port that you're reporting a bug about, that's pretty important to mention up-front!

comment:5 in reply to:  3 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

(I haven't checked what this ${PURIFY} and ${CCWERR} are doing yet and whether we would want to keep them.)

PURIFY is empty and the Makefile doesn't explain what it is. CCWERR is empty and the Makefile explains it's where you would set -Werror if you wanted it, which we don't in MacPorts. So for us there is no difference between CC and LCC and it doesn't matter whether we set only LCC or set both LCC and CC. But what we are currently doing, only setting CC, is not sufficient.

comment:6 in reply to:  4 Changed 16 months ago by barracuda156

Replying to ryandesign:

Replying to barracuda156:

I was actually trying to build the new version (I think the old one failed already).

If you've modified a port that you're reporting a bug about, that's pretty important to mention up-front!

The bug is there for years, including the version currently used by Macports: https://github.com/lcn2/calc/blob/d91ace60913d202c1859c6eb85f4856221193b74/Makefile#L1629 As I remember I did try it too, initially, switching to the new one when that failed. Away from the desktop, can’t verify, but you can see the source code.

comment:7 Changed 16 months ago by barracuda156

--->  Checksumming calc-2.14.2.1.tar.bz2
--->  Extracting calc
--->  Extracting calc-2.14.2.1.tar.bz2
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work" && /opt/local/bin/lbzip2 -dc '/opt/local/var/macports/distfiles/calc/calc-2.14.2.1.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf - 
/usr/bin/gnutar: calc-2.14.2.1/cal/regress.cal: implausibly old time stamp 1970-01-01 08:00:00
--->  Applying patches to calc
--->  Applying patch-Makefile.local.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/math/calc/files/patch-Makefile.local.diff'
patching file Makefile.local
Hunk #1 succeeded at 38 (offset 1 line).
--->  Patching Makefile.local: s|___PREFIX___|/opt/local|
--->  Configuring calc
--->  Building calc
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work/calc-2.14.2.1'
forming have_limits.h
have_limits.h formed
forming have_ban_pragma.h
have_ban_pragma.h formed
forming charbit.h
make: [charbit.h] Error 127 (ignored)
charbit.h formed
forming have_unistd.h
have_unistd.h formed
forming have_stdlib.h
have_stdlib.h formed
forming longbits.h
make: *** [longbits.h] Error 127
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work/calc-2.14.2.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
Exit code: 2
Error: Failed to build calc: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_calc/calc/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.

UPD. Looks like Macports installs 2.14.2.1 now.

Last edited 16 months ago by barracuda156 (previous) (diff)

comment:8 Changed 16 months ago by pmetzger (Perry E. Metzger)

I obviously do not mind others making PowerPC work, and will take any easily maintained patches that enable it, so if you want to make it work, go ahead. I don't intend to do any such work of my own; it's been 17 years since the last PowerPC Mac was sold.

I'm also perfectly happy with anyone adding patches for things of general utility like using the makefile portgroup. I didn't know that portgroup even existed.

comment:9 in reply to:  8 Changed 16 months ago by barracuda156

Replying to pmetzger:

I obviously do not mind others making PowerPC work, and will take any easily maintained patches that enable it, so if you want to make it work, go ahead. I don't intend to do any such work of my own; it's been 17 years since the last PowerPC Mac was sold.

I'm also perfectly happy with anyone adding patches for things of general utility like using the makefile portgroup. I didn't know that portgroup even existed.

Thank you for responding. I merely assign a ticket to you because it is your port. I know that you do not work on PowerPC.

We have an easy fix for this bug now. Just waiting if the upstream adds it on their end.

comment:10 Changed 16 months ago by barracuda156

comment:11 Changed 16 months ago by pmetzger (Perry E. Metzger)

That commit definitely doesn't seem to have anything to do with PPC support.

comment:12 Changed 16 months ago by barracuda156

Sorry, I just copied the link they gave. Let me correct the statement: by the time of that commit PPC got fixed. Latest version from upstream will be fine.

Note: See TracTickets for help on using tickets.