-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[ChakraCore] Add Linux support #18476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7d7564b
[ChakraCore] Add Linux support
Pospelove 14c2663
Fix
Pospelove eaba76c
x-add-version
Pospelove 33a5722
Update ci.baseline.txt
Pospelove 9e7fe9a
Update portfile.cmake
Pospelove f41fde4
Do not emit error if VCPKG_BUILD_TYPE is undefined
Pospelove f4181ec
Update ports/chakracore/portfile.cmake
Pospelove f68ab01
Update ports/chakracore/portfile.cmake
Pospelove a4cf07c
Update ports/chakracore/portfile.cmake
Pospelove 7de6e6f
Update ports/chakracore/portfile.cmake
Pospelove ce00547
Update ports/chakracore/portfile.cmake
Pospelove 14ad29a
Add missing space
Pospelove e84967e
Add quotes to variables
PhoebeHui a6df37d
Update the baseline version
PhoebeHui c6553c3
Fix Windows build
Pospelove 4dba0c8
vcpkg x-add-version chakracore
Pospelove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/lib/Common/Memory/RecyclerObjectGraphDumper.cpp b/lib/Common/Memory/RecyclerObjectGraphDumper.cpp | ||
| index 0885df3fb..12bdfb96e 100644 | ||
| --- a/lib/Common/Memory/RecyclerObjectGraphDumper.cpp | ||
| +++ b/lib/Common/Memory/RecyclerObjectGraphDumper.cpp | ||
| @@ -58,7 +58,7 @@ void RecyclerObjectGraphDumper::BeginDumpObject(void * objectAddress) | ||
| { | ||
| Assert(false); | ||
| this->dumpObjectTypeInfo = nullptr; | ||
| - this->dumpObjectIsArray = nullptr; | ||
| + this->dumpObjectIsArray = 0; | ||
| } | ||
| } | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,72 +1,149 @@ | ||
| vcpkg_fail_port_install(ON_TARGET osx linux uwp ON_CRT_LINKAGE static ON_LIBRARY_LINKAGE static) | ||
|
|
||
| vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO Microsoft/ChakraCore | ||
| REF 63c5099027ebb4547c802d62c2d2a6a39ee7eff6 # v1.11.22 | ||
| SHA512 5de915db48f5a125d4e0e112671ad7447212e6c0165d6c634a855a1d334f0bd2f7c015ba8c58d55225dd75d4c6687e6807987b8354b82405eb87944b46313062 | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| find_path(COR_H_PATH cor.h) | ||
| if(COR_H_PATH MATCHES "NOTFOUND") | ||
| message(FATAL_ERROR "Could not find <cor.h>. Ensure the NETFXSDK is installed.") | ||
| endif() | ||
| get_filename_component(NETFXSDK_PATH "${COR_H_PATH}/../.." ABSOLUTE) | ||
|
|
||
| set(BUILDTREE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) | ||
| file(REMOVE_RECURSE ${BUILDTREE_PATH}) | ||
| file(COPY ${SOURCE_PATH}/ DESTINATION ${BUILDTREE_PATH}) | ||
|
|
||
| set(CHAKRA_RUNTIME_LIB "static_library") # ChakraCore only supports static CRT linkage | ||
|
|
||
| vcpkg_build_msbuild( | ||
| PROJECT_PATH ${BUILDTREE_PATH}/Build/Chakra.Core.sln | ||
| OPTIONS | ||
| "/p:DotNetSdkRoot=${NETFXSDK_PATH}/" | ||
| "/p:CustomBeforeMicrosoftCommonTargets=${CMAKE_CURRENT_LIST_DIR}/no-warning-as-error.props" | ||
| "/p:RuntimeLib=${CHAKRA_RUNTIME_LIB}" | ||
| ) | ||
|
|
||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/lib/jsrt/ChakraCore.h | ||
| ${BUILDTREE_PATH}/lib/jsrt/ChakraCommon.h | ||
| ${BUILDTREE_PATH}/lib/jsrt/ChakraCommonWindows.h | ||
| ${BUILDTREE_PATH}/lib/jsrt/ChakraDebug.h | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/include | ||
| ) | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.dll | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.pdb | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/Chakracore.lib | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib | ||
| ) | ||
| endif() | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.dll | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.pdb | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/bin | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/Chakracore.lib | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/lib | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ch.exe | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/GCStress.exe | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/rl.exe | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/tools/chakracore) | ||
| vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/chakracore) | ||
| endif() | ||
|
|
||
| vcpkg_copy_pdbs() | ||
| file(INSTALL | ||
| ${SOURCE_PATH}/LICENSE.txt | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/share/ChakraCore RENAME copyright) | ||
| vcpkg_fail_port_install(ON_TARGET osx uwp) | ||
| if(WIN32) | ||
| vcpkg_fail_port_install(ON_CRT_LINKAGE static ON_LIBRARY_LINKAGE static) | ||
| endif() | ||
| vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO Microsoft/ChakraCore | ||
| REF 385409ee4b634b860e090606a28acbc99f4d2567 | ||
| SHA512 ef47db988c4ddd77fa87f4c5e1ac91d9f6b31b35aa6934d8b2863ee1274776d90a2b85dbad51eef069c96777d3cd7729349b89f23eda8c61b4cb637150bead71 | ||
| HEAD_REF master | ||
| PATCHES | ||
| fix-debug-linux-build.patch | ||
| ) | ||
|
|
||
| if(WIN32) | ||
| find_path(COR_H_PATH cor.h) | ||
| if(COR_H_PATH MATCHES "NOTFOUND") | ||
| message(FATAL_ERROR "Could not find <cor.h>. Ensure the NETFXSDK is installed.") | ||
| endif() | ||
| get_filename_component(NETFXSDK_PATH "${COR_H_PATH}/../.." ABSOLUTE) | ||
| endif() | ||
|
|
||
| set(BUILDTREE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) | ||
| file(REMOVE_RECURSE ${BUILDTREE_PATH}) | ||
| file(COPY ${SOURCE_PATH}/ DESTINATION ${BUILDTREE_PATH}) | ||
|
|
||
| if(WIN32) | ||
| set(CHAKRA_RUNTIME_LIB "static_library") # ChakraCore only supports static CRT linkage | ||
| vcpkg_build_msbuild( | ||
| PROJECT_PATH ${BUILDTREE_PATH}/Build/Chakra.Core.sln | ||
| OPTIONS | ||
| "/p:DotNetSdkRoot=${NETFXSDK_PATH}/" | ||
| "/p:CustomBeforeMicrosoftCommonTargets=${CMAKE_CURRENT_LIST_DIR}/no-warning-as-error.props" | ||
| "/p:RuntimeLib=${CHAKRA_RUNTIME_LIB}" | ||
| ) | ||
| else() | ||
| if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64") | ||
| set(CHAKRACORE_TARGET_ARCH amd64) | ||
| elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86") | ||
| set(CHAKRACORE_TARGET_ARCH x86) | ||
| endif() | ||
|
|
||
| if (VCPKG_TARGET_IS_LINUX) | ||
| message(WARNING "This port requires Clang to build.") | ||
| endif() | ||
|
|
||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") | ||
| list(APPEND configs "debug") | ||
| execute_process( | ||
| COMMAND bash "build.sh" "--arch=${CHAKRACORE_TARGET_ARCH}" "--debug" | ||
| WORKING_DIRECTORY ${BUILDTREE_PATH} | ||
|
Pospelove marked this conversation as resolved.
Outdated
|
||
| 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() | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
| list(APPEND configs "release") | ||
| execute_process( | ||
| COMMAND bash "build.sh" "--arch=${CHAKRACORE_TARGET_ARCH}" | ||
| WORKING_DIRECTORY ${BUILDTREE_PATH} | ||
|
Pospelove marked this conversation as resolved.
Outdated
|
||
| 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() | ||
|
|
||
|
Pospelove marked this conversation as resolved.
Outdated
|
||
| endif() | ||
|
|
||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/lib/Jsrt/ChakraCore.h | ||
| ${BUILDTREE_PATH}/lib/Jsrt/ChakraCommon.h | ||
| ${BUILDTREE_PATH}/lib/Jsrt/ChakraDebug.h | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/include | ||
| ) | ||
| if(WIN32) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/lib/Jsrt/ChakraCommonWindows.h | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/include | ||
| ) | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.dll | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.pdb | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/Chakracore.lib | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib | ||
| ) | ||
| endif() | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.dll | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.pdb | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/bin | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/Chakracore.lib | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/lib | ||
| ) | ||
| file(INSTALL | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ch.exe | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/GCStress.exe | ||
| ${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/rl.exe | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/tools/chakracore | ||
| ) | ||
| vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/chakracore) | ||
| endif() | ||
| else() | ||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| set(out_file libChakraCore.so) | ||
| else() | ||
| set(out_file lib/libChakraCoreStatic.a) | ||
| endif() | ||
|
|
||
| set(destination_dir_debug ${CURRENT_PACKAGES_DIR}/debug/bin) | ||
| set(destination_dir_release ${CURRENT_PACKAGES_DIR}/bin) | ||
| set(out_dir_debug ${BUILDTREE_PATH}/out/Debug) | ||
| set(out_dir_release ${BUILDTREE_PATH}/out/Release) | ||
| foreach(config ${configs}) | ||
| file(INSTALL | ||
| ${out_dir_${config}}/${out_file} | ||
| DESTINATION ${destination_dir_${config}} | ||
| ) | ||
| endforeach() | ||
|
|
||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
| file(INSTALL | ||
| ${out_dir_release}/ch | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/tools/chakracore | ||
| ) | ||
| vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/chakracore) | ||
| endif() | ||
| endif() | ||
|
|
||
| vcpkg_copy_pdbs() | ||
|
|
||
| file(INSTALL | ||
| ${SOURCE_PATH}/LICENSE.txt | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/share/chakracore | ||
| RENAME copyright | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| { | ||
| "name": "chakracore", | ||
| "version-string": "1.11.22", | ||
| "port-version": 1, | ||
| "version-string": "2021-04-22", | ||
| "description": "Core part of the Chakra Javascript engine", | ||
| "homepage": "https://github.com/Microsoft/ChakraCore", | ||
| "supports": "windows & !uwp & !static" | ||
| "supports": "!osx & !uwp & (linux | !static)" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.