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

Long path names causes errors locally on Windows #560

Open
evansd opened this issue Jan 23, 2023 · 0 comments
Open

Long path names causes errors locally on Windows #560

evansd opened this issue Jan 23, 2023 · 0 comments

Comments

@evansd
Copy link
Contributor

evansd commented Jan 23, 2023

Job-runner refers to files by the absolute paths. If the absolute path gets longer than 260 characters then Windows can't see the file anymore and jobs will die with a confusing Internal Error message.

Example Slack thread here:
https://bennettoxford.slack.com/archives/C01D7H9LYKB/p1674465474403359

This is related to, but not identical with:

It's not an identical issue because whether we hit the length limit with a given file depends on its absolute path, which is a property of where the repo happens to be checked out locally and so can't be validated purely with respect to the project contents.

It might be possible to work around this using some magic prefix \\?\:
https://learn.microsoft.com/en-gb/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#win32-file-namespaces

But we'd need to make sure all our file interactions tested whether we're running on Windows and applied this consistently.

On Windows 10 there's some registry entry you can set to enable long path support, but I don't think this is a viable option for our userbase:
https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation

We could possibly chdir to the project root and refer to files using relative paths. That's a bit awkward but has the advantage that we could do that consistently for all platforms and not have to special case the Windows behaviour. We'd still need to validate that the relative path didn't exceed 260 chars, but that could be enforced along with the other rules in #307.

If we can't work around this issue then, at a minimum, we should try to detect when we've hit it and raise more helpful errors messages.

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

1 participant