Skip to content

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.

@amcasey amcasey requested a review from sheetalkamat April 16, 2021 17:49
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
                    };
                }

@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?

@amcasey amcasey requested a review from sheetalkamat April 16, 2021 22:57
@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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants