Skip to content

Build fails for unlinkable_fobjects across windows drive boundaries #16107

Closed

Description

@eric-wieser

Found from a CI run:

  Running from numpy source directory.
  c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  Traceback (most recent call last):
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
      main()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 205, in build_wheel
      metadata_directory)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 213, in build_wheel
      wheel_directory, config_settings)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 198, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 488, in <module>
      setup_package()
    File "setup.py", line 480, in setup_package
      setup(**metadata)
    File "D:\a\1\s\numpy\distutils\core.py", line 169, in setup
      return old_setup(**new_attr)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\a\1\s\numpy\distutils\command\build.py", line 40, in run
      old_build.run(self)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 272, in run
      self.build_extensions()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "setup.py", line 260, in build_extension
      build_ext.build_extension(self, ext)
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 478, in build_extension
      unlinkable_fobjects)
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 523, in _process_unlinkable_fobjects
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 523, in <listcomp>
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\ntpath.py", line 584, in relpath
      path_drive, start_drive))
  ValueError: path is on mount 'c:', start on mount 'D:'
  ERROR: Failed building wheel for numpy
  Building wheel for numpy (PEP 517): finished with status 'error'
Failed to build numpy
ERROR: Failed to build one or more wheels
Exception information:
Traceback (most recent call last):
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
    status = self.run(options, args)
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\commands\wheel.py", line 189, in run
    "Failed to build one or more wheels"
pip._internal.exceptions.CommandError: Failed to build one or more wheels

Activity

  1. mattip commented on Apr 29, 2020

    @mattip
    Member

    Good to have this issue so that error, if it ever comes back to haunt us, is searchable. #16101 is meant to solves this, please reopen if needed.

  2. eric-wieser commented on Apr 29, 2020

    @eric-wieser
    MemberAuthor

    As it read it, that PR avoids the broken case, rather than actually fixing numpy.distutils to be able to handle this case.

  3. mattip commented on Apr 29, 2020

    @mattip
    Member

    OK, reopening

  4. reopened this on Apr 29, 2020
  5. tylerjereddy commented on Apr 29, 2020

    @tylerjereddy
    Contributor

    Pretty sure it is this: https://bugs.python.org/issue7195

    Perhaps there's a way to switch fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects] to use absolute paths in numpy/distutils/command/build_ext.py.

    It may also mean that wrap_unlinkable_objects (in numpy/distutils/fcompiler/gnu.py) needs to handle absolute paths if it doesn't already.

  6. eric-wieser commented on Apr 29, 2020

    @eric-wieser
    MemberAuthor

    Yeah, I think the fix here would be to work with absolute paths if possible, or emit a better error message if not.

  7. tylerjereddy commented on Apr 30, 2020

    @tylerjereddy
    Contributor

    Here's the documentation I was talking about: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#avoid-hard-coded-references

    When you use a Microsoft-hosted agent, always use variables to refer to the build environment and agent resources. For example, don't hard-code the drive letter or folder that contains the repository. The precise layout of the hosted agents is subject to change without warning.

    Anyway, that's slightly off-topic for this specific issue, but worth keeping in mind long-term.

  8. mattip commented on Apr 30, 2020

    @mattip
    Member

    One problem with absolute paths may be feeding them to a migw-based compiler, so tests to prove this works will be needed

  9. eric-wieser commented on May 1, 2020

    @eric-wieser
    MemberAuthor

    Duplicate of #12530

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions