-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not persist output to disk on windows #812
Comments
Ah, it's nice that we get some Windows users (and even nicer that it actually works, at least up to some point 😅 ). I'm going to tag @fdncred here directly to avoid polluting the topiary-nushell issue. I haven't used Windows in ages, and I suspect this is the case for most people working on Topiary. But naive question first: is it possible that, as the error says, it's just a permission problem? Like the directory or the file is read-only? |
Dynamic loading of grammars is untested under Windows. Either way, it's not clear from this error where it's going wrong. Could you increase the logging verbosity ( |
Thanks for the suggestions!
It's not. I/my terminal has full write permissions to this folder. Attached is the output of |
I think your diagnosis looks quite likely. The logs show that the grammar loading seems to be working fine; Topiary does it's formatting, but then fails when it tries to write the output. When an input file is specified, we store its path and, when we want to read from it, it's opened read only ( The documentation for the persistence operation suggests that the temporary file is moved to the final output location (i.e., the input file). The logs show it's this that's failing. (I believe that happens in the library code here, FWIW.) Unfortunately I don't have any way to test this, but if Windows is taking an exclusive lock as you suggest, then this branch should (I think) offer a fix. Would you be willing to be a guinea pig for this, @fdncred 🙏 |
Describe the bug
As reported by a windows user in
blindFS/topiary-nushell#1 (comment)
To Reproduce
tree-sitter build
on windowslanguages.ncl
topiary format *.nu
Expected behavior
write formatted code back to the input file.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: