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

Handle case-sensitive and special chars in cache paths #2763

Closed
bartlomieju opened this issue Aug 12, 2019 · 4 comments
Closed

Handle case-sensitive and special chars in cache paths #2763

bartlomieju opened this issue Aug 12, 2019 · 4 comments
Assignees
Labels
bug Something isn't working correctly

Comments

@bartlomieju
Copy link
Member

Ref: #2760

This fixes a very acute problem, so I'm all for landing this.
However, we have similar problems with other path components, which can also contain illegal characters (e.g. ? and &).

Tangentially related, there's also a correctness issue w.r.t. case sensitivity. In URLs the path and query component are case sensitive, while the protocol and host are not. When deno_dir lives on a case insensitive file system it won't be able to handle that properly.

Originally posted by @piscisaureus in #2760 (comment)

However, we have similar problems with other path components, which can also contain illegal characters (e.g. ? and &).

Haven't thought about it, but I believe Url won't return them from path_segments method. That inherently means that http://example.com/a.js?foo would be cached as http/example.com/a.js.

Tangentially related, there's also a correctness issue w.r.t. case sensitivity. In URLs the path and query component are case sensitive, while the protocol and host are not. When deno_dir lives on a case insensitive file system it won't be able to handle that properly.

Agreed, any ideas how to tackle that? Cast all protocols and hostnames to lowercase?

Originally posted by @bartlomieju in #2760 (comment)

Haven't thought about it, but I believe Url won't return them from path_segments method. That inherently means that http://example.com/a.js?foo would be cached as http/example.com/a.js.

That doesn't seem right either. Only the part after # can be safely discarded.

Originally posted by @piscisaureus in #2760 (comment)

@ry ry added the bug Something isn't working correctly label Aug 12, 2019
@Soremwar
Copy link
Contributor

Soremwar commented Jan 8, 2020

This problem has been a blocker for testing React on Windows under Deno.
Oddly enough, trying the exact same script on Linux causes no trouble.

@bartlomieju
Copy link
Member Author

This problem has been a blocker for testing React on Windows under Deno.
Oddly enough, trying the exact same script on Linux causes no trouble.

@Soremwar could you provide failing paths?

@Soremwar
Copy link
Contributor

Soremwar commented Jan 8, 2020

imagen

I have only 10-20 hours of practice under Rust so I wouldn't really know how to debug this but if it helps here is the complete log ran with RUST_BACKTRACE=full

deno --reload index.tsx
Compile file:///C:/Users/Usuario/Documents/Deno/deno-react-sample/index.tsx
Download https://dev.jspm.io/react
Download https://dev.jspm.io/react-dom/server
Download https://dev.jspm.io/npm:react@16.12.0/index.dew.js
Download https://dev.jspm.io/npm:react@16.12.0/cjs/react.development.dew.js
Download https://dev.jspm.io/npm:object-assign@4?dew
Download https://dev.jspm.io/npm:prop-types@15/checkPropTypes?dew
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 267, kind: Other, message: "El nombre del directorio no es válido." }', src\libcore\result.rs:1165:5
//The directory name is invalid.
stack backtrace:
   0:     0x7ff7c652f029 - <unknown>
   1:     0x7ff7c655069b - <unknown>
   2:     0x7ff7c6527534 - <unknown>
   3:     0x7ff7c6531e39 - <unknown>
   4:     0x7ff7c6531a8c - <unknown>
   5:     0x7ff7c653268c - <unknown>
   6:     0x7ff7c6532200 - <unknown>
   7:     0x7ff7c65320e9 - <unknown>
   8:     0x7ff7c654d00d - <unknown>
   9:     0x7ff7c654d10f - <unknown>
  10:     0x7ff7c605e59c - <unknown>
  11:     0x7ff7c5ffa26d - <unknown>
  12:     0x7ff7c60de7ce - <unknown>
  13:     0x7ff7c6038055 - <unknown>
  14:     0x7ff7c6067e42 - <unknown>
  15:     0x7ff7c6060858 - <unknown>
  16:     0x7ff7c5ffa2ad - <unknown>
  17:     0x7ff7c60397de - <unknown>
  18:     0x7ff7c609e99d - <unknown>
  19:     0x7ff7c5fe3034 - <unknown>
  20:     0x7ff7c647f378 - <unknown>
  21:     0x7ff7c648b18e - <unknown>
  22:     0x7ff7c647bc29 - <unknown>
  23:     0x7ff7c608c5e4 - <unknown>
  24:     0x7ff7c60d47b8 - <unknown>
  25:     0x7ff7c60d2a97 - <unknown>
  26:     0x7ff7c5fe306b - <unknown>
  27:     0x7ff7c602e4f6 - <unknown>
  28:     0x7ff7c609ed9e - <unknown>
  29:     0x7ff7c601c324 - <unknown>
  30:     0x7ff7c60ba29f - <unknown>
  31:     0x7ff7c60e1bc7 - <unknown>
  32:     0x7ff7c601a35c - <unknown>
  33:     0x7ff7c60bffc5 - <unknown>
  34:     0x7ff7c60bdce8 - <unknown>
  35:     0x7ff7c615b421 - <unknown>
  36:     0x7ff7c60bcb1f - <unknown>
  37:     0x7ff7c6028a91 - <unknown>
  38:     0x7ff7c5fdfdbd - <unknown>
  39:     0x7ff7c5fa1006 - <unknown>
  40:     0x7ff7c6532047 - <unknown>
  41:     0x7ff7c653f742 - <unknown>
  42:     0x7ff7c65329c2 - <unknown>
  43:     0x7ff7c5fa1057 - <unknown>
  44:     0x7ff7c6e53f44 - CrashForExceptionInNonABICompliantCodeRange
  45:     0x7ffd53137974 - BaseThreadInitThunk
  46:     0x7ffd5427a271 - RtlUserThreadStart

@bartlomieju
Copy link
Member Author

Fixed in #4030

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
Projects
None yet
Development

No branches or pull requests

3 participants