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
Test for hard-to-detect recursive CLI calls #996
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scotttrinh
force-pushed
the
test-for-wrapper-script
branch
from
May 3, 2024 13:10
75c42bd
to
9042e18
Compare
Yarn Berry uses an even different scheme for running bin scripts: it unpacks the script into a temporary directory and adds that temporary directory into the shell's environment. This mitigate is by far the most expensive, so it's used dead-last to avoid the overhead. Looks like on yarn 4.1.1, the call that succeeds takes an additional 140ms, so that calling latency is added to every call of the package bin script here.
In the case of the cache being empty, or it pointing to a wrapper script, make sure we update the cache after we get a successful run from the CLI. This will not cache the location if the run failed, which could be common, but seems safer than always caching.
scotttrinh
force-pushed
the
test-for-wrapper-script
branch
from
May 3, 2024 15:02
715cba9
to
41c61db
Compare
scotttrinh
force-pushed
the
test-for-wrapper-script
branch
2 times, most recently
from
May 3, 2024 15:17
1ed9d6c
to
98d0a6b
Compare
scotttrinh
force-pushed
the
test-for-wrapper-script
branch
from
May 3, 2024 15:20
98d0a6b
to
7c0da9f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Yarn Berry uses an even different scheme for running bin scripts: it unpacks the script into a temporary directory and adds that temporary directory into the shell's environment.
This mitigate is by far the most expensive, so it's used dead-last to avoid the overhead. Looks like on yarn 4.1.1, the call that succeeds takes an additional 140ms. Updated the call order and caching strategy to cache successful runs of the CLI (if it differs from the current cached value) to speed this up on multiple runs from newer Yarn invocations.