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 cannot read symlink (OneDrive incompatibility) #2488

Closed
jclay opened this issue Jan 2, 2018 · 1 comment
Closed

CMake cannot read symlink (OneDrive incompatibility) #2488

jclay opened this issue Jan 2, 2018 · 1 comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@jclay
Copy link
Contributor

jclay commented Jan 2, 2018

When attempting to install freeglut on Windows 10, I am encountering a CMake build error indicating that the following copy command from the freeglut portfile does not work properly:

# ports/freeglut/portfile.cmake:57
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

I suspect this may be due to the fact that my project is inside OneDrive. In the output below, the error seems to indicate that CMake is unable to perform a copy if symlinks (in this case from OneDrive) are used. Anyone else run into a similar issue?

Full error message:

PS C:\Users\joel\OneDrive\dev\Project> .\win_tools\vcpkg\vcpkg.exe install freeglut
The following packages will be built and installed:
    freeglut[core]:x86-windows
Starting package 1/1: freeglut:x86-windows
Building package freeglut:x86-windows...
-- CURRENT_INSTALLED_DIR=C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/installed/x86-windows
-- DOWNLOADS=C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/packages/freeglut_x86-windows
-- CURRENT_BUILDTREES_DIR=C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/buildtrees/freeglut
-- CURRENT_PORT_DIR=C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/ports/freeglut/.
-- Using cached C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/downloads/freeglut-3.0.0.tar.gz
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Extracting done
-- Configuring x86-windows-rel
-- Configuring x86-windows-rel done
-- Configuring x86-windows-dbg
-- Configuring x86-windows-dbg done
-- Build x86-windows-rel
-- Build x86-windows-rel done
-- Build x86-windows-dbg
-- Build x86-windows-dbg done
CMake Error at ports/freeglut/portfile.cmake:57 (file):
  file COPY cannot read symlink
  "C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/ports/freeglut/usage"
  to duplicate at
  "C:/Users/joel/OneDrive/dev/Project/win_tools/vcpkg/packages/freeglut_x86-windows/share/freeglut/usage".
Call Stack (most recent call first):
  scripts/ports.cmake:72 (include)


Error: Building package freeglut:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: freeglut:x86-windows
  Vcpkg version: 0.0.100-2018-01-02-0b1fa2834e79eeaecedadb4594f2243e382ce0f8

Additionally, attach any relevant sections from the log files above.
@ras0219-msft ras0219-msft added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Jan 4, 2018
@GlieseRay
Copy link

I encountered the same cmake error on windows server 2012 and found that is caused by data deduplication.

@jclay jclay closed this as completed Jul 16, 2018
soumagne pushed a commit to mercury-hpc/kwsys that referenced this issue Mar 24, 2021
On Windows machines with enabled data deduplication files duplicates are
incorrectly recognized as symlinks and therefore install fails with
"file COPY cannot read symlink".

Similar issues can be found here:

* microsoft/vcpkg#2488
* puppetlabs/puppet#6513

From the later fix this commit is mainly influenced.
soumagne pushed a commit to mercury-hpc/kwsys that referenced this issue Mar 24, 2021
On Windows machines with enabled data deduplication files duplicates are
incorrectly recognized as symlinks and therefore install fails with
"file COPY cannot read symlink".

Similar issues can be found here:

* microsoft/vcpkg#2488
* puppetlabs/puppet#6513

From the latter fix this commit is mainly influenced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

3 participants