-
Notifications
You must be signed in to change notification settings - Fork 17
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
pants tailor --check ::
fails with Unknown flag --check on global scope
with new PEX distribution mechanism
#249
Comments
I tried a bisect, but running with Suspiciously, the 2.18.0.dev5 release is when we switched to publishing the platform specific PEXes for scie-pants 0.9+ to read (compare 'assets'):
So, may be this is an issue with the new distribution mechanism?! Running with scie-pants 0.8.2 instead of 0.9+, to force the use of PyPI-based wheels indeed works: cd $(mktemp -d)
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.18.0.dev5"
backend_packages = ["pants.backend.python"]
EOF
# adjust to your platform:
platform=macos-aarch64
for version in 0.8.2 0.9.0; do
curl -L -o scie-pants-$version https://github.com/pantsbuild/scie-pants/releases/download/v$version/scie-pants-$platform
chmod +x scie-pants-$version
echo "*** With $version"
./scie-pants-$version tailor --check ::
echo "*** Exit: $?"
done Output:
i.e. 0.8.2 (using old distribution mechanism) passes, 0.9.0 (using new mechanism) fails. Why would using the PEX change behaviour here? I'm afraid that's a question I don't yet know the answer to. |
pants tailor --check ::
fails with Unknown flag --check on global scope Did you mean --check-only or --tailor-check?
pants tailor --check ::
fails with Unknown flag --check on global scope Did you mean --check-only or --tailor-check?
with new PEX distributions
pants tailor --check ::
fails with Unknown flag --check on global scope Did you mean --check-only or --tailor-check?
with new PEX distributionspants tailor --check ::
fails with Unknown flag --check on global scope
with new PEX distribution mechanism
More research:
|
Here's the similar invocation with dev4, that works:
Difference seems to be |
Ah, breadcrumbs:
Now, seems like we could either or both of:
|
Those are some very helpful breadcrumbs! Thanks a bunch for digging into this. According to
scie-pants provides this arg is so that PANTS_SHA invocations will find the right version of Pants.
Considering that The user can, of course, still specify these things manually (albeit a bit of a PITA), use an older version of |
And for full transparency/posterity, I believe this behavior was simply inherited from |
Definitely seems like this should be what we want: |
Great detective work BTW! |
The Deprecating and removing the I guess it'd also make sense to file a feature request with scie about passing an argument conditionally, which I'll do in a while too. |
We can get rid of |
Filed a-scie/jump#130 for the base scie-jump feature. To summarise: there's 3 related things that this issue reveals:
I'd suggest that #250 seems like the appropriate path forward in the short term, unless scie-jump is improved quickly. |
Currently, the `scie-pants` launcher sometimes needs to pass an additional argument to the underlying pants invocation, to be able to support `PANTS_SHA` and its custom wheel location. Effectively turning an invocation like `pants goal --arg` into `pants --pants-repos-find-links=+["..."] goal --arg` when appropriate: https://github.com/pantsbuild/scie-pants/blob/0a204c5ac816ad24d74b55ecf7424397a07b3c2a/package/scie-pants.toml#L57-L60 However, when not using `PANTS_SHA`, the pants command becomes `pants "" goal --arg`, and the spurious empty string results in some commands failing, e.g. `pants "" tailor --check` thinks `--check` is a global argument, and this is ambiguous. To fix this issue, this PR does two things: 1. avoid passing an empty string, via a no-op workaround: always set the `PANTS_SHA_FIND_LINKS` variable (to a no-op like `--python-repos-find-links=-[]`), so that scie-pants never passes an empty variable to the pants command, since that makes commands like `pants tailor --check ::` explode: 2. deprecates `PANTS_SHA`, so that the hack above doesn't feel so bad: we're on the way to removing the need for `PANTS_SHA_FIND_LINKS` entirely, thus sidestepping the limitation and the need for the workaround (2) This could also be fixed via a-scie/jump#130. Fixes #249
Ah you're right, I think this is the relevant code (although it uses |
I think you may have missed the fact that scie-pants already deals with variable argument lists (which scie-jump does not support). See the |
Describe the bug
In 2.18.0.dev5 and beyond,
pants tailor --check ::
stops working when run under scie-pants 0.9.0 or greater.This invocation is likely to be widespread, as it is suggested by docs and examples. It'd be really good to not break (at least, not without deprecation warnings)
Reproducer:
Changing the version to 2.18.0.dev4 passes (no output).
Pants version
2.18.0.dev5 to 2.18.0a0 at the time of writing
scie-pants 0.9.0, 0.9.3
OS
macOS and Linux
Additional info
Nothing leaps out at me. I haven't run aSee first comment: it's the switch to PEX distributionsgit bisect
though.The text was updated successfully, but these errors were encountered: