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(compiler-cli): only pass canonical genfile paths to compiler host #27062

Conversation

@devversion
Copy link
Member

@devversion devversion commented Nov 12, 2018

Fixes that the compiler-cli passes non-posix paths for JSON genfiles to the currently set up CompilerHost.

In a more specific scenario: Considering people use a custom TypeScript compiler host with NGC, they could expect only posix paths in methods like writeFile. This at first glance sounds like a trivial issue that should be just fixed by the actual compiler host, but usually TypeScript internal API's just pass around POSIX normalized paths, and therefore it would be good to follow the same standards when passing JSON genfiles to the CompilerHost#writeFile.


Fixes that the metadata for NgModule definitions which are created on the fly (through Bazel genrules) is not being written to the proper disk location.

The normalization is necessary because otherwise the custom CompilerHost within the Bazel TypeScript rules cannot flatten out the bazel-out/X-fastbuild/genfiles/ path segment.

See issue reproduction: devversion/issue-demo-genrule-ngmodule@363ec5a.

@devversion devversion force-pushed the fix/bazel-genfiles-ngmodule-summary branch from 2dca81e to a755079 Nov 12, 2018
@mary-poppins

This comment has been hidden.

@mary-poppins

This comment has been hidden.

@devversion devversion force-pushed the fix/bazel-genfiles-ngmodule-summary branch 2 times, most recently from 18ef5a4 to 57e136d Nov 12, 2018
In a more specific scenario: Considering people use a custom TypeScript compiler host with `NGC`, they _could_ expect only posix paths in methods like `writeFile`. This at first glance sounds like a trivial issue that should be just fixed by the actual compiler host, but usually TypeScript internal API's just pass around posix normalized paths, and therefore it would be good to follow the same standards when passing JSON genfiles to the `CompilerHost`.

For normal TypeScript files (and TS genfiles), this is already consistent because those will be handled by the actual TypeScript `Program` (see `emitCallback`).
@devversion devversion force-pushed the fix/bazel-genfiles-ngmodule-summary branch from 57e136d to 21021dc Nov 12, 2018
@angular angular deleted a comment from mary-poppins Nov 12, 2018
@angular angular deleted a comment from mary-poppins Nov 12, 2018
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Nov 12, 2018

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Nov 12, 2018

@alexeagle
Copy link
Contributor

@alexeagle alexeagle commented Nov 12, 2018

looks like mine will finish first :)
http://test/OCL:221162979:BASE:221163133:1542063674361:7ff89416

@alexeagle alexeagle removed the request for review from gregmagolan Nov 12, 2018
AndrewKushnir added a commit that referenced this issue Nov 13, 2018
…#27062)

In a more specific scenario: Considering people use a custom TypeScript compiler host with `NGC`, they _could_ expect only posix paths in methods like `writeFile`. This at first glance sounds like a trivial issue that should be just fixed by the actual compiler host, but usually TypeScript internal API's just pass around posix normalized paths, and therefore it would be good to follow the same standards when passing JSON genfiles to the `CompilerHost`.

For normal TypeScript files (and TS genfiles), this is already consistent because those will be handled by the actual TypeScript `Program` (see `emitCallback`).

PR Close #27062
@devversion devversion deleted the fix/bazel-genfiles-ngmodule-summary branch Nov 13, 2018
FrederikSchlemmer pushed a commit to FrederikSchlemmer/angular that referenced this issue Jan 3, 2019
…angular#27062)

In a more specific scenario: Considering people use a custom TypeScript compiler host with `NGC`, they _could_ expect only posix paths in methods like `writeFile`. This at first glance sounds like a trivial issue that should be just fixed by the actual compiler host, but usually TypeScript internal API's just pass around posix normalized paths, and therefore it would be good to follow the same standards when passing JSON genfiles to the `CompilerHost`.

For normal TypeScript files (and TS genfiles), this is already consistent because those will be handled by the actual TypeScript `Program` (see `emitCallback`).

PR Close angular#27062
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 14, 2019

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 Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants