-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix: normalize paths in get-options-overrides
#331
Merged
ezolenko
merged 1 commit into
ezolenko:master
from
agilgur5:fix-normalize-get-options-overrides
May 30, 2022
Merged
fix: normalize paths in get-options-overrides
#331
ezolenko
merged 1 commit into
ezolenko:master
from
agilgur5:fix-normalize-get-options-overrides
May 30, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- the `outDir` was not normalized after the `/placeholder` part was added to `cacheRoot` - `cacheRoot` could have `\` directory separators on it on Windows, which caused some tests to fail on Windows before - tests have been normalized now too - `expandIncludeWithDirs` used `path.join` without normalizing after - `path.join` uses the OS's native separators (`posix.join` would do POSIX separators only), so when the paths were already normalized and then `path.join`ed, this would cause mixed separators on Windows - this fixes the current CI failure on Windows in the `createFilter` tests (`rootDirs` and `projectReferences`, which use `expandIncludeWithDirs`) - c.f. https://github.com/ezolenko/rollup-plugin-typescript2/runs/6516149780?check_suite_focus=true
agilgur5
added
kind: bug
Something isn't working properly
topic: OS separators
Path normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX
labels
May 26, 2022
This was referenced May 26, 2022
All tests pass on Windows now! Hoping we don't have to deal with path normalization again for a while now 😅 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind: bug
Something isn't working properly
topic: OS separators
Path normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
get-options-overrides.ts
had some paths that were not normalized, resulting in mixed separators on Windows in certain cases.get-options-overrides
(createFilter
) #329 (comment)get-options-overrides
(createFilter
) #329 (comment)Details
the
outDir
was not normalized after the/placeholder
part was added tocacheRoot
cacheRoot
could have\
directory separators on it on Windows, which caused some tests to fail on Windows beforeexpandIncludeWithDirs
usedpath.join
without normalizing afterpath.join
uses the OS's native separators (posix.join
would do POSIX separators only), so when the paths were already normalized and thenpath.join
ed, this would cause mixed separators on WindowscreateFilter
tests (rootDirs
andprojectReferences
, which useexpandIncludeWithDirs
)Review Notes
This should just be a bugfix and not breaking, but per the linked discussions, I'm really not sure how these bugs haven't been found yet by consumers -- I'm guessing that TS does normalization on
outDir
(lots of redundant normalization necessary due to ambiguous inputs) and thatrootDirs
andprojectReferences
just aren't used by many Windows users.