Rust-GCC / gccrs

GCC Front-End for Rust
https://rust-gcc.github.io/
GNU General Public License v2.0
2.46k stars 159 forks source link

ICE when input file name is a directory ending with slash #3129

Open tamaroning opened 3 months ago

tamaroning commented 3 months ago
$ mkdir dir
$ ./crab1 -frust-incomplete-and-experimental-compiler-do-not-use dir/
crab1: internal compiler error: in set_crate_name, at rust/rust-session-manager.h:290
0x164c327 Rust::CompileOptions::set_crate_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
        ../../gccrs/gcc/rust/rust-session-manager.h:290
0x1647e8a Rust::Session::handle_input_files(int, char const**)
        ../../gccrs/gcc/rust/rust-session-manager.cc:409
0x14a795e grs_langhook_parse_file
        ../../gccrs/gcc/rust/rust-lang.cc:165
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

expected output:

crab1: error: cannot open filename dir: Is a directory
Backtrace

``` 0x164c327 Rust::CompileOptions::set_crate_name(std::__cxx11::basic_string, std::allocator >) ../../gccrs/gcc/rust/rust-session-manager.h:290 0x1647e8a Rust::Session::handle_input_files(int, char const**) ../../gccrs/gcc/rust/rust-session-manager.cc:409 0x14a795e grs_langhook_parse_file ../../gccrs/gcc/rust/rust-lang.cc:165 ```

I am using Ubuntu 22.0.4 on WSL2

yomanthunder commented 1 month ago

Hello, Is anyone currently working on this issue? I want to work on this issue.

tamaroning commented 1 month ago

Hi @yomanthunder PR https://github.com/Rust-GCC/gccrs/pull/3146, which is linked to this issue, is currently ready to be merged.

You can take a look at another issue labeled as good-first-pr. (It seems that no one is working on https://github.com/Rust-GCC/gccrs/pull/2872)

yomanthunder commented 1 month ago

Thanks for the update, @tamaroning! I’ll look into issue #2872.