Skip to content
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

Print better error, when installdeps fails due to shebang length limit #749

Closed
obestwalter opened this issue Jan 24, 2018 · 11 comments
Closed
Labels
area:testenv-creation bug:normal affects many people or has quite an impact needs:discussion It's not quite clear if and how this should be done

Comments

@obestwalter
Copy link
Member

obestwalter commented Jan 24, 2018

We improved the error reporting already by pointing to the "spaces in paths" problem (which prevents virtualenv creation IIRC). Now that same error occurs though in installdeps and is not helping there.

I guess we should add that info in the error. Shall we just mention both scenarios and let the user figure it out which it is?

reproducable with:

mkdir pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
cd pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
git clone https://github.com/obestwalter/i3configger
cd i3configger  
vwon tox && tox
Cloning into 'i3configger'...
remote: Counting objects: 2032, done.
remote: Total 2032 (delta 0), reused 0 (delta 0), pack-reused 2032
Receiving objects: 100% (2032/2032), 576.65 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (1279/1279), done.
GLOB sdist-make: /tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger/setup.py
tests create: /tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger/.tox/tests
tests installdeps: flake8, pytest
ERROR: invocation failed (errno 2), args: ['/tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger/.tox/tests/bin/pip', 'install', 'flake8', 'pytest'], cwd: /tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger
ERROR: Error creating virtualenv. Note that spaces in paths are not supported by virtualenv. Error details: FileNotFoundError(2, "No such file or directory: '/tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger/.tox/tests/bin/pip'")
__________________________________________________________________________________ summary ___________________________________________________________________________________
ERROR:   tests: Error creating virtualenv. Note that spaces in paths are not supported by virtualenv. Error details: FileNotFoundError(2, "No such file or directory: '/tmp/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/pad_80_charactersssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss/i3configger/.tox/tests/bin/pip'")

@obestwalter obestwalter added needs:discussion It's not quite clear if and how this should be done bug:normal affects many people or has quite an impact area:testenv-creation labels Jan 24, 2018
@asottile
Copy link
Contributor

Another strategy would be to work around the problem. pre-commit uses this and I'd be happy to package it up -- works great and enables shell scripts on windows

@obestwalter
Copy link
Member Author

Hi @asottile - that's a scary idea, but if this is a proven workaround could save us a lot of trouble ... I am +1 on trying that here.

@obestwalter
Copy link
Member Author

Looks like this is closed by #794 - @asottile, don't know if you followed that PR and forgot that you also had a solution for that. Care to have a look, if what we do for now is o.k.?

@asottile
Copy link
Contributor

didn't follow that PR though it looks similar to the approach taken by pre-commit and probably fixes this?

@asottile
Copy link
Contributor

the main difference being that pre-commit tries to make this work on windows as well :D

@obestwalter
Copy link
Member Author

obestwalter commented May 25, 2018

The addressed restriction is Linux Kernel specific (and behaves differently in different distros). Is there a similar problem on Windows during to that path length restriction (255 chars or something)? Would be good, if we could squash that also in tox then, if you already have a working solution (although you use "tries", which does not sound very confident :)).

For now, the merged PR is strictly opt-in, but I hope we can activate this then after collecting some experience with it.

@asottile
Copy link
Contributor

Right, the additional behaviour pre-commit adds is scripts with shebangs "just work" on windows (whereas they are usually a posix-only feature).

At least for pre-commit, this approach has been the only way to run executables since 0.8.0 (2016-04-11) and hasn't seen any major fixes since then (except a minor fix for "not found" in 0.8.2 (2016-05-20))

@obestwalter
Copy link
Member Author

that sounds like the way to go then :)

@asottile
Copy link
Contributor

I'll look into packaging this up over the weekend (if I have time)!

@asottile
Copy link
Contributor

didn't get to it this weekend :(, but I've put it on the top of my todo list

@obestwalter
Copy link
Member Author

I just tried to reproduce this with tox 3.5.3 and this is fixed now 🍾

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:testenv-creation bug:normal affects many people or has quite an impact needs:discussion It's not quite clear if and how this should be done
Projects
None yet
Development

No branches or pull requests

2 participants