Skip to content
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

Panic on windows #19

Open
Bios-Marcel opened this issue Jul 21, 2023 · 3 comments
Open

Panic on windows #19

Bios-Marcel opened this issue Jul 21, 2023 · 3 comments

Comments

@Bios-Marcel
Copy link
Contributor

Bios-Marcel commented Jul 21, 2023

Calls to os.Symlink can error on windows, due to lack of "certain permissions". Can we just replace this with hardlinking? If so, only for Windows, or for all systems?

@gtramontina
Copy link
Owner

If Windows supports hardlinks, perhaps switching everything to hardlinks would make sense. Any drawbacks you can think of?

I'll go ahead and setup a GHA runner with Windows…

@Bios-Marcel
Copy link
Contributor Author

Well, I am not very deep in the matter, but as long as files end up on the same drive (partition), hardlinks are not an issue afaik. Not sure if we can make sure that this is a given. It's possible we need to reconsider where to save the temporary data. If I remember correctly, it uses the systems / users temp folder?

According to the underlying docs of TempDir() string, it uses the first match of the environment variables %TMP%, %TEMP%, %USERPROFILE%. As these are global environment variables, they shouldn't be per drive and therefore can be across drives.

So, what we could do, is to create a local .tmp-ooze and make sure we clean it up once we are done? If this is an acceptable trade-off for you, I don't see an issue.

@Bios-Marcel
Copy link
Contributor Author

I tested the hardlinks and it seems to work just fine on windows. I also can't think of any risks. The only difference would be, that keeping the tempfiles would keep the real files accessible, as hardlinked data is kept until the last hardlink has been deleted. This isn't necessarily be a problem, but just something to be aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants