Skip to content

Instead of storing timestamp of when last d.ts file was modified, store its name so buildinfo becomes portable again #49717

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

Merged
merged 6 commits into from
Jun 30, 2022

Conversation

sheetalkamat
Copy link
Member

As part of #31985, buildinfo was made portable but with latest change of store dts timestamp it looses that functionality.
With this change instead of storing timestamp of when the d.ts file was modified, we are storing name of that file so we can query its timestamp.
This also means, if d.ts files are same we wont rewrite them so the timestamp on disk can be trusted.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jun 28, 2022
@andrewbranch
Copy link
Member

How does this impact performance? Isn’t it more expensive to query those files?

@sheetalkamat
Copy link
Member Author

We are querying only single file output file stamp only once and cache. (ABuildinfo stores the file name which should be latest so we dont have to query multiple files).. And during updates we update the timestamp to current time just like for buildInfo.. so watch updates should not incur this cost...

@sheetalkamat
Copy link
Member Author

@andrewbranch i would like to get this in for 4.8

@amcasey
Copy link
Member

amcasey commented Jun 29, 2022

@sheetalkamat In this context, "portable" means that you can share a tsbuildinfo across machines?

@sheetalkamat
Copy link
Member Author

@amcasey Yes.

@amcasey
Copy link
Member

amcasey commented Jun 29, 2022

@amcasey Yes.

I'm not sure I understand why another box would have the same "most recent" file. Is the assumption that it emitted the same files in the same order?

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

Just a naming suggestion

@sheetalkamat
Copy link
Member Author

I'm not sure I understand why another box would have the same "most recent" file. Is the assumption that it emitted the same files in the same order?

#32023 talks about caching tsbuildinfo and outDir across directories.. Given everything is copied, the file name of latestChangedDtsFile shoudnt change so checking its timestamp should be ok.

Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

I didn't look at the logic change, but the concept and the baseline changes make sense.

@sheetalkamat sheetalkamat merged commit c251d60 into main Jun 30, 2022
@sheetalkamat sheetalkamat deleted the dtsTimePortable branch June 30, 2022 16:49
@Adjective-Object Adjective-Object mentioned this pull request Apr 9, 2024
5 tasks
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.

4 participants