-
Notifications
You must be signed in to change notification settings - Fork 60
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
When delocate is called with a non-expanded wildcard path it produces wrong result #71
Comments
UPD: It's worse now — recently, |
I think, it's v0.10.5, after all: the last successful nightly build we had was on Nov 13 and since Nov 14, the macOS builds started failing. This correlates with the release date of v0.10.5 which happened on Nov 14, right in-between these CI cron runs. |
I addressed this by expanding the wildcard outside the delocate invocation: ansible/pylibssh@025166d. |
@webknjaz What's the regression caused by v0.10.5? I mean what's the error output? If the shell doesn't the expand the paths then delocate and probably most CLI's will take the path as-is. I don't see this as unexpected behavior but I don't think anyone would mind if delocate globbed the paths itself. Should also add tests related to globbing. |
Looking into this more there are some edge cases which could be pretty devastating. Globs include character ranges inside of brackets I'd highly recommend using the shell more effectively rather than trying to add a workaround in the delocate scripts. Once unexplanded globs are sent to the script it seems too late to make a clean and effective workaround. Trying to do so anyway may add shell-like problems into the script itself. The problems caused by the workaround can be fixed with their own workarounds, but at this point I'd like to hear more opinions on this before I continue. |
(UPD: fixed the commit link)
Yep. Although, it did work during the past 3 years. I only had to double-wrap it today. Since it's called from within FWIW, it fails like this: https://github.com/ansible/pylibssh/actions/runs/7025841421/job/19117524211#step:10:61. It attempts to open a glob as string. And I understand that it's usually better to get the external shell to expand stuff, but it's not always as straightforward when it's not called from shell. Wrapping a command with Anyway, there are tools for this in the stdlib: I'm not asking to interpret shell-specific syntax like |
FTR I do think that a fix on the tox level would be preferable: tox-dev/tox#1571. So this is not a call to implement it unconditionally. Some test coverage would indeed be nice for predictability in the future. But beyond that, probably wouldn't insist. |
I looked at #106 again. It does not affect the file path given to Right now I can only guess that something in
The problem I see is those square bracket patterns. A poorly named file such as I agree that it'd be better to fix this issue in Tox. Tox actually runs commands and should have some support for shell expansion. Though they seem to be having their own issues with their command syntax. |
Yes, that PR only appeared in v0.10.6. I posted above in this issue that the behavior changed in v0.10.5. I discovered this after posting the comment in the PR, but only clarified this in the issue comment 🤷♂️ |
Yes, which is why I filed that linked issue there. Bernát is open to a feature, but I never got to making a PR.. |
Let's mark the issue as |
I've compared v0.10.5 to the previous version. The change in behavior comes from an update in the I already have some code which will resolve this but I want to make sure it's reasonable before I make a PR. |
Imagine you call
python -m delocate.cmd.delocate_listdeps --all dist/*.whl
in the env wheredist/*.whl
is not expanded by the shell so it's effectivelypython -m delocate.cmd.delocate_listdeps --all 'dist/*.whl'
. And the dists dir has:-rw-r--r-- 1 runner staff 144K Apr 28 08:30 ansible_pylibssh-0.0.1.dev1-cp38-cp38-macosx_10_9_x86_64.whl
It'll use
dist/ansible_pylibssh-0.0.1.dev1-cp38-cp38-macosx_10_9_x86_64.whl
as a source and will emit a wheel with the namedist/*.whl
:which then makes
twine check dist/*.whl
explode: pypa/twine#612.It looks like delocate applies glob in one place but not another which is a bug.
The text was updated successfully, but these errors were encountered: