From 473d6183f65ed7c0588e4825b3b5a9eaf2541000 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Nov 2022 13:44:08 -0600 Subject: [PATCH 1/3] no symlinks on windows --- recipe/meta.yaml | 3 ++- recipe/patches/no-windows-symlinks.patch | 27 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 recipe/patches/no-windows-symlinks.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e7095508..b41d4b15 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -16,9 +16,10 @@ source: # backport of zlib patches, can be dropped for v>15.0.3, see # https://reviews.llvm.org/D135457 & https://reviews.llvm.org/D136065 - patches/0002-CMake-Fix-Findzstd-module-for-shared-DLL-on-Windows.patch + - patches/no-windows-symlinks.patch build: - number: 0 + number: 1 merge_build_host: false requirements: diff --git a/recipe/patches/no-windows-symlinks.patch b/recipe/patches/no-windows-symlinks.patch new file mode 100644 index 00000000..06e57f28 --- /dev/null +++ b/recipe/patches/no-windows-symlinks.patch @@ -0,0 +1,27 @@ +commit ca5eab8b706d4307b954f39254efdfa6cad47cb5 +Author: Isuru Fernando +Date: Tue Nov 8 13:34:20 2022 -0600 + + Always copy on windows + + The conda package build machine may have permissions to + create symlinks, but conda doesn't handle symlinks on windows + properly + +diff --git a/llvm/cmake/modules/LLVMInstallSymlink.cmake b/llvm/cmake/modules/LLVMInstallSymlink.cmake +index e9be04aceb3d..1ff77f28385a 100644 +--- a/llvm/cmake/modules/LLVMInstallSymlink.cmake ++++ b/llvm/cmake/modules/LLVMInstallSymlink.cmake +@@ -13,10 +13,11 @@ function(install_symlink name target outdir) + + message(STATUS "Creating ${name}") + ++ if(NOT CMAKE_HOST_WIN32) + execute_process( + COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}" + WORKING_DIRECTORY "${outdir}" ERROR_VARIABLE has_err) +- if(CMAKE_HOST_WIN32 AND has_err) ++ else() + execute_process( + COMMAND "${CMAKE_COMMAND}" -E copy "${target}" "${name}" + WORKING_DIRECTORY "${outdir}") From 7840fe173415fce97b2b280a4e417460879f42ad Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Nov 2022 13:48:53 -0600 Subject: [PATCH 2/3] add test --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b41d4b15..d3d11052 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -66,8 +66,10 @@ outputs: - test -f $PREFIX/include/llvm/Pass.h # [not win] - test -f $PREFIX/lib/libLLVMCore.a # [not win] - $PREFIX/libexec/llvm/not false # [not win] + - $PREFIX/bin/llvm-nm --help # [not win] - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win] - if not exist "%LIBRARY_PREFIX%"\\libexec\llvm\not.exe exit 1 # [win] + - %LIBRARY_BIN%\\llvm-nm.exe --help # [win] # Contains the shared libraries. To make different LLVM libraries co-installable # soversion is appended to the package name. From ef6d4d88f93aae7a4f732b26d7b5d368b1df3474 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Nov 2022 13:51:01 -0600 Subject: [PATCH 3/3] fix yaml --- recipe/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d3d11052..4c927300 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -69,7 +69,8 @@ outputs: - $PREFIX/bin/llvm-nm --help # [not win] - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win] - if not exist "%LIBRARY_PREFIX%"\\libexec\llvm\not.exe exit 1 # [win] - - %LIBRARY_BIN%\\llvm-nm.exe --help # [win] + - if not exist "%LIBRARY_BIN%"\\llvm-nm.exe exit 1 # [win] + - llvm-nm.exe --help # [win] # Contains the shared libraries. To make different LLVM libraries co-installable # soversion is appended to the package name.