Open djc opened 5 months ago
As far as I can tell, this is the problem fixed by commit f3b5623b75127e38ba685faa06ee714dc2904ffb. Make sure your version of c2rust includes that commit (which is newer than the latest release, so you'll have to build from git).
I built from 0e732f66e63902c4f8467fac51b9cfe93d458116, which should include that change, right?
0e732f6 does include that change. You can double-check the version you have built with c2rust --version
and you can see where the transpiler is looking for stddef.h
with strace
(you'll have to remove the generated .rs
files and run the transpiler afresh):
strace -f -e open,openat,openat2 $CARGO_TARGET_DIR/release/c2rust transpile compile_commands.json
The version is as expected. strace
output:
[pid 13068] openat(AT_FDCWD, "./stddef.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 13068] openat(AT_FDCWD, "/usr/local/include/stddef.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 13068] openat(AT_FDCWD, "/usr/include/stddef.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
In file included from anacron/lock.c:29:
/usr/include/stdio.h:33:10: fatal error: 'stddef.h' file not found
33 | #include <stddef.h>
| ^~~~~~~~~~
I tried to transpile cronie. After finally getting c2rust to compile on my Gentoo box (with llvm-17.0.6 installed) and generating
compile_commands.json
viaintercept-build
, this is the output I got:I'm a little confused that the process continues after the fatal error concerning
stddef.h
(and, indeed, why clang can't find that file at this point -- I have one in/usr/lib/clang/17/include/stddef.h
). Is there something I could do forTagTypeUnknown expecting 3
?