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

Include windir by default in pass_env #3302

Closed
kurtmckee opened this issue Jun 30, 2024 · 1 comment · Fixed by #3303
Closed

Include windir by default in pass_env #3302

kurtmckee opened this issue Jun 30, 2024 · 1 comment · Fixed by #3303

Comments

@kurtmckee
Copy link
Contributor

What's the problem this feature will solve?

When running tools in a tox environment, some applications require that the WINDIR environment variable exists. The existence of that environment variables is guaranteed since Windows 95, and no application ever documents this requirement.

I've learned this through years of past experience, but bumped into this again today with this minimal reproducer tox.ini on Windows (assuming a proper project exists):

[testenv:build]
deps = poetry
commands = poetry build

Running this shows the following output (note the "system cannot find the path specified" messages):

build: commands[0]> poetry build
Building sqliteimport (0.2.0)
  - Building sdist
The system cannot find the path specified.
  - Built sqliteimport-0.2.0.tar.gz
  - Building wheel
The system cannot find the path specified.
  - Built sqliteimport-0.2.0-py3-none-any.whl

This is ultimately happening because Poetry assumes that it can call %WINDIR%\System32\where.exe to find the git executable:

if WINDOWS:
    # Finding git via where.exe
    where = "%WINDIR%\\System32\\where.exe"

While I can hunt this down in an open source Python project, this type of failure is very difficult to identify in compiled executables.

Describe the solution you'd like

I want to add the windir environment variable to the list of default environment variables included in pass_env, because it is just as critical as TMP and USERPROFILE.

Alternative Solutions

There's no alternative solution. Tox can add windir to the default list of pass_env, or developers will individually have to figure out for themselves how to resolve failures with some Windows applications run by tox.

Additional context

@gaborbernat
Copy link
Member

PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants