Skip to content

tox4: infinite recursivity if any plugin is added to requires (regression) #2414

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

Closed
ssbarnea opened this issue May 6, 2022 · 1 comment
Closed
Assignees
Labels
bug:normal affects many people or has quite an impact
Milestone

Comments

@ssbarnea
Copy link
Member

ssbarnea commented May 6, 2022

Calling tox with tox 4 will produce an infinite loop, something that is not happening with tox 3.

[tox]
# adding any tox plugin below would trigger the recursive bug when calling tox
requires =
    tox-gh-actions
    # tox-extra

[testenv]
commands =
    tox --showconfig
deps = tox>=4.0.0b2

I do need to call tox from within an environment as I am testing some integration with it as my tool does parse the output of tox --showconfig. That worked fine for tox 3 but seems to fail with tox 4.

It seems that what is causing the loop is the requires =, as it puts tox into a loop of truing to provision itself:

  File "/Users/ssbarnea/c/a/zzz/.tox/.tox/.tox/.tox/.tox/.tox/.tox/.tox/lib/python3.10/site-packages/tox/tox_env/python/pip/req/file.py", line 14, in <module>
    import chardet
  File "/Users/ssbarnea/c/a/zzz/.tox/.tox/.tox/.tox/.tox/.tox/.tox/.tox/lib/python3.10/site-packages/chardet/__init__.py", line 19, in <module>
    from .universaldetector import UniversalDetector
  File "/Users/ssbarnea/c/a/zzz/.tox/.tox/.tox/.tox/.tox/.tox/.tox/.tox/lib/python3.10/site-packages/chardet/universaldetector.py", line 48, in <module>
    from .sbcsgroupprober import SBCSGroupProber
  File "/Users/ssbarnea/c/a/zzz/.tox/.tox/.tox/.tox/.tox/.tox/.tox/.tox/lib/python3.10/site-packages/chardet/sbcsgroupprober.py", line 37, in <module>
    from .langrussianmodel import (IBM855_RUSSIAN_MODEL, IBM866_RUSSIAN_MODEL,
KeyboardInterrupt
@ssbarnea ssbarnea added the bug:normal affects many people or has quite an impact label May 6, 2022
@gaborbernat gaborbernat added this to the 4.0 milestone May 8, 2022
@ssbarnea
Copy link
Member Author

ssbarnea commented May 19, 2022

IMHO, this is likely not caused by the plugins themselves and only by the presence of requires. What is likely happening is that when tox is called from within a virtualenv it will happen while the current directory is proj/.tox instead of prof and it attempts to reprovision itself while using this folder as root. We can guess that this will produce an endless loop of reprovisioning.

What we are likely to need is to ensure that once provisioned, we re-use it and not attempt to do it again, or at least ensure that we do not try to provision to wrong folder.

@ssbarnea ssbarnea self-assigned this Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
ssbarnea added a commit to ssbarnea/tox that referenced this issue Nov 26, 2022
gaborbernat added a commit that referenced this issue Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:normal affects many people or has quite an impact
Projects
None yet
Development

No branches or pull requests

2 participants