Tox: Print better error, when installdeps fails due to shebang length limit

Created on 24 Jan 2018  路  11Comments  路  Source: tox-dev/tox

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'")

testenv-creation normal discussion

Most helpful comment

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

All 11 comments

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

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.

Looks like this is closed by https://github.com/tox-dev/tox/pull/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.?

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

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

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.

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))

that sounds like the way to go then :)

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

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

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

Was this page helpful?
0 / 5 - 0 ratings