Getting "Invalid cross-device link" error while running make

System Specs:
OS: Windows 10
Terminal: WSL ubuntu

ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.10/shutil.py", line 816, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-g97xpu2_/lib/python/plone' -> '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/d/Volto/volto/api/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "/mnt/d/Volto/volto/api/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
    return func(self, options, args)
  File "/mnt/d/Volto/volto/api/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 510, in run
    self._handle_target_dir(
  File "/mnt/d/Volto/volto/api/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 569, in _handle_target_dir
    shutil.move(os.path.join(lib_dir, item), target_item_dir)
  File "/usr/lib/python3.10/shutil.py", line 832, in move
    copytree(src, real_dst, copy_function=copy_function,
  File "/usr/lib/python3.10/shutil.py", line 559, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.10/shutil.py", line 513, in _copytree
    raise Error(errors)
shutil.Error: [('/tmp/pip-target-g97xpu2_/lib/python/plone/app/locales/locales/sr@Cyrl', '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone/app/locales/locales/sr@Cyrl', "[Errno 17] File exists: '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone/app/locales/locales/sr@Cyrl'"), ('/tmp/pip-target-g97xpu2_/lib/python/plone/app/locales/locales/sr@latn', '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone/app/locales/locales/sr@latn', "[Errno 17] File exists: '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone/app/locales/locales/sr@latn'")]

Hrittik RoyChoudhury via Plone Community wrote at 2024-2-26 17:10 +0000:

System Specs:
OS: Windows 10
Terminal: WSL ubuntu

ERROR: Exception:
Traceback (most recent call last):
 File "/usr/lib/python3.10/shutil.py", line 816, in move
   os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-g97xpu2_/lib/python/plone' -> '/mnt/d/Volto/volto/api/eggs/tmp8u69bvrl/plone'

The error indicates that a move is tried from "/tmp" to "/mnt/d"
and that this is across a file system boundary:
os.rename cannot move objects between file systems.

Under *nix, you could use the envvar TMPDIR to control where
tempoary files are placed and thereby ensure that the temporary files,
too, are located on "/mnt/d".
Not sure how you can achieve this under Windows.

1 Like

Thanks! It worked after changing my "tmp" location :+1: