Project

General

Profile

Actions

Bug #17817

open

--jit outputs ./tmp/_ruby_mjit_*.h: No such file or directory on with TMP

Added by jaruga (Jun Aruga) 3 months ago. Updated 3 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:103539]

Description

On the master branch: 3c8a67e8a5f51f337cf95b4038ed97bf8ca8b696, I see the ruby --jit prints fatal error: ./tmp/_ruby_mjit_hp1287695u0.h: No such file or directory only if TMP is set. Is it a bug?

The ruby is built from the source code by ./configure --prefix=... --enable-shared. I would attach the full log file.

The issue is like #14457 . Thank you.

$ ~/local/ruby-master-3c8a67e/bin/ruby -v
ruby 3.1.0dev (2021-04-21T11:45:23Z master 3c8a67e8a5) [x86_64-linux]
$ ~/local/ruby-master-3c8a67e/bin/ruby --disable-gems --jit-verbose=2 --jit-save-temps --jit-min-calls=1 --jit-wait -e '1.times { puts "Hello" }'
MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is /tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -fno-fast-math -nodefaultlibs -nostdlib -o /tmp/_ruby_mjit_hp1287652u0.h.gch /home/jaruga/local/ruby-master-3c8a67e/include/ruby-3.1.0/x86_64-linux/rb_mjit_min_header-3.1.0.h
start compilation: block in <main>@-e:1 -> /tmp/_ruby_mjit_p1287652u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -fno-fast-math -o /tmp/_ruby_mjit_p1287652u0.o /tmp/_ruby_mjit_p1287652u0.c -c -nostartfiles -nodefaultlibs -nostdlib
Starting process: /usr/bin/gcc /usr/bin/gcc -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -fno-fast-math -o /tmp/_ruby_mjit_p1287652u0.so /tmp/_ruby_mjit_p1287652u0.o -lgcc -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
JIT success (63.2ms): block in <main>@-e:1 -> /tmp/_ruby_mjit_p1287652u0.c
Hello
Stopping worker thread
Successful MJIT finish
$ TMP=./tmp ~/local/ruby-master-3c8a67e/bin/ruby --disable-gems --jit-verbose=2 --jit-save-temps --jit-min-calls=1 --jit-wait -e '1.times { puts "Hello" }'
MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is ./tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -fno-fast-math -nodefaultlibs -nostdlib -o ./tmp/_ruby_mjit_hp1287695u0.h.gch /home/jaruga/local/ruby-master-3c8a67e/include/ruby-3.1.0/x86_64-linux/rb_mjit_min_header-3.1.0.h
start compilation: block in <main>@-e:1 -> ./tmp/_ruby_mjit_p1287695u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -fno-fast-math -o ./tmp/_ruby_mjit_p1287695u0.o ./tmp/_ruby_mjit_p1287695u0.c -c -nostartfiles -nodefaultlibs -nostdlib
./tmp/_ruby_mjit_p1287695u0.c:1:10: fatal error: ./tmp/_ruby_mjit_hp1287695u0.h: No such file or directory
    1 | #include "./tmp/_ruby_mjit_hp1287695u0.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compile_c_to_so: failed to compile .c to .o: 1
Failed to generate so: ./tmp/_ruby_mjit_p1287695u0.so
Hello
Stopping worker thread
Successful MJIT finish

Files

ruby-3-jit-tmp-no-such-file-or-directory.log (31.2 KB) ruby-3-jit-tmp-no-such-file-or-directory.log A full log jaruga (Jun Aruga), 04/21/2021 02:45 PM

Updated by jaruga (Jun Aruga) 3 months ago

I created the tmp directory in advance.

$ mkdir tmp

I see the following files are created after the above commands.

$ ls tmp/
_ruby_mjit_hp1287695u0.h.gch  _ruby_mjit_p1287695u0.c

Updated by jaruga (Jun Aruga) 3 months ago

It was executed on my Fedora Linux 33.

$ cat /etc/fedora-release 
Fedora release 33 (Thirty Three)

Updated by xtkoba (Tee KOBAYASHI) 3 months ago

The failure seems to happen when TMP is specified as a relative path.

Actions #4

Updated by jaruga (Jun Aruga) 3 months ago

  • Subject changed from --jit outputs ./tmp/_ruby_mjit_*.h: No such file or directory on with TMP_DIR to --jit outputs ./tmp/_ruby_mjit_*.h: No such file or directory on with TMP
Actions

Also available in: Atom PDF