-
Notifications
You must be signed in to change notification settings - Fork 33
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
Drop the input before writing to the output #813
Conversation
1088e24
to
f8eb9e9
Compare
Experimentation suggests that building the libraries with Topiary doesn't work on Windows, even if you force it to use the GNU toolchain.
I think (2) is the obvious choice...but it will take a bit of time. |
d993474
to
455e8a7
Compare
Going with (2) in #830... |
455e8a7
to
0634ed5
Compare
The good news is that the grammar building changes introduced (and rebased into this branch) in #830 are working on Windows:
The bad news is that
i.e., The context skipping marker, with no actual diffs 🤷 Best guess: Windows line endings, or no EOF |
Bingo!...but it's not in Topiary's output, it's from the Git checkout: $ md5sum expected.sh formatted.sh
f862ea1582a18bf93dfb1109859a9801 expected.sh
a5259ba2d34f94d028405fe730154ad8 formatted.sh
$ dos2unix -n expected.sh expected-unix.sh
$ md5sum expected-unix.sh formatted.sh
a5259ba2d34f94d028405fe730154ad8 expected-unix.sh
a5259ba2d34f94d028405fe730154ad8 formatted.sh |
a421397
to
3fd8740
Compare
Drop the input before writing to the output
Resolves #812
Description
When Topiary tries to write its output in place, it does so by writing to a temporary file that is then moved to the same location as the input file when it's complete (known as "persisting"). The hypothesis is that Windows opens an exclusive lock on the input file and therefore this process fails.
This PR causes all references to the open input file to be dropped -- and hence the file handler closed -- before persistence.
Note
This PR also introduces a minimal Windows CI workflow.
Checklist
Checklist before merging:
tree-sitter-loader
to build grammars #830chris/grammar-build
main