pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.53k stars 1.19k forks source link

IndexError: list index out of range for MSVC linking code #4751

Closed rsxdalv closed 1 week ago

rsxdalv commented 1 week ago

https://github.com/pypa/setuptools/blob/540001561bc2c6766940ba5fd6247735c1a3a290/setuptools/_distutils/_msvccompiler.py#L527

https://github.com/rsxdalv/DeepSpeed/actions/runs/11838191985/job/32986772363#step:5:875

 building 'deepspeed.ops.comm.deepspeed_not_implemented_op' extension
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "D:\a\DeepSpeed\DeepSpeed\setup.py", line 306, in <module>
      setup(name='deepspeed',
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\wheel\_bdist_wheel.py", line 387, in run
      self.run_command("build")
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
      self.run_command(cmd_name)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
      _build_ext.run(self)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run
      self.build_extensions()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\torch\utils\cpp_extension.py", line 870, in build_extensions
      build_ext.build_extensions(self)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 466, in build_extensions
      self._build_extensions_serial()
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 492, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\command\build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 571, in build_extension
      self.compiler.link_shared_object(
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\ccompiler.py", line 751, in link_shared_object
      self.link(
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 495, in link
      build_temp = os.path.dirname(objects[0])
  IndexError: list index out of range
abravalheri commented 1 week ago

Hi @rsxdalv could you please go through the form for bug reports and include a minimal reproducer for investigation? (Please create a new issue and select "Bug Report").

Since this also seem to be related to https://github.com/pypa/distutils we may also have to engage with that repo.

rsxdalv commented 1 week ago

I see, the bug report template does not work when creating an issue from the line number, and the _distutils is not owner by this repo despite being copied here.