Opened 22 months ago

Last modified 15 months ago

#66639 closed defect

ruby31 3.1.3: fails to build on OS X 10.8 and 10.9 — at Version 2

Reported by: erikbs Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: mountainlion, mavericks Cc:
Port: ruby31

Description (last modified by ryandesign (Ryan Carsten Schmidt))

The build configures as usual, but fails during the build stage. Log extract:

...
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby31/ruby31/work/ruby-3.1.3'
:info:build generating makefile exts.mk
:info:build compiling ./enc/trans/emoji_sjis_kddi.c
:info:build compiling ./enc/iso_8859_2.c
:info:build compiling ./enc/iso_8859_3.c
:info:build exts.mk updated
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby31/ruby31/work/ruby-3.1.3'
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby31/ruby31/work/ruby-3.1.3/ext/-test-/RUBY_ALIGNOF'
:info:build make[2]: *** No rule to make target `all'.  Stop.
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby31/ruby31/work/ruby-3.1.3/ext/-test-/RUBY_ALIGNOF'
:info:build make[1]: *** [ext/-test-/RUBY_ALIGNOF/all] Error 2

The error is not that ext/-test-/RUBY_ALIGNOF/Makefile does not contain a target all, but that the Makefile in this directory does not exist at all. According to a comment on an earlier ticket from a few months ago (comment:ticket:65290:1), the generation of this Makefile overwrites the Makefile in the build root directory, and that seems to be the case on my system as well.

I have tried compiling with Clang 14, Clang 15 and GCC 11 – the result is always the same. I also tried using gmake instead of make and to build with use_autoreconf yes in the Portfile (required an additional patch akin to patch-configure.diff for configure.ac). Nothing helped.

If I build Ruby from source outside of Macports (same source tgz), I do not encounter this issue. I noticed that even if I pass all the Portfile configure options, the generated Makefiles are quite different (I will attach both files).

Change History (6)

Changed 22 months ago by erikbs

Attachment: ruby31.log added

Changed 22 months ago by erikbs

Attachment: Makefile_macports added

Changed 22 months ago by erikbs

Attachment: Makefile_outside added

comment:1 Changed 22 months ago by erikbs

When building from source outside Macports I had to apply two patches manually:

  • Add -framework Security to Makefile
  • Change MAP_ANONYMOUS to MAP_ANON in yjit_asm.c

I have no reason to believe that any of these changes affect the final result. There are a few compiler errors that prevent the build from succeeding, but that is not relevant here. The important thing is that it gets past the Makefile issue.

I configured with CC=clang ./configure --enable-shared --enable-install-static-library --disable-install-doc --mandir="/opt/local/share/man" --enable-pthread --without-gmp --with-opt-dir="/opt/local" --program-suffix=31 --with-rubyhdrdir=/opt/local/include/ruby-31 --with-ruby-libprefix=/opt/local/lib/ruby31 --with-openssl-dir=/opt/local --without-baseruby, applied the patches mentioned above and built with make -j16. I will attach that log as well for comparison.

Changed 22 months ago by erikbs

Attachment: outside_macports.log added

Log from build outside Macports

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

Description: modified (diff)
Note: See TracTickets for help on using tickets.