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

deno run fails when local app data location path length exceeds 260 characters on Windows #7510

Closed
dsherret opened this issue Sep 16, 2020 · 2 comments
Labels
bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed windows Related to Windows platform

Comments

@dsherret
Copy link
Member

Thought I would open this as an FYI, but feel free to close as it's unlikely people will run into this.

  1. Use Windows with long paths enabled.
  2. Create a directory path with a long name.
  3. Create a file test.ts inside this directory.
  4. deno run test.ts
  5. Keep increasing the file path length until it fails.

Relates to rust-lang/rust#76586 ...the fix is to use UNC paths, but it seems std::path does not handle UNC paths nicely.

Sample output 1

~\projects\going-deeper\and-deeper\and-deeper\and-deeper\and-deeper\and-deeper\and-deeper\and-deeper\and-deeper\and-deeperrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
> deno run test.ts
Check file:///C:/Users/david/projects/going-deeper/and-deeper/and-deeper/and-deeper/and-deeper/and-deeper/and-deeper/and-deeper/and-deeper/and-deeperrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr/test.ts
error: Could not create TypeScript compiler cache location: "C:\\Users\\david\\AppData\\Local\\deno\\gen\\file\\C\\Users-deeper\\and-deeperrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"

Sample output 2

echo "console.log('test')" > testingggh.ts; deno run testingggh.ts
Check file:///C:/Users/david/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/testingggh.ts
error: The system cannot find the path specified. (os error 3) (for '"C:\\Users\\david\\AppData\\Local\\deno\\gen\\file\\C\\Users\\david\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\123456789\\testingggh.ts.buildinfo"')
@kitsonk kitsonk added bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed windows Related to Windows platform labels Sep 23, 2020
@piscisaureus
Copy link
Member

piscisaureus commented Oct 13, 2020

I suspect the restriction you’re running into is that the current working directory can’t use UNC paths.

This is why e.g. node can work long paths just fine, but it can’t chdir() into them or run executables with long paths.

Note that the “long paths feature“ that you’re talking about is something else - it goes a step further and allows “regular” paths to be long.

I wasn’t aware that enabling long paths allows chdir()ing into a directory of over 260 characters long. But I think it still can’t be an \\?\ path.

@lucacasonato
Copy link
Member

This should be fixed now, because we hash file paths in DENO_DIR now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed windows Related to Windows platform
Projects
None yet
Development

No branches or pull requests

4 participants