From 7d693d2446d7ba1bc4e7686b4a9cb1d52a30d00f Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:17:27 +0000 Subject: [PATCH] [chakracore] Fix compilation command running path (#38392) Fix one of https://github.com/microsoft/vcpkg/issues/32398 issue. The local test is compiled and passed under Linux. However, there is no clang compiler on the CI environment, causing the compilation to fail, so the restrictions in ci.baseline.txt cannot be lifted. - [X] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] ~~SHA512s are updated for each updated download.~~ - [ ] ~~The "supports" clause reflects platforms that may be fixed by this new version.~~ - [ ] ~~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~~ - [ ] ~~Any patches that are no longer applied are deleted from the port's directory.~~ - [X] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [X] Only one version is added to each modified port's versions file. Compile test pass with following triplets: ``` x64-linux x64-windows ``` --- ports/chakracore/portfile.cmake | 37 ++++++++++++++------------------- ports/chakracore/vcpkg.json | 3 ++- versions/baseline.json | 4 ++-- versions/c-/chakracore.json | 5 +++++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index ba60bd8eaa..294191bade 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -40,17 +40,18 @@ else() elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(CHAKRACORE_TARGET_ARCH x86) endif() - + if (VCPKG_TARGET_IS_LINUX) message(WARNING "${PORT} requires Clang from the system package manager, this can be installed on Ubuntu systems via sudo apt install clang") endif() + file(MAKE_DIRECTORY "${BUILDTREE_PATH}-dbg") if(NOT DEFINED VCPKG_BUILD_TYPE) list(APPEND configs "debug") execute_process( COMMAND bash "build.sh" "--arch=${CHAKRACORE_TARGET_ARCH}" "--debug" "-j=${VCPKG_CONCURRENCY}" - WORKING_DIRECTORY "${BUILDTREE_PATH}-dbg" - + WORKING_DIRECTORY "${SOURCE_PATH}" + OUTPUT_VARIABLE CHAKRA_BUILD_SH_OUT ERROR_VARIABLE CHAKRA_BUILD_SH_ERR RESULT_VARIABLE CHAKRA_BUILD_SH_RES @@ -58,26 +59,27 @@ else() ECHO_ERROR_VARIABLE ) endif() - + + file(MAKE_DIRECTORY "${BUILDTREE_PATH}-rel") list(APPEND configs "release") execute_process( COMMAND bash "build.sh" "--arch=${CHAKRACORE_TARGET_ARCH}" "-j=${VCPKG_CONCURRENCY}" - WORKING_DIRECTORY "${BUILDTREE_PATH}-rel" + WORKING_DIRECTORY "${SOURCE_PATH}" OUTPUT_VARIABLE CHAKRA_BUILD_SH_OUT ERROR_VARIABLE CHAKRA_BUILD_SH_ERR RESULT_VARIABLE CHAKRA_BUILD_SH_RES ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE ) - endif() file(INSTALL - "${BUILDTREE_PATH}-rel/lib/Jsrt/ChakraCore.h" - "${BUILDTREE_PATH}-rel/lib/Jsrt/ChakraCommon.h" - "${BUILDTREE_PATH}-rel/lib/Jsrt/ChakraDebug.h" + "${SOURCE_PATH}/lib/Jsrt/ChakraCore.h" + "${SOURCE_PATH}/lib/Jsrt/ChakraCommon.h" + "${SOURCE_PATH}/lib/Jsrt/ChakraDebug.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include" ) + if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) file(INSTALL "${BUILDTREE_PATH}-rel/lib/Jsrt/ChakraCommonWindows.h" @@ -86,21 +88,14 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) ) else() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(out_file libChakraCore.so) + file(INSTALL "${SOURCE_PATH}/out/Debug/libChakraCore.so" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL "${SOURCE_PATH}/out/Release/libChakraCore.so" DESTINATION ${CURRENT_PACKAGES_DIR}/bin) else() - set(out_file lib/libChakraCoreStatic.a) + file(INSTALL "${SOURCE_PATH}/out/Debug/lib/libChakraCoreStatic.a" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(INSTALL "${SOURCE_PATH}/out/Release/lib/libChakraCoreStatic.a" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) endif() - set(destination_dir_debug "${CURRENT_PACKAGES_DIR}/debug/bin") - set(destination_dir_release "${CURRENT_PACKAGES_DIR}/bin") - set(out_dir_debug "${BUILDTREE_PATH}-dbg/out/Debug") - set(out_dir_release "${BUILDTREE_PATH}-rel/out/Release") - foreach(config ${configs}) - file(INSTALL - ${out_dir_${config}}/${out_file} - DESTINATION ${destination_dir_${config}} - ) - endforeach() + set(out_dir_release "${SOURCE_PATH}/out/Release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") file(INSTALL diff --git a/ports/chakracore/vcpkg.json b/ports/chakracore/vcpkg.json index fa8b797f9c..c3a25331c6 100644 --- a/ports/chakracore/vcpkg.json +++ b/ports/chakracore/vcpkg.json @@ -1,6 +1,7 @@ { "name": "chakracore", - "version-date": "2024-04-20", + "version-date": "2022-11-09", + "port-version": 7, "description": "Core part of the Chakra Javascript engine", "homepage": "https://github.com/Microsoft/ChakraCore", "license": "MIT", diff --git a/versions/baseline.json b/versions/baseline.json index efd49017ab..a58c67ac76 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1569,8 +1569,8 @@ "port-version": 3 }, "chakracore": { - "baseline": "2024-04-20", - "port-version": 0 + "baseline": "2022-11-09", + "port-version": 7 }, "charls": { "baseline": "2.4.2", diff --git a/versions/c-/chakracore.json b/versions/c-/chakracore.json index 4344d195a3..08a347c346 100644 --- a/versions/c-/chakracore.json +++ b/versions/c-/chakracore.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "04e8036ad8fd92b15cd9186794c4d1d68c4f6479", + "version-date": "2022-11-09", + "port-version": 7 + }, { "git-tree": "e1446838cc63899b04eee045e2744d7d59a42a14", "version-date": "2024-04-20",