[ruby-core:121680] [Ruby Bug#21271] Ruby build failure due to invalid probe specifier for dtrace
From:
"nekketsuuu (Takuma Ishikawa) via ruby-core" <ruby-core@...>
Date:
2025-04-17 02:37:12 UTC
List:
ruby-core #121680
Issue #21271 has been reported by nekketsuuu (Takuma Ishikawa).
----------------------------------------
Bug #21271: Ruby build failure due to invalid probe specifier for dtrace
https://bugs.ruby-lang.org/issues/21271
* Author: nekketsuuu (Takuma Ishikawa)
* Status: Open
* ruby -v: N/A
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
I've noticed that building the master branch of Ruby fails on my MacBook with the following error about dtrace and probes.h:
```
% make
BASERUBY = /Users/nekketsuuu/.rbenv/shims/ruby --disable=gems
CC = clang
LD = ld
LDSHARED = clang -dynamiclib
CFLAGS = -isystem/opt/homebrew/include -isystem/opt/homebrew/include -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -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 -Wmisleading-indentation -Wundef -pipe -arch arm64
XCFLAGS = -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -I. -I.ext/include/arm64-darwin24 -I../include -I.. -I../prism -I../enc/unicode/15.0.0 -Dmodular_gc_dir=
CPPFLAGS = -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/mysql-client@8.4/include -I/opt/homebrew/opt/libffi/include -isystem/opt/homebrew/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/mysql-client@8.4/include -I/opt/homebrew/opt/libffi/include -isystem/opt/homebrew/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -L/opt/homebrew/opt/openssl/lib -L/opt/homebrew/opt/mysql-client@8.4/lib -L/opt/homebrew/opt/libffi/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/openssl/lib -L/opt/homebrew/opt/mysql-client@8.4/lib -L/opt/homebrew/opt/libffi/lib -L/opt/homebrew/lib -Wl,-undefined,dynamic_lookup -fstack-protector-strong -Wl,-pie -framework CoreFoundation -arch arm64
SOLIBS = -lgmp -ldl -lobjc -lpthread
LANG = ja_JP.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
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/nekketsuuu/dev/src/github.com/ruby/ruby/build/yjit/target/release/' ../yjit/src/lib.rs
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /Applications/Xcode_16.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
compiling ../main.c
compiling ../dmydln.c
generating id.h
id.h updated
generating miniprelude.c
miniprelude.c updated
compiling ../miniinit.c
making ../array.rbinc
/Users/nekketsuuu/.rbenv/shims/ruby --disable=gems ../tool/gen_dummy_probes.rb ../probes.d > probes.dmyh
translating probes ../probes.d
dtrace: invalid probe specifier system/opt/homebrew/include: syntax error near end of input
make: *** [probes.h] Error 1
```
With running `git bisect`, I found that the build started failing after the commit 060ae17c806f0ba955b1c5d825b890b6de6c47e3 https://github.com/ruby/ruby/commit/060ae17c806f0ba955b1c5d825b890b6de6c47e3 (between Ruby 3.4.3 d0b7e5b6a04bde21ca483d20a1546b28b401c2d4 and the HEAD 7e2ba5a91bcdc31e14502f797a6184e3f4d41747).
I'm not sure if this is a problem of my local configurations or a build script. Here is a summary of my configurations:
```
Configuration summary for ruby version 3.5.0
* Installation prefix: /Users/nekketsuuu/.rbenv/versions/master
* exec prefix: ${prefix}
* arch: arm64-darwin24
* site arch: ${arch}
* RUBY_BASE_NAME: ruby
* ruby lib prefix: ${libdir}/${RUBY_BASE_NAME}
* site libraries path: ${rubylibprefix}/${sitearch}
* vendor path: ${rubylibprefix}/vendor_ruby
* target OS: darwin24
* compiler: clang
* with thread: pthread
* with coroutine: arm64
* with modular GC: no
* enable shared libs: no
* dynamic library ext: bundle
* CFLAGS: ${hardenflags} -fdeclspec ${optflags} \
${debugflags} ${warnflags}
* LDFLAGS: -L. -L/opt/homebrew/opt/openssl/lib \
-L/opt/homebrew/opt/mysql-client@8.4/lib \
-L/opt/homebrew/opt/libffi/lib \
-L/opt/homebrew/lib \
-L/opt/homebrew/opt/openssl/lib \
-L/opt/homebrew/opt/mysql-client@8.4/lib \
-L/opt/homebrew/opt/libffi/lib \
-L/opt/homebrew/lib -fstack-protector-strong
* DLDFLAGS: -L/opt/homebrew/opt/openssl/lib \
-L/opt/homebrew/opt/mysql-client@8.4/lib \
-L/opt/homebrew/opt/libffi/lib \
-L/opt/homebrew/lib \
-L/opt/homebrew/opt/openssl/lib \
-L/opt/homebrew/opt/mysql-client@8.4/lib \
-L/opt/homebrew/opt/libffi/lib \
-L/opt/homebrew/lib -Wl,-undefined,dynamic_lookup
* optflags: -O3 -fno-fast-math
* debugflags: -ggdb3
* warnflags: -Wall -Wextra -Wextra-tokens \
-Wdeprecated-declarations -Wdivision-by-zero \
-Wdiv-by-zero -Wimplicit-function-declaration \
-Wimplicit-int -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 -Wmisleading-indentation -Wundef
* hardenflags: -fstack-protector-strong -U_FORTIFY_SOURCE \
-D_FORTIFY_SOURCE=2
* strip command: strip -A -n
* install doc: rdoc
* YJIT support: yes
* RJIT support: yes
* man page type: doc
* BASERUBY -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) \
+PRISM [arm64-darwin24]
```
and here is a full command logs by `make Q=`:
```
translating probes ../probes.d
dtrace -xnolibs -o probes.h.tmp -h -C -I. -I.ext/include/arm64-darwin24 -I../include -I.. -I../prism -I../enc/unicode/15.0.0 -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/mysql-client@8.4/include -I/opt/homebrew/opt/libffi/include -isystem/opt/homebrew/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/mysql-client@8.4/include -I/opt/homebrew/opt/libffi/include -isystem/opt/homebrew/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -s ../probes.d
dtrace: invalid probe specifier system/opt/homebrew/include: syntax error near end of input
make: *** [probes.h] Error 1
```
It appears that CPPFLAGS contains `-isystem` flag, and dtrace might handle it as `-i` flag.
This is my first time submitting a bug issue here. Feel free to correct me if there are any mistakes. Also, let me know if more information is needed.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/