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

Skip up-to-date checks during force build #43666

Merged
merged 4 commits into from Apr 19, 2021
Merged

Conversation

amcasey
Copy link
Member

@amcasey amcasey commented Apr 14, 2021

Save work by not checking timestamps or parsing the buildinfo file.
Retain correctness checks (like input file existence).

Suppress project status, which was confusing anyway.

Save work by not checking timestamps or parsing the buildinfo file.
Retain correctness checks (like input file existence).

Suppress project status, which was confusing anyway.
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 14, 2021
@amcasey
Copy link
Member Author

amcasey commented Apr 14, 2021

If we think it's important to print a status message, I'd rather add a new one explaining that it's being forced.

Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

Not able to comment at location but you can put !force flag in addition here as well

// Check oldest output file name only if there is no missing output file name
                if (!missingOutputFileName) {
                    // If the upstream project's newest file is older than our oldest output, we
                    // can't be out of date because of it
                    if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
                        continue;
                    }
                    // If the upstream project has only change .d.ts files, and we've built
                    // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
                    if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
                        pseudoUpToDate = true;
                        upstreamChangedProject = ref.path;
                        continue;
                    }
                    // We have an output older than an upstream output - we are out of date
                    Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
                    return {
                        type: UpToDateStatusType.OutOfDateWithUpstream,
                        outOfDateOutputFileName: oldestOutputFileName,
                        newerProjectName: ref.path
                    };
                }

src/compiler/tsbuildPublic.ts Outdated Show resolved Hide resolved
@amcasey
Copy link
Member Author

amcasey commented Apr 16, 2021

Not able to comment at location but you can put !force flag in addition here as well

// Check oldest output file name only if there is no missing output file name
                if (!missingOutputFileName) {
                    // If the upstream project's newest file is older than our oldest output, we
                    // can't be out of date because of it
                    if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
                        continue;
                    }
                    // If the upstream project has only change .d.ts files, and we've built
                    // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
                    if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
                        pseudoUpToDate = true;
                        upstreamChangedProject = ref.path;
                        continue;
                    }
                    // We have an output older than an upstream output - we are out of date
                    Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
                    return {
                        type: UpToDateStatusType.OutOfDateWithUpstream,
                        outOfDateOutputFileName: oldestOutputFileName,
                        newerProjectName: ref.path
                    };
                }

I expected that to be undefined since the previous !force check would prevent it from being set. Would you like me to add an assert?

@sheetalkamat
Copy link
Member

Hmm for some reason i think it will be evaluated because missingOutputFileName is going to be undefined? as we are not doing those checks any more. assert would be nice if thats not the case

@amcasey
Copy link
Member Author

amcasey commented Apr 16, 2021

Hmm for some reason i think it will be evaluated because missingOutputFileName is going to be undefined? as we are not doing those checks any more. assert would be nice if thats not the case

I think this is your way of telling me I read it backwards. 😄

Edit: Turns out it wasn't asserting because oldestOutputFileTime was set to max-date so the if before the assert was true, causing it to be skipped. Obviously, checking explicitly is better.

@amcasey amcasey merged commit c671fe1 into microsoft:master Apr 19, 2021
@amcasey amcasey deleted the ForceFast branch April 19, 2021 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants