dalum / Diary.jl

Always keep a diary under your pillow.
MIT License
18 stars 0 forks source link

Diary.jl file not created on Arch Linux and Julia 1.5.3 #3

Closed roflmaostc closed 1 year ago

roflmaostc commented 3 years ago

As discussed on Discourse the history file is not created under Arch Linux and Julia.

Just posted it here in case someone else encounters this

jakobnissen commented 3 years ago

@dalum seeing this on MacOS. The temporary file is created containing the REPL history, but no additional lines are added, and the diary.jl file is never created. Running Diary.find_diary() creates an empty diary.jl file, but nothing is written to it. All tests pass.

I'm on Julia 1.6 beta, using Diary.jl v 0.1.4, with default config.

roflmaostc commented 3 years ago

Maybe an additional comment: I installed Julia via the package manager Pacman and I'm not using the provided Julia binary.

Could that be the reason? Package Compiler has the same issue.

dalum commented 3 years ago

That is quite suspicious. If the tests pass, then it means that file watching works and the thing that's failing is that Julia does not redirect the output. Could you try starting julia with JULIA_HISTORY=tmp.jl and see if it writes the history content to that file?

jakobnissen commented 3 years ago

It doesn't. tmp.jl is not created

dalum commented 3 years ago

Alright. Seems like that is the root issue, then. I would make sure to check that it happens with a clean environment and without a startup file --startup-file=no and post an issue upstream if it still persists. Otherwise, it could be another package causing the issue. As a workaround, I will add an option to use the default history file instead. The only issue is that it causes some problems, if multiple sessions are in use, which was the original reason for redirecting the output to a temporary file in the first place.

jakobnissen commented 3 years ago

Indeed, it does still persist with an empty environment and no startup file. I've been trying to do a little digging. Setting JULIA_HISTORY from command line before starting Julia makes it create a new history file (and will make it write history to that). But changing it from within Julia has no effect - even if it's in the startup file. I don't know if this is a bug in Julia, I'll try to figure it out.

dalum commented 1 year ago

(Finally) closing this. Diary.jl only works when started during startup. The documentation has been updated to reflect this.