-
Notifications
You must be signed in to change notification settings - Fork 1
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
temp file not working on Windows (Git bash) #20
Comments
Thank you for the bug report. Looking into it. |
I understand you run it for the gron.awk project. What is strange, it runs fine on Win with Github actions: https://github.com/xonixx/gron.awk/actions/runs/6448782633. And from what I see the versions you use are the same as in Github Actions environment. Also you do have
This needs some futher investigation. |
Yes, I have I see the Github action starts a Powershell and then runs I am not sure if there is an easy way to check if the console is running with elevated privileges on Windows other than to try do something and have it fail. Maybe if it's too tricky to implement a check for this into fhtagn for the corner case, it could just be documented that you need to run it as administrator on Git bash? |
Thank you @alisonatwork for the valuable details. Yes, it appears that Github Actions run on root(-like) user. |
Even without this issue, fhtagn should probably respect the |
Fixed in the main branch. @alisonatwork Could you please retry. @AdamantGarth thank you for the proposal, now fhtagn respects |
Closing as completed. Please feel free to reopen if the issue persists. |
I just pulled and ran it again on Git bash, the basic tests now pass in fhtagn core. gron.awk I guess is not updated to use the latest version, so the tests still fail there. Separately, I still have a wget problem, but I will open a new ticket for that. |
Trying to run the tests of gron.awk fails in Git bash (git version 2.43.0.windows.1, bash 5.2.21(1)-release).
I tracked the problem down to this project, which creates temp files in /dev/shm based on the following snippet:
[ -d /dev/shm ] && echo /dev/shm || echo /tmp
. The problem is that on Git bash this returns okay because the directory has to exist for POSIX reasons, but it seems like you can't write to it. (At least, if I try totouch /dev/shm/foo
it fails.)I am not sure if there is a way to coerce fopens in Cygwin/MINGW to apply a Win32 FILE_ATTRIBUTE_TEMPORARY flag, but it's probably not worth it to investigate. I think the best approach might be to just test that writing to that directory actually works before using it.
Separately, when explicitly setting the temporary directory to /tmp, then makesure fails inside fhtagn itself with a missing wget when trying to download the one true awk. Although probably that would fail even if it used curl because Git bash doesn't have a toolchain, which is why using awk/makesure/etc is appealing in the first place.
The text was updated successfully, but these errors were encountered: