Skip to content

"OSError: [Errno 18] Invalid cross-device link" occurs inside a Docker container on macOS #5838

@XhstormR

Description

@XhstormR

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

On macOS, to build https://github.com/conda-forge/uutils-coreutils-feedstock, execute the script ./build-locally.py, select Linux, and start building using a Docker container. After downloading and extracting the source code tar package, an error occurs when trying to move it.

maybe related:
#2449
stepchowfun/docuum#109

Conda Info

Conda Config

Conda list

Additional Context

full log: log.txt
error log:

Source cache directory is: /home/conda/feedstock_root/build_artifacts/debug_1762788222962/src_cache
Downloading source to cache: 0.3.0_422b4bab88.tar.gz
Downloading https://github.com/uutils/coreutils/archive/0.3.0.tar.gz
Success
Extracting download

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.12/shutil.py", line 847, in move
        os.rename(src, real_dst)
    OSError: [Errno 18] Invalid cross-device link: '/home/conda/feedstock_root/build_artifacts/debug_1762788222962/tmp16ylqiuu/coreutils-0.3.0/src' -> '/tmp/tmpkxw5lh0r/src'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.12/site-packages/conda/exception_handler.py", line 28, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.12/site-packages/conda/cli/main.py", line 61, in main_subshell
        exit_code = do_call(args, parser)
                    ^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.12/site-packages/conda/cli/conda_argparse.py", line 181, in do_call
        result = plugin_subcommand.action(getattr(args, "_args", args))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.12/site-packages/conda_build/plugin.py", line 30, in debug
        return execute(args)
               ^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.12/site-packages/conda_build/cli/main_debug.py", line 102, in execute
        activation_string = api.debug(
                            ^^^^^^^^^^
      File "/opt/conda/lib/python3.12/site-packages/conda_build/api.py", line 642, in debug
        run_build(target_metadata, stats={}, provision_only=True)
      File "/opt/conda/lib/python3.12/site-packages/conda_build/build.py", line 2461, in build
└──❯ uname -a
Darwin c02fldw5md6m 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:26:51 PDT 2025; root:xnu-12377.41.6~2/RELEASE_X86_64 x86_64 Darwin
└──❯ docker version
Client:
 Version:           28.3.3
 API version:       1.51
 Go version:        go1.24.5
 Git commit:        980b856
 Built:             Fri Jul 25 11:33:03 2025
 OS/Arch:           darwin/amd64
 Context:           orbstack

Server: Docker Engine - Community
 Engine:
  Version:          28.3.3
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.24.5
  Git commit:       bea959c7
  Built:            Fri Jul 25 11:35:35 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.1.4
  GitCommit:        75cb2b7193e4e490e9fbdc236c0e811ccaba3376
 runc:
  Version:          1.3.1
  GitCommit:        e6457afc48eff1ce22dece664932395026a7105e
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type::bugdescribes erroneous operation, use severity::* to classify the type

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions