DynamoRIO / DynamoRIO/drmemory

CPack can't install read-only files from dynamorio's export set

Open
#1,077 5 comments 0 reactions 0 assignees View on GitHub
Component-Build Migrated OpSys-Windows Priority-Low
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [rnk@google.com](https://code.google.com/u/rnk@google.com/) on November 02, 2012 10:32:14_

I'm trying to run the package script for drmemory, but cpack is erroring out on copying dynamorio.dll and dynamorio.pdb from DR's install dir.

This is how we install dynamorio.dll in DR's CMakeLists:
DR_install(TARGETS dynamorio
EXPORT ${exported_targets_name}
# CMake doesn't set +x on shared libraries, so we have to ask for it.
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
RUNTIME DESTINATION ${INSTALL_LIB} # .dll
LIBRARY DESTINATION ${INSTALL_LIB} # .so
ARCHIVE DESTINATION ${INSTALL_LIB} # .lib
)

Note the lack of OWNER_WRITE. This gives us read-only files in the install dir like:
$ find . -name dynamorio.dll | xargs ls -al
-rwxr-xr-x+ 1 reid None 4504064 Nov 2 10:26 ./build_debug-i32-static-ext/lib32/debug/dynamorio.dll
-rwxr-xr-x 1 reid None 5391360 Nov 2 10:26 ./build_debug-i64-static-ext/lib64/debug/dynamorio.dll
-rwxr-xr-x 1 reid None 1117184 Nov 2 10:26 ./build_release-e32-static-ext/lib32/release/dynamorio.dll
-rwxr-xr-x 1 reid None 1314816 Nov 2 10:26 ./build_release-e64-static-ext/lib64/release/dynamorio.dll
-r-xr-xr-x+ 1 reid None 4504064 Nov 2 10:26 ./exports/lib32/debug/dynamorio.dll
-r-xr-xr-x+ 1 reid None 1117184 Nov 2 10:26 ./exports/lib32/release/dynamorio.dll
-r-xr-xr-x+ 1 reid None 5391360 Nov 2 10:26 ./exports/lib64/debug/dynamorio.dll
-r-xr-xr-x+ 1 reid None 1314816 Nov 2 10:26 ./exports/lib64/release/dynamorio.dll

cpack fails like this:
$ cpack --config CPackConfig.cmake CPack: Create package using ZIP
CPack: Install projects
CPack: - Install directory: C:/src/dynamorio/build/exports/cmake/../lib32
CPack Error: Problem copying file: C:/src/dynamorio/build/exports/cmake/../lib32/debug/dynamorio.dll -> C:/src/drmemory/build/build_package/build_drmemory-debug-32/_CPack_Packages/Windows/ZIP/DrMemory-Windows-1.5.1097-42//dynamorio/lib32/debug/dynamorio.dll
CPack Error: Error when generating package: Dr. Memory

Even if I comment out the PERMISSIONS line from DR's cmakelists, it fails on the pdb file, which cmake marks readonly.

I can't find an easy fix for this, so I'm going to work around it for now by running the package script from the cmake checkout.

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=1077_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.