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

fix(@angular-devkit/build-angular): avoid native realpath in application builder #26453

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

clydin
Copy link
Member

@clydin clydin commented Nov 22, 2023

When the preserveSymlinks option is false (the default), the tsconfig path was passed through realpath to ensure that the TypeScript source files were resolved correctly. However, the promise version of the Node.js API was previously used. This version used realpath.native internally but the native version has numerous behavior problems on Windows systems. This includes potential case conversion which can result in differing cases for files within the build system and in turn failed path comparison checks. The synchronous version is now used which has a JavaScript implementation that does not suffer from these problems.

Closes: #26379

…ion builder

When the `preserveSymlinks` option is false (the default), the tsconfig path was
passed through realpath to ensure that the TypeScript source files were resolved
correctly. However, the promise version of the Node.js API was previously used.
This version used `realpath.native` internally but the native version has numerous
behavior problems on Windows systems. This includes potential case conversion
which can result in differing cases for files within the build system and in turn
failed path comparison checks. The synchronous version is now used which has a
JavaScript implementation that does not suffer from these problems.
…preserving symlinks

When not preserving symlinks (the default), the workspace root path should be converted
to the real path on the filesystem to ensure that resolution of all other path-based build
options reflects the actual location of the files. This ensures that typescript and esbuild
resolve files in a consistent manner and avoids hard to diagnose errors involving missing
files at build time.
@clydin clydin marked this pull request as ready for review November 22, 2023 20:21
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Nov 23, 2023
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Nov 23, 2023
@alan-agius4 alan-agius4 merged commit ba8541e into angular:main Nov 23, 2023
35 checks passed
@clydin clydin deleted the esbuild/avoid-native-realpath branch November 24, 2023 01:14
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File 'src\main.ts' is missing from the TypeScript compilation.
2 participants