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: tsconfig validator fails on chained tsconfig references #2512

Merged
merged 11 commits into from
Mar 17, 2021

Conversation

bduffany
Copy link
Contributor

@bduffany bduffany commented Mar 7, 2021

Fixes an issue (#2513) that the validator was always treating extends as a plain old file instead of reading TsConfigInfo to get transitive deps. See the added test case, which shows a realistic example that would fail to validate due to missing tsconfig.base.json (referenced by tsconfig.node.json, which itself is referenced by main/tsconfig.json)

(Note: one workaround in case anyone stumbles upon this PR is to use validate = False).

@google-cla google-cla bot added the cla: yes label Mar 7, 2021
@bduffany bduffany marked this pull request as draft March 7, 2021 04:13
@bduffany bduffany changed the title Add test for "chaining" tsconfigs using ts_project / ts_config fix: ts_project not working with chained tsconfig references Mar 7, 2021
@bduffany bduffany marked this pull request as ready for review March 7, 2021 05:31
@bduffany bduffany changed the title fix: ts_project not working with chained tsconfig references fix: tsconfig validator fails on chained tsconfig references Mar 7, 2021
@alexeagle
Copy link
Collaborator

Thanks for the help, do you think you'll be able to get the tests green?

@bduffany
Copy link
Contributor Author

bduffany commented Mar 8, 2021

Fixed most of the failing tests. There's a few that are still failing (on Windows only).

  • windows failure looks like an issue with compiling @types/jasmine and @types/jest, which seems unrelated.
  • windows_examples failure is error TS5033: Could not write file 'bazel-out/x64_windows-fastbuild/bin/car.spec.js': EPERM: operation not permitted, open 'bazel-out/x64_windows-fastbuild/bin/car.spec.js'. Seems unrelated to this PR.

@bduffany
Copy link
Contributor Author

Friendly ping -- would it be possible to re-run the Windows tests to see whether the failures are specific to this PR?

@alexeagle
Copy link
Collaborator

Hey sorry for the delay, juggling lots of things lately. You can always come ping me on slack if we're mostly done with a PR and a bit of attention is needed.

Yes those windows failures are legit. Actually they are failures in non-sandboxed mode, which you could reproduce on any platform, it's just that Windows is always in that mode.

What's happening is the typescript compiler does it's implicit look-around-the-disk to find ambient typings it can add to the program. When it does this, it finds typings we don't want to be included, they introduce conflicts with other typings. This is why we have types: [] in most tsconfig's to disable this feature and we are explicit about the typings we want in each compile.

@google-cla
Copy link

google-cla bot commented Mar 17, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Mar 17, 2021
@alexeagle
Copy link
Collaborator

@googlebot I consent.

@google-cla google-cla bot removed the cla: no label Mar 17, 2021
@google-cla google-cla bot added the cla: yes label Mar 17, 2021
Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@alexeagle alexeagle merged commit bfd74e5 into bazel-contrib:stable Mar 17, 2021
@bduffany
Copy link
Contributor Author

@alexeagle Thanks for finishing this off!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants