diff --git a/ports/mimalloc/portfile.cmake b/ports/mimalloc/portfile.cmake index 009ee76333..0a2bade58b 100644 --- a/ports/mimalloc/portfile.cmake +++ b/ports/mimalloc/portfile.cmake @@ -2,8 +2,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/mimalloc REF "v${VERSION}" - SHA512 19f5481c98822c6a279e2f2d26d6c54918e18bcafd515a76ca3a3845f3a5e599236ea042f9cadaf793dce0c1ede347d76cc2fc5503094288362a78034d4d8f71 - HEAD_REF master + SHA512 176fbfd6ef3698841f8a53fb968a1198e08eef071f3d5a811046521c9bac5c3e36d024c8b1fb67e95f9018658083efd98222502e81d57e114ebb76af13008fec + HEAD_REF dev3 PATCHES pkgconfig-cxx.diff ) diff --git a/ports/mimalloc/vcpkg.json b/ports/mimalloc/vcpkg.json index c9b7d96e5e..245f913f14 100644 --- a/ports/mimalloc/vcpkg.json +++ b/ports/mimalloc/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mimalloc", - "version": "2.2.7", + "version": "3.2.7", "description": "Compact general purpose allocator with excellent performance", "homepage": "https://github.com/microsoft/mimalloc", "license": "MIT", diff --git a/scripts/test_ports/vcpkg-ci-mimalloc/build-type.diff b/scripts/test_ports/vcpkg-ci-mimalloc/build-type.diff index 78865761fe..d412ccaa9a 100644 --- a/scripts/test_ports/vcpkg-ci-mimalloc/build-type.diff +++ b/scripts/test_ports/vcpkg-ci-mimalloc/build-type.diff @@ -1,8 +1,8 @@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index c5fff1a..03a86ca 100644 +index 199f4809..beae8345 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt -@@ -20,6 +20,7 @@ find_package(mimalloc 2.2 CONFIG REQUIRED) +@@ -20,6 +20,7 @@ find_package(mimalloc CONFIG REQUIRED) message(STATUS "Found mimalloc installed at: ${MIMALLOC_LIBRARY_DIR} (${MIMALLOC_VERSION_DIR})") @@ -17,7 +17,7 @@ index c5fff1a..03a86ca 100644 +endif() -+if(0) ++if(MIMALLOC_OBJECT_DIR) # overriding with a static object file works reliable as the symbols in the # object file have priority over those in library files add_executable(static-override-obj main-override.c ${MIMALLOC_OBJECT_DIR}/mimalloc${CMAKE_C_OUTPUT_EXTENSION}) diff --git a/scripts/test_ports/vcpkg-ci-mimalloc/portfile.cmake b/scripts/test_ports/vcpkg-ci-mimalloc/portfile.cmake index 8a46d4c502..31d1a50f32 100644 --- a/scripts/test_ports/vcpkg-ci-mimalloc/portfile.cmake +++ b/scripts/test_ports/vcpkg-ci-mimalloc/portfile.cmake @@ -1,12 +1,13 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) vcpkg_find_acquire_program(PKGCONFIG) +set(ENV{PKG_CONFIG} "${PKGCONFIG}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/mimalloc REF "v${VERSION}" - SHA512 55262050f63868e3029cd929a74d312dc0f34b606534b1d0b3735eecc8eed68aae97523a50228b4ac4044e1e03192f2909440e3a27607e2d364607ac0bda828f + SHA512 a674dbe119e080630de0af12a972af9fb1ac3611413fd5a7eb14f61e47af620f6368a28e8849757136fcc1c3c4f8f776cfa0f351d3f0ef463eff98fdf8c4db52 HEAD_REF master PATCHES build-type.diff @@ -22,12 +23,11 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}/test" OPTIONS "-DCMAKE_PROJECT_INCLUDE=${CURRENT_PORT_DIR}/vcpkg-tests.cmake" - "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + "-DFEATURES=${FEATURES}" ) set(ENV{MIMALLOC_VERBOSE} 1) set(ENV{MIMALLOC_SHOW_ERRORS} 1) -set(ENV{MIMALLOC_DISABLE_REDIRECT} 1) vcpkg_cmake_install(ADD_BIN_TO_PATH) diff --git a/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg-tests.cmake b/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg-tests.cmake index 659cb7db66..0b70ee1f18 100644 --- a/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg-tests.cmake +++ b/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg-tests.cmake @@ -31,19 +31,27 @@ if(BUILD_SHARED_LIBS OR NOT WIN32) target_link_libraries(pkgconfig-override-cxx PRIVATE PkgConfig::PC_MIMALLOC) endif() +# overriding allocation in a DLL that is compiled independent of mimalloc +# https://github.com/microsoft/mimalloc/blob/dev/readme.md#dynamic-override-on-windows + +if(BUILD_SHARED_LIBS AND WIN32 AND "override" IN_LIST FEATURES) + add_library(mimalloc-test-override-dep SHARED main-override-dep.cpp) + target_link_libraries(dynamic-override-cxx PRIVATE mimalloc-test-override-dep) + target_link_libraries(pkgconfig-override-cxx PRIVATE mimalloc-test-override-dep) +endif() + # Runtime if(NOT CMAKE_CROSSCOMPILING) - if(BUILD_SHARED_LIBS) - add_custom_target(run-dynamic-override ALL COMMAND $) - add_custom_target(run-dynamic-override-cxx ALL COMMAND $) - elseif(NOT WIN32) - add_custom_target(run-static-override ALL COMMAND $) - add_custom_target(run-static-override-cxx ALL COMMAND $) - endif() - if(TARGET pkgconfig-override-cxx) - add_custom_target(run-pkgconfig-override-cxx ALL COMMAND $) - endif() + get_directory_property(targets BUILDSYSTEM_TARGETS) + set(expected_fails test-wrong) + list(REMOVE_ITEM targets ${expected_fails}) + foreach(target IN LISTS targets) + get_target_property(type ${target} TYPE) + if(type STREQUAL "EXECUTABLE") + add_custom_target(run-${target} ALL COMMAND ${target}) + endif() + endforeach() endif() # Deployment diff --git a/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg.json b/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg.json index 9c453dd098..47cf64cb99 100644 --- a/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-mimalloc/vcpkg.json @@ -1,6 +1,6 @@ { "name": "vcpkg-ci-mimalloc", - "version": "2.2.3", + "version": "3.2.6", "description": "Validates mimalloc", "dependencies": [ "mimalloc", @@ -9,23 +9,36 @@ "host": true } ], + "default-features": [ + { + "name": "override", + "platform": "native | (windows & !static)" + }, + { + "name": "secure", + "platform": "native" + } + ], "features": { - "ci": { - "description": "Test feature permutation", + "override": { + "description": "Test override feature", "dependencies": [ { "name": "mimalloc", "features": [ "override" - ], - "platform": "native & !(windows & static)" - }, + ] + } + ] + }, + "secure": { + "description": "Test secure feature", + "dependencies": [ { "name": "mimalloc", "features": [ "secure" - ], - "platform": "arm64 & static" + ] } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 711c0fe8fa..e3f9b62151 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6409,7 +6409,7 @@ "port-version": 3 }, "mimalloc": { - "baseline": "2.2.7", + "baseline": "3.2.7", "port-version": 0 }, "mimicpp": { diff --git a/versions/m-/mimalloc.json b/versions/m-/mimalloc.json index 07ab55660c..26c0218f85 100644 --- a/versions/m-/mimalloc.json +++ b/versions/m-/mimalloc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7617731f2dfaea0ce243f3355ed8c0bc7d5e0dc9", + "version": "3.2.7", + "port-version": 0 + }, { "git-tree": "5b9c09b6d1592392634727afb0abbe0b14e030a2", "version": "2.2.7",