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 seenEmittedFiles which was not being set when emit of a file was complete #33145

Merged
merged 11 commits into from
Aug 30, 2019

Conversation

sheetalkamat
Copy link
Member

It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles and not seenAffectedFiles)
If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly.
Fixes #31398

Thanks to @ericanderson and @bjlaub for getting us the repro.

As part of this I also found out that when --declarationMap is on in project we were using .d.ts.map instead of .d.ts as signature which is not desirable (since the map can change without changing d.ts resulting in complete refresh even if it didn't affect .d.ts). I have fixed this in this PR along with ensuring that we have test case for that. Changed the createHash of SolutionBuilderHost for tests to emit signature-content so that its easily diagnosable.

…as complete.

It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles)
If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly
Fixes #31398
@sheetalkamat
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 6587bd7. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/42118/artifacts?artifactName=tgz&fileId=D7C867F4A9EB25F33E7B70CC6B71AD36B5A48574F1C89E363233134C08318FC302&fileName=/typescript-3.7.0-insiders.20190829.tgz"
    }
}

and then running npm install.

@bjlaub
Copy link

bjlaub commented Aug 30, 2019

@sheetalkamat I ran this branch on our production codebase test case (from #33061 (comment)) and it seems to fix the issue! Thanks so much for getting this resolved!

@ericanderson
Copy link
Contributor

ericanderson commented Aug 30, 2019

@sheetalkamat Will this be in 3.6.x?

@sheetalkamat
Copy link
Member Author

Will this be in 3.6.x?

yes

@@ -214,6 +215,10 @@ namespace ts {
if (fileExtensionIs(inputFileName, Extension.Dts)) continue;
const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase);
if (jsFilePath) return jsFilePath;
if (fileExtensionIs(inputFileName, Extension.Json)) continue;
if (getEmitDeclarations(configFile.options) && hasTSFileExtension(inputFileName)) {
Copy link
Member

Choose a reason for hiding this comment

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

quick note for @weswigham: this new line will probably need when bringing the js-to-dts PR up to date with master

@sheetalkamat
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.6

@typescript-bot
Copy link
Collaborator

Hey @sheetalkamat, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-3.6 manually.

@sheetalkamat sheetalkamat merged commit 79bcb3d into master Aug 30, 2019
@sheetalkamat sheetalkamat deleted the builderCircularity branch August 30, 2019 23:33
sheetalkamat added a commit that referenced this pull request Aug 30, 2019
implement create Hash to be default hashing plus data so we can verify it easily in baseline
sheetalkamat added a commit that referenced this pull request Aug 31, 2019
implement create Hash to be default hashing plus data so we can verify it easily in baseline
timsuchanek pushed a commit to timsuchanek/TypeScript that referenced this pull request Sep 11, 2019
…as complete (microsoft#33145)

* Add test that fails because file is written multiple times
Reported from microsoft#33061

* Handle seenEmittedFiles which was not being set when emit of a file was complete.
It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles)
If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly
Fixes microsoft#31398

* make baselining source map optional

* Handle emitDeclarationOnly in --build scenario

* Ensure we are using d.ts emit as signature even when --declarationMap is on (map files are emitted before d.ts)

* Move module specifiers to verifyTsBuildOutput

* implement create Hash to be default hashing plus data so we can verify it easily in baseline

* Remove failing baseline

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

Successfully merging this pull request may close these issues.

tsc instance reuse in composite project causes out of memory crash
5 participants