Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Error: Could not create symbolic link for... (IDFGH-7188) #8787

Closed
xiaguangbo opened this issue Apr 17, 2022 · 9 comments
Closed

CMake Error: Could not create symbolic link for... (IDFGH-7188) #8787

xiaguangbo opened this issue Apr 17, 2022 · 9 comments
Assignees
Labels
Awaiting Response awaiting a response from the author Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@xiaguangbo
Copy link

env:
esp-idf master


Executing task: cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 .. <

-- Found Git: C:/Users/xiaguangbo/esp/.espressif/tools/idf-git/2.30.1/cmd/git.exe (found version "2.30.1.windows.1")
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/xiaguangbo/esp/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/xiaguangbo/esp/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/xiaguangbo/esp/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s2
-- Project sdkconfig file D:/xiaguangbo/project/esp/project/template-app/sdkconfig
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: C:/Users/xiaguangbo/esp/.espressif/python_env/idf5.0_py3.8_env/Scripts/python.exe (found version "3.8.7") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
CMake Error at C:/Users/xiaguangbo/esp/esp-idf/components/mbedtls/mbedtls/CMakeLists.txt:148 (message):
Could not create symbolic link for:
C:\Users\xiaguangbo\esp\esp-idf\components\mbedtls\mbedtls\library\error.c
--> 系统无法将文件移到不同的磁盘驱动器。

Call Stack (most recent call first):
C:/Users/xiaguangbo/esp/esp-idf/components/mbedtls/mbedtls/library/CMakeLists.txt:162 (link_to_source)

-- Configuring incomplete, errors occurred!
See also "D:/xiaguangbo/project/esp/project/template-app/build/CMakeFiles/CMakeOutput.log".
终端进程“C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 ..”已终止,退出代码: 1。

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 17, 2022
@github-actions github-actions bot changed the title CMake Error: Could not create symbolic link for... CMake Error: Could not create symbolic link for... (IDFGH-7188) Apr 17, 2022
@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting. Would you please help provide more details as suggested in the issue template? Information like elf, sdk configuration, backtrace, log outputs, commit ID, hardware and etc. would help us debug further. Thanks.

@ESP-Marius
Copy link
Collaborator

Hi @xiaguangbo, this seems to be an issue caused upstream by the mbedtls library. It tries to create a symlink between a file in your IDF folder (error.c) to your build folder, which are on two different drives (C: and D:) which Windows seems to be unable to do.

This is is something they changed recently, so building a IDF project on a different drive from the SDK works on release/v4.4 and older, but not on the latest master....

We'll look into this and see if we can find a fix. For now you can work around this by moving your project D:/xiaguangbo/project/esp/ to the C: drive.

@xiaguangbo
Copy link
Author

@ESP-Marius That's exactly the problem, thanks

@espressif-bot espressif-bot added Status: In Progress Work is in progress Awaiting Response awaiting a response from the author and removed Status: Opened Issue is new labels Apr 18, 2022
@xiaguangbo xiaguangbo reopened this Apr 18, 2022
@mahavirj
Copy link
Member

mahavirj commented May 5, 2022

Linking Mbed-TLS/mbedtls#5751

@espressif-bot espressif-bot added Status: Opened Issue is new and removed Status: In Progress Work is in progress labels May 12, 2022
@espressif-bot espressif-bot assigned mahavirj and unassigned ESP-Marius May 12, 2022
@espressif-bot espressif-bot added Resolution: Won't Do This will not be worked on Status: Done Issue is done internally and removed Status: Opened Issue is new labels May 12, 2022
@xobs
Copy link
Contributor

xobs commented Jul 14, 2022

Hi, I've just run into this issue, which still seems to be a problem. Is this the only place it's documented that esp-idf must be installed on the C drive? Is there any way esp-idf could be fixed?

As a workaround, I've changed set(command cmd.exe /c mklink /h ${link} ${target}) to set(command cmd.exe /c copy ${target} ${link}) in components/mbedtls/mbedtls/CMakeLists.txt:139.

Either way, this is still a problem and I don't think this issue should be closed, mostly because people will keep running into it and opening duplicates.

@xiaguangbo xiaguangbo reopened this Jul 14, 2022
@xiaguangbo
Copy link
Author

@xobs I reopened this question. This problem is described in 'Linking Mbed-TLS/mbedtls#5751' mentioned by mahavirj

@kolipakakondal
Copy link
Collaborator

kolipakakondal commented Jul 26, 2022

This problem still exists on the master branch and v5.0. Please find the attached log.
console.txt
CMakeOutput.log

Reported by @sigmaaa

@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally Resolution: Won't Do This will not be worked on and removed Resolution: Won't Do This will not be worked on Status: Selected for Development Issue is selected for development Resolution: Done Issue is done internally labels Jan 20, 2023
@0xBERNDOG
Copy link
Contributor

0xBERNDOG commented Nov 10, 2023

This issue can still impact Linux users. I'm using Docker with a mounted volume. I fixed it with:

components/mbedtls/mbedtls/CMakeLists.txt:140

if (CMAKE_HOST_UNIX)
-            execute_process(COMMAND ln -s ${target} ${link}
+            execute_process(COMMAND cp --remove-destination ${target} ${link}
                 RESULT_VARIABLE result
                 ERROR_VARIABLE output)

@supiiik
Copy link

supiiik commented Jan 14, 2024

This issue can still impact Linux users. I'm using Docker with a mounted volume. I fixed it with:

components/mbedtls/mbedtls/CMakeLists.txt:140

if (CMAKE_HOST_UNIX)
-            execute_process(COMMAND ln -s ${target} ${link}
+            execute_process(COMMAND cp --remove-destination ${target} ${link}
                 RESULT_VARIABLE result
                 ERROR_VARIABLE output)

Fixed my problem too. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

10 participants