Opened 22 months ago

Last modified 20 months ago

#66712 assigned defect

ruby31 fails to build on 10.5 - cstdbool not found

Reported by: rmottola (Riccardo) Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard legacy Cc:
Port: ruby31

Description

By default, ports uses clang 7 and compilation dies with:

compiling init.c
In file included from cxxanyargs.cpp:1:
In file included from ../../.././include/ruby/ruby.h:25:
In file included from ../../.././include/ruby/defines.h:74:
In file included from ../../.././include/ruby/backward/2/bool.h:22:
../../.././include/ruby/internal/stdbool.h:31:12: fatal error: 'cstdbool' file not found
#  include <cstdbool>
           ^~~~~~~~~~
1 error generated.

Attachments (1)

main.log (90.1 KB) - added by rmottola (Riccardo) 22 months ago.
Build log on 10.5 64bit default clang7

Download all attachments as: .zip

Change History (4)

Changed 22 months ago by rmottola (Riccardo)

Attachment: main.log added

Build log on 10.5 64bit default clang7

comment:1 Changed 22 months ago by rmottola (Riccardo)

Analyzing the log file, I see another potential issue:

compiling error.c
error.c:684:38: warning: 'MAC_OS_X_VERSION_10_6' is not defined, evaluates to 0 [-Wundef]
# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
                                     ^
error.c:709:38: warning: 'MAC_OS_X_VERSION_10_6' is not defined, evaluates to 0 [-Wundef]
# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
                                     ^
2 warnings generated.

That's expected on 10.5 perhaps, but maybe we could provide those symbols with legacy? or these tests might not do what expected.

comment:2 Changed 22 months ago by jmroot (Joshua Root)

It's always a good idea to use the numeric values of the MAC_OS_X_VERSION_* macros, because the macros themselves won't be defined on systems older than the version they refer to. The definitions are in AvailabilityMacros.h. E.g.

#define MAC_OS_X_VERSION_10_6         1060

So all occurrences of MAC_OS_X_VERSION_10_6 in the source can be replaced with 1060.

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

Owner: set to kimuraw
Status: newassigned

Replying to rmottola:

compiling error.c
error.c:684:38: warning: 'MAC_OS_X_VERSION_10_6' is not defined, evaluates to 0 [-Wundef]
# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
                                     ^

That's an upstream bug. They already fixed it (in a more convoluted way) here for version 3.2:

https://github.com/ruby/ruby/commit/f08fcd0e803bb07912794b8a2366973946d2af2f

Looks like they didn't backport it to earlier versions so a patch can be added in MacPorts. The bad code has been in the file since ruby 2.5, so versions 2.5 through 3.1 would need patches. You should also file a bug upstream and ask them to backport it—bugs you don't report don't get fixed. They are apparently still making changes to the 2.7, 3.0, and 3.1 branches as recently as last week.

Also, remember to Cc port maintainers; without that, they don't see your tickets.

Note: See TracTickets for help on using tickets.