Project

General

Profile

Actions

Bug #19677

closed

Failed to build ruby from the source code when following the guide

Added by tagomoris (Satoshi Tagomori) 11 months ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
git clone github.com/ruby/ruby (master HEAD cea9c30fa549885e36471f1782359df2bdcf895a)
[ruby-core:113507]

Description

I followed the document "Building Ruby" (doc/contributing/building_ruby.md) and got build errors.
At the step of "5. Build Ruby: make install", the errors below happened:

MBA:build tagomoris$ make -j 8
	BASERUBY = /Users/tagomoris/.rbenv/shims/ruby --disable=gems
	CC = clang
	LD = ld
	LDSHARED = clang -dynamiclib
	CFLAGS = -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef   -pipe 
	XCFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE -I. -I.ext/include/arm64-darwin22 -I../include -I.. -I../enc/unicode/15.0.0 
	CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   
	DLDFLAGS = -L/opt/homebrew/opt/bison/lib -Wl,-multiply_defined,suppress -Wl,-undefined,dynamic_lookup -fstack-protector-strong -Wl,-pie -framework CoreFoundation  
	SOLIBS = -ldl -lobjc -lpthread 
	LANG = 
	LC_ALL = 
	LC_CTYPE = UTF-8
	MFLAGS = - --jobserver-fds=4,5 -j
	RUSTC = rustc
	YJIT_RUSTC_ARGS = --crate-name=yjit --crate-type=staticlib --edition=2021 -g -C lto=thin -C opt-level=3 -C overflow-checks=on '--out-dir=/Users/tagomoris/gh/ruby/build/yjit/target/release/' ../yjit/src/lib.rs
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ../compile.c
compiling ../complex.c
compiling ../cont.c
compiling ../debug.c
compiling ../debug_counter.c
compiling ../dir.c
compiling ../dln_find.c
compiling ../encoding.c
compiling ../enum.c
compiling ../enumerator.c
making ../warning.rbinc
../compile.c:2455:38: error: call to undeclared function 'ISEQ_IS_ENTRY_START'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                            IC ic = &ISEQ_IS_ENTRY_START(body, type)[ic_index].ic_cache;
                                     ^
../compile.c:2455:69: error: subscripted value is not an array, pointer, or vector
                            IC ic = &ISEQ_IS_ENTRY_START(body, type)[ic_index].ic_cache;
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../compile.c:2484:28: error: use of undeclared identifier 'TS_ICVARC'; did you mean 'TS_IVC'?
                      case TS_ICVARC: /* inline cvar cache */
                           ^~~~~~~~~
                           TS_IVC
../insns_info.inc:44:5: note: 'TS_IVC' declared here
    TS_IVC = 'A',
    ^
(snip)

I got a successful build when I tried make ruby; make install instead.
So, I'm assuming that the build script has a bug, or the document should be updated.

My environment summary:

$ uname -a
Darwin Moris-Air 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103 arm64
$ clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Updated by tagomoris (Satoshi Tagomori) 11 months ago

After the first successful build, I couldn't reproduce the build failure noted above.
In addition to it, the build just after a clean git clone finished without errors. So, the build failure may have been triggered by my dirty source directory.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) 11 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0