-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use the pants native-client if it is present in the distribution. #172
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
jsirois
reviewed
May 9, 2023
stuhood
force-pushed
the
stuhood/native-client
branch
from
May 9, 2023 20:39
4956b01
to
f08a44c
Compare
stuhood
force-pushed
the
stuhood/native-client
branch
from
May 9, 2023 20:56
f08a44c
to
166ea11
Compare
stuhood
added a commit
to pantsbuild/pants
that referenced
this pull request
May 10, 2023
The Pants native client which was introduced in #11922 has so far only been usable in the Pants repo when the `USE_NATIVE_PANTS` environment variable was set. To make the native client available to end users, this change begins distributing the native-client binary in Pants wheels. A corresponding change in the `scie-pants` repo (pantsbuild/scie-pants#172) uses the native client to run `pants`. To reduce the surface area of `scie-pants` (rather than having it be responsible for handling the special `75` exit code similar to the `pants` script integration), this PR also moves to having the native-client execute its own fallback (via `execv`) to the Pants entrypoint. In future, the `pantsbuild/pants` `pants` script could also use that facility (e.g. by specifying a separate `pants_server` bash script as the entrypoint to use as the `_PANTS_SERVER_EXE`). ---- As originally demonstrated on #11831, the native client is still much faster than the legacy client. Using pantsbuild/scie-pants#172, the timings look like: ``` Benchmark #1: PANTS_NO_NATIVE_CLIENT=true PANTS_SHA=836cceb74e6af042e7c82677f3ceb4927efce20e scie-pants-macos-x86_64 help Time (mean ± σ): 1.161 s ± 0.067 s [User: 830.6 ms, System: 79.2 ms] Range (min … max): 1.054 s … 1.309 s 10 runs Benchmark #2: PANTS_SHA=836cceb74e6af042e7c82677f3ceb4927efce20e scie-pants-macos-x86_64 help Time (mean ± σ): 271.0 ms ± 30.6 ms [User: 8.9 ms, System: 6.9 ms] Range (min … max): 241.5 ms … 360.6 ms 12 runs Summary 'PANTS_SHA=836cceb74e6af042e7c82677f3ceb4927efce20e scie-pants-macos-x86_64 help' ran 4.29 ± 0.54 times faster than 'PANTS_NO_NATIVE_CLIENT=true PANTS_SHA=836cceb74e6af042e7c82677f3ceb4927efce20e scie-pants-macos-x86_64 help' ``` Fixes #11831.
jsirois
approved these changes
May 11, 2023
Adjusted for pantsbuild/pants#19010 |
stuhood
force-pushed
the
stuhood/native-client
branch
from
May 15, 2023 21:03
01dc90c
to
65928af
Compare
jsirois
approved these changes
May 15, 2023
If you want to roll in the version bump & CHANGES entry, this could go straight to release. |
kaos
approved these changes
May 15, 2023
stuhood
added a commit
to pantsbuild/pants
that referenced
this pull request
May 15, 2023
On pantsbuild/scie-pants#172, @jsirois pointed out that allowing the native-client to handle disabling itself (if requested) would be much cleaner from a `scie-pants` perspective, and keeping `scie-pants` as small and simple as possible is an important goal. This change moves `PANTS_NO_NATIVE_CLIENT` handling into the native client.
stuhood
force-pushed
the
stuhood/native-client
branch
from
May 15, 2023 21:22
65928af
to
8990d10
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.
This change uses the
native-client
binary included inpantsbuild/pants
wheels by pantsbuild/pants#18957 (and further adjusted in pantsbuild/pants#19010) to launchpants
. See that change for the performance impact.