Closed Elcoid closed 2 months ago
that's quite strange, could you share what is your environment? in particular OS? I have never seen that, but I only tested on Linux.
I'm also on Linux. I use Artix with Runit as the init, kernel 6.6.47-1-lts, rust 1:1.80.1-1.
I just tested on another computer with Gentoo, kernel 6.6.47-gentoo, rust 1.79.0, and it does the same thing.
I am not able to reproduce the issue on my environment, Archlinux
, rust 1.80.0
, kernel 6.10.2-arch
.
Do you have anything special in your shell configuration? One thing I can imagine is that somehow ~
is not being expanded, and it is being used in https://github.com/gilcu3/hullcaster/blob/2004435384caace4606ee12af3c15520ae825340/src/main.rs#L188
Could you try changing that line from "~/.local/state/hullcaster" to "/tmp" or any other valid path?
I changed "~/.local/state/hullcaster" to "/tmp" and the log file appeared in /tmp.
I didn't notice it initially because ".local" is hidden, but with the original line, it indeed creates a folder called "~" and then ".local/state/hullcaster/log" inside it
Do you have anything special in your shell configuration?
I'm not sure, but I don't think this is related to the shell. It's not interpreted by the shell, it's run in a compiled binary.
In any case, what happens if you run the following?
use std::fs;
fn main() -> std::io::Result<()> {
fs::create_dir_all("~/test-dir")?;
Ok(())
}
If that's the case I will just fix the root issue and make sure I get the HOME folder properly (that line was not meant to be in "production" anyway). I will fix ASAP.
@Elcoid can you check if the issue is fixed by ac9f2d7c57e085c2cd4141dd9943e76ce9ba2700?
Hello @gilcu3, no, with ac9f2d7 there is still a ~
directory created in the current dir.
You can probably replicate this behaviour by unsetting XDG_STATE_HOME before running hullcaster:
$ unset XDG_STATE_HOME
$ cargo run
Thanks, I was able to reproduce the issue now, should be fixed by c93c2c8, can you confirm?
Hello, yes, now it's fixed 🙌
Hello!
I discovered this when working on https://github.com/gilcu3/hullcaster/pull/6.
Basically, when I start Hullcaster, an empty directory called
~
appears in the current directory. This happens whether I start the debug target (either by runningcargo run
or runningtarget/debug/hullcaster
) or the release target (by runningtarget/release/hullcaster
).This also happens regardless of my current directory. If I go in
/tmp
for example and run Hullcaster (either the debug or the release target) using either its absolute or relative path, I see~
appearing in that directory.