You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is occuring on Windows build agents on Github Actions, when we updated to start building for Python 3.12 (and hence had to switch to using setuptools' distutils fork). Previously we had SETUPTOOLS_USE_DISTUTILS=stdlib set due to an old numpy issue.
This issue is related in the error code to pypa/setuptools#3591, but the issue there doesn't seem to be the same
Description
When we switch from SETUPTOOLS_USE_DISTUTILS=stdlib to the default of local, we started seeing [WinError 206] The filename or extension is too long (though we had to patch distutils to stop it from swallowing this exception and only returning failed: None)
After further investigation, we found that the call to link.exe was longer than the 32766 characters permitted by Windows, hence causing the above error.
For now, we've worked around this by patching distutils to call GetShortPathNameW, which manages to shorten the call by around 12000 characters
Expected behavior
The call to link.exe should be shorter than the maximum allowed by Windows, and compilation should succeed, as it did with the version of distutils includes in < Python 3.12
2024-01-05T18:46:26.5479903Z Traceback (most recent call last):
2024-01-05T18:46:26.5485629Z File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-b6b5ns6s\overlay\Lib\site-packages\setuptools\_distutils\spawn.py", line 57, in spawn
2024-01-05T18:46:26.5486556Z proc = subprocess.Popen(cmd, env=env)
2024-01-05T18:46:26.5486909Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-01-05T18:46:26.5487748Z File "C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.12.0\tools\Lib\subprocess.py", line 1026, in __init__
2024-01-05T18:46:26.5488652Z self._execute_child(args, executable, preexec_fn, close_fds,
2024-01-05T18:46:26.5489592Z File "C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.12.0\tools\Lib\subprocess.py", line 1538, in _execute_child
2024-01-05T18:46:26.5490616Z hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
2024-01-05T18:46:26.5491062Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-01-05T18:46:26.5491559Z FileNotFoundError: [WinError 206] The filename or extension is too long
2024-01-05T18:46:26.5491996Z
2024-01-05T18:46:26.5492336Z The above exception was the direct cause of the following exception:
2024-01-05T18:46:26.5492748Z
2024-01-05T18:46:26.5492952Z Traceback (most recent call last):
2024-01-05T18:46:26.5493379Z File "<string>", line 56, in spawn_with_compiler_launcher
2024-01-05T18:46:26.5494346Z File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-b6b5ns6s\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 517, in spawn
2024-01-05T18:46:26.5495223Z return super().spawn(cmd, env=env)
2024-01-05T18:46:26.5495538Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-01-05T18:46:26.5496382Z File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-b6b5ns6s\overlay\Lib\site-packages\setuptools\_distutils\ccompiler.py", line 1041, in spawn
2024-01-05T18:46:26.5497250Z spawn(cmd, dry_run=self.dry_run, **kwargs)
2024-01-05T18:46:26.5498111Z File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-b6b5ns6s\overlay\Lib\site-packages\setuptools\_distutils\spawn.py", line 63, in spawn
2024-01-05T18:46:26.5498995Z raise DistutilsExecError(
2024-01-05T18:46:26.5499949Z distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed: None
The text was updated successfully, but these errors were encountered:
Originally raised as pypa/setuptools#4177, see there for more context
setuptools version
setuptools==69.0.3
Python version
Python 3.12
OS
Windows
Additional environment information
This is occuring on Windows build agents on Github Actions, when we updated to start building for Python 3.12 (and hence had to switch to using setuptools' distutils fork). Previously we had SETUPTOOLS_USE_DISTUTILS=stdlib set due to an old numpy issue.
This issue is related in the error code to pypa/setuptools#3591, but the issue there doesn't seem to be the same
Description
When we switch from SETUPTOOLS_USE_DISTUTILS=stdlib to the default of
local
, we started seeing[WinError 206] The filename or extension is too long
(though we had to patch distutils to stop it from swallowing this exception and only returningfailed: None
)After further investigation, we found that the call to
link.exe
was longer than the 32766 characters permitted by Windows, hence causing the above error.For now, we've worked around this by patching distutils to call GetShortPathNameW, which manages to shorten the call by around 12000 characters
Expected behavior
The call to link.exe should be shorter than the maximum allowed by Windows, and compilation should succeed, as it did with the version of distutils includes in < Python 3.12
How to Reproduce
pip install -e .
intools/pythonpkg
on Windows 10+Output
Command in question:
Details
When patched to dump the stack trace:
The text was updated successfully, but these errors were encountered: