From 6edc46f862f9931d174ffbd45fb07f8df3edf040 Mon Sep 17 00:00:00 2001 From: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Date: Fri, 17 Sep 2021 23:05:23 +0800 Subject: [PATCH] [mimalloc] update to v1.7.2 (#20188) * [mimalloc] update to v1.7.2 * update version * update suggestion review * update version * update patch EOF * update version --- ports/mimalloc/fix-cmake.patch | 54 +++++++++++----------------------- ports/mimalloc/portfile.cmake | 49 ++++++++++++------------------ ports/mimalloc/vcpkg.json | 13 ++++++-- versions/baseline.json | 4 +-- versions/m-/mimalloc.json | 5 ++++ 5 files changed, 53 insertions(+), 72 deletions(-) diff --git a/ports/mimalloc/fix-cmake.patch b/ports/mimalloc/fix-cmake.patch index 42d74f8c2e..2824055a5a 100644 --- a/ports/mimalloc/fix-cmake.patch +++ b/ports/mimalloc/fix-cmake.patch @@ -1,58 +1,38 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 37616eb..4c81e6a 100644 +index b56953c..d7ad3e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -251,14 +251,28 @@ if(MI_BUILD_SHARED) - ) - if(WIN32) - # On windows copy the mimalloc redirection dll too. -+ if(CMAKE_SIZEOF_VOID_P EQUAL 8) - target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.lib) +@@ -279,10 +279,12 @@ if(MI_BUILD_SHARED) add_custom_command(TARGET mimalloc POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect.dll" $ - COMMENT "Copy mimalloc-redirect.dll to output directory") -- endif() + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" $ + COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory") + install ( -+ FILES $/mimalloc-redirect.dll ++ FILES $/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll + DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ) -+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) -+ target_link_libraries(mimalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.lib) -+ add_custom_command(TARGET mimalloc POST_BUILD -+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect32.dll" $ -+ COMMENT "Copy mimalloc-redirect32.dll to output directory") -+ install ( -+ FILES $/mimalloc-redirect32.dll -+ DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ) -+ endif() -+endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_dir} LIBRARY) -- install(EXPORT mimalloc DESTINATION ${mi_install_dir}/cmake) ++ ) + endif() +- +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) +- install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + install(TARGETS mimalloc EXPORT mimalloc ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib NAMELINK_SKIP) endif() # static library -@@ -281,9 +295,11 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_dir}) -+ install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION lib) +@@ -308,6 +310,8 @@ if (MI_BUILD_STATIC) + install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) endif() -+install(EXPORT mimalloc DESTINATION ${mi_install_dir}/cmake) ++install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + # install include files - install(FILES include/mimalloc.h DESTINATION ${mi_install_dir}/include) - install(FILES include/mimalloc-override.h DESTINATION ${mi_install_dir}/include) -@@ -315,9 +331,6 @@ if (MI_BUILD_OBJECT) + install(FILES include/mimalloc.h DESTINATION ${mi_install_incdir}) + install(FILES include/mimalloc-override.h DESTINATION ${mi_install_incdir}) +@@ -342,9 +346,6 @@ if (MI_BUILD_OBJECT) # the FILES expression can also be: $ # but that fails cmake versions less than 3.10 so we leave it as is for now - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/mimalloc-obj.dir/src/static.c${CMAKE_C_OUTPUT_EXTENSION} -- DESTINATION ${mi_install_dir} +- DESTINATION ${mi_install_libdir} - RENAME ${mi_basename}${CMAKE_C_OUTPUT_EXTENSION} ) endif() diff --git a/ports/mimalloc/portfile.cmake b/ports/mimalloc/portfile.cmake index 154fa3c2ad..b334bcad6d 100644 --- a/ports/mimalloc/portfile.cmake +++ b/ports/mimalloc/portfile.cmake @@ -3,23 +3,24 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/mimalloc - REF a9686d6ecf00e4467e772f7c0b4ef76a15f325f6 # v1.6.4 - SHA512 a1bda1b31d1bb3a4680fec91f180a988cf5ff486dcb8848fefd9245907f7986e4c4f10ce33133a3d796a7409ba38328bd156c47eba4f19368a2226a43b1ad298 + REF 752594e76423526e108413731518a26e3322b9ca # v1.7.2 + SHA512 fc96f6aa6972c167a956d8f928d9becd546689356d86e800df0f54c9c46cedf74d686168f44566fb4d0aa9cddf7a9444327acd2180cc91386c53658c6a5018f1 HEAD_REF master PATCHES fix-cmake.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - asm MI_SEE_ASM - secure MI_SECURE - override MI_OVERRIDE + FEATURES + asm MI_SEE_ASM + secure MI_SECURE + override MI_OVERRIDE ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MI_BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MI_BUILD_SHARED) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS_DEBUG -DMI_CHECK_FULL=ON OPTIONS_RELEASE @@ -31,41 +32,27 @@ vcpkg_configure_cmake( ${FEATURE_OPTIONS} -DMI_BUILD_STATIC=${MI_BUILD_STATIC} -DMI_BUILD_SHARED=${MI_BUILD_SHARED} + -DMI_INSTALL_TOPLEVEL=ON ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() -file(GLOB lib_directories RELATIVE ${CURRENT_PACKAGES_DIR}/lib "${CURRENT_PACKAGES_DIR}/lib/${PORT}-*") -list(GET lib_directories 0 lib_install_dir) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/${lib_install_dir}/cmake) - -vcpkg_replace_string( - ${CURRENT_PACKAGES_DIR}/share/${PORT}/mimalloc.cmake - "lib/${lib_install_dir}/" - "" -) - file(COPY - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) - -file(COPY ${CURRENT_PACKAGES_DIR}/lib/${lib_install_dir}/include DESTINATION ${CURRENT_PACKAGES_DIR}) - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/lib/${lib_install_dir} - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/lib/${lib_install_dir} + "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" ) +vcpkg_cmake_config_fixup(CONFIG_PATH cmake) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_replace_string( - ${CURRENT_PACKAGES_DIR}/include/mimalloc.h + "${CURRENT_PACKAGES_DIR}/include/mimalloc.h" "!defined(MI_SHARED_LIB)" "0 // !defined(MI_SHARED_LIB)" ) endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file diff --git a/ports/mimalloc/vcpkg.json b/ports/mimalloc/vcpkg.json index 09a5065e80..ecb642a739 100644 --- a/ports/mimalloc/vcpkg.json +++ b/ports/mimalloc/vcpkg.json @@ -1,10 +1,19 @@ { "name": "mimalloc", - "version-string": "1.6.4", - "port-version": 1, + "version": "1.7.2", "description": "Compact general purpose allocator with excellent performance", "homepage": "https://github.com/microsoft/mimalloc", "supports": "!(arm | uwp)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], "features": { "asm": { "description": "Generate assembly files" diff --git a/versions/baseline.json b/versions/baseline.json index bbddf80eee..f7cb5e5c36 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4201,8 +4201,8 @@ "port-version": 3 }, "mimalloc": { - "baseline": "1.6.4", - "port-version": 1 + "baseline": "1.7.2", + "port-version": 0 }, "minc": { "baseline": "2.4.03", diff --git a/versions/m-/mimalloc.json b/versions/m-/mimalloc.json index 02d1adf42b..be6c7a4785 100644 --- a/versions/m-/mimalloc.json +++ b/versions/m-/mimalloc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "180bb46f618db60da2f6aa4accca24cdb90570e8", + "version": "1.7.2", + "port-version": 0 + }, { "git-tree": "5dfd6d52634b3dc1e63c380de459322b8c17f0a8", "version-string": "1.6.4",