
Issue #19174 has been reported by jaruga (Jun Aruga). ---------------------------------------- Bug #19174: YJIT configure "checking whether rustc works for YJIT... no" in rustc 1.65.0 on x86_64 https://bugs.ruby-lang.org/issues/19174 * Author: jaruga (Jun Aruga) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- On the latest master branch `11871e49c4fe493d6b958046969bc863f7fb6627` on Fedora 36, ``` $ uname -m x86_64 $ which rustc /bin/rustc $ rustc --version rustc 1.65.0 (Fedora 1.65.0-1.fc37) ``` I am seeing the "checking whether rustc works for YJIT... no". ``` $ ./autogen.sh $ ./configure --enable-yjit 2>&1 | tee configure.log ... checking for rustc... rustc checking whether rustc works for YJIT... no ... * YJIT support: yes ... ``` Seeing the code <https://github.com/ruby/ruby/blob/11871e49c4fe493d6b958046969bc863f7fb6627/configure.ac#L3744-L3760>, it is to check if the rustc is >= 1.58.0. And the used rustc is 1.65.0. ``` dnl check if rustc is recent enough to build YJIT (rustc >= 1.58.0) ``` I suspect that the checking logic might be something wrong. I checked why the checking logic fails with the modification below. ``` $ git diff diff --git a/configure.ac b/configure.ac index 79167a9c67..33a1b9540d 100644 --- a/configure.ac +++ b/configure.ac @@ -3753,7 +3753,7 @@ AS_IF([test "$RUSTC" != "no"], dnl Fails in case rustc target doesn't match ruby target. dnl Can happen on Rosetta, for example. AS_IF([echo "#[cfg(target_arch = \"$YJIT_TARGET_ARCH\")]\n fn main() { let x = 1; format!(\"{x}\"); }" | - $RUSTC - --emit asm=/dev/null 2>/dev/null], + $RUSTC - --emit asm=/dev/null], [YJIT_RUSTC_OK=yes] ) AC_MSG_RESULT($YJIT_RUSTC_OK) ``` ``` $ ./autogen.sh $ ./configure --enable-yjit 2>&1 | tee configure_debug.log ... checking for rustc... rustc checking whether rustc works for YJIT... error: unknown start of token: \ --> <anon>:1:31 | 1 | #[cfg(target_arch = "x86_64")]\n fn main() { let x = 1; format!("{x}"); } | ^ error: expected one of `!` or `::`, found keyword `fn` --> <anon>:1:34 | 1 | #[cfg(target_arch = "x86_64")]\n fn main() { let x = 1; format!("{x}"); } | ^^ expected one of `!` or `::` error: aborting due to 2 previous errors no ... * YJIT support: yes ... ``` Is it intended behavior? Actually after running the `configure`, the `make` works. -- https://bugs.ruby-lang.org/