Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
4b1d5fe
Add mvfst and usdt dependencies
mszabo-wikia Dec 28, 2024
10ddac7
Fix thrift build
mszabo-wikia Dec 28, 2024
157ca3d
IWYU: fix boost include in hphp/compiler/systemlib.cpp
mszabo-wikia Dec 28, 2024
ea9ea46
Update OCaml stubs
mszabo-wikia Dec 28, 2024
95554ce
Remove nonexistent actions runner label
mszabo-wikia Dec 28, 2024
d7c8948
Require the ldap package
mszabo-wikia Dec 28, 2024
736f046
Update folly patches
mszabo-wikia Dec 28, 2024
07d94b9
Fix hhbc-unit.h generation
mszabo-wikia Apr 14, 2025
77ce743
Use system libraries for xxhash, lz4 and double-conversion
mszabo-wikia Dec 28, 2024
d5d1aa9
Use vendored fast_float library for folly
mszabo-wikia Dec 28, 2024
dd98d2f
Don't build squangle and mcrouter for OSS for now
mszabo-wikia Dec 28, 2024
d03d936
Add missing extension dependencies
mszabo-wikia Dec 28, 2024
51d0718
hack: skip building blake3 hash for now
mszabo-wikia Dec 28, 2024
77a1e04
Disable more broken extensions
mszabo-wikia Dec 28, 2024
d2ef8ff
Allow building with system lz4
mszabo-wikia Dec 28, 2024
7441aed
Fix spammy -Winconsistent-override in transport.h
mszabo-wikia Dec 28, 2024
1006aaa
Fix TBB clang patch
mszabo-wikia Dec 28, 2024
4732680
Attempt to workaround build races
mszabo-wikia Dec 28, 2024
ef85895
Install and force libc++ for the OSS build
mszabo-wikia Dec 29, 2024
c1b5a3f
Silence spammy 'non-local-definitions' rust lint
mszabo-wikia Dec 29, 2024
4aa57c9
Use LLVM 17 to satisfy C++20 requirements
mszabo-wikia Dec 29, 2024
be1b9ae
Build xed since it's now required
mszabo-wikia Dec 29, 2024
a700a6a
Parallelize the folly build
mszabo-wikia Dec 29, 2024
c3db9fe
Update Fizz patches
mszabo-wikia Dec 29, 2024
9d626d0
Switch CI from Focal to Jammy
mszabo-wikia Dec 31, 2024
661df48
Use single Rust staticlib for FFI
mszabo-wikia Dec 31, 2024
706b616
Use underlying type for formatting HPHP::jit::Opcode to fix debug build
mszabo-wikia Jan 3, 2025
c4ad5a4
Ensure Rust commands execute after OPAM setup
mszabo-wikia Jan 3, 2025
1883602
Generate config headers from configs.specification
mszabo-wikia Dec 28, 2024
bf987f1
Link fizz against liboqs transitively if it was found
mszabo-wikia Jan 3, 2025
d9ab365
support new libdwarfp API
mszabo-wikia Jan 5, 2025
e82282f
Fix tc-print link order
mszabo-wikia Jan 5, 2025
fdf150a
Fix compilation error with OpenSSL 3
Atry Nov 2, 2022
d96c791
Update systemlib generation to support precompiled systemlibs
mszabo-wikia Dec 28, 2024
0e547f8
Use an Ubuntu 24.04 CI
mszabo-wikia Jan 5, 2025
0b9fe1c
Fix ocamlrep_marshal dune lock
mszabo-wikia Jan 5, 2025
7284126
Use Opensource Team-approved runner label
mszabo-wikia Jan 6, 2025
c161878
Switch back to RelWithDebInfo builds after stabilizing CI
mszabo-wikia Jan 7, 2025
10dd728
Lowercase fizz reference
mszabo-wikia Feb 2, 2025
dc13eb3
Undefine a MySQL constant until the client is updated
mszabo-wikia Feb 10, 2025
5db7267
Add sandcastle module dependency
mszabo-wikia Mar 13, 2025
3b9446a
Add diagnostics stub
mszabo-wikia Mar 18, 2025
77082a2
Stub DeclarationsRewriter.rename_decls
mszabo-wikia Apr 14, 2025
930a2db
Include cxxabi and libunwind headers in unique-stubs.cpp
mszabo-wikia Apr 15, 2025
7182466
Fix OCaml stubs
mszabo-wikia May 15, 2025
a4b48e0
Add libbpf dependency
mszabo-wikia May 16, 2025
10796ff
Silence noisy nontrivial-memcall diagnostic on clang 20
mszabo-wikia May 16, 2025
ceaaa11
Try to include the MySQL extension
hershel-theodore-layton Jun 1, 2025
5a60fcd
Only containerize the actual package build
mszabo-wikia Jun 5, 2025
ebab917
Remove use of deprecated boost/filesystem/string_file
mszabo-wikia Jun 6, 2025
cac325b
Build the mcrouter extension
mszabo-wikia Jun 6, 2025
86ce372
Consistently check connection validity in AsyncMysqlConnection
mszabo-wikia Jun 25, 2025
11e57d1
Disable push builds for now
mszabo-wikia Jun 25, 2025
8a1e5f4
Update OPAM deps with too old versions
mszabo-wikia Jun 25, 2025
c818fbc
dpkg-buildpackage: error: unknown option or argument --no-lintian
hershel-theodore-layton May 31, 2025
c1a66ad
Fix glog vendoring
mszabo-wikia Sep 23, 2025
a071168
Update bundled glog to match Ubuntu Noble
mszabo-wikia Sep 24, 2025
7838628
Add dependency on libc-ares-dev
mszabo-wikia Sep 24, 2025
7bac7f1
Fix OSS Hack build on Arm
mszabo-wikia Sep 23, 2025
efeea80
arm64: require armv8.2-a
mszabo-wikia Sep 4, 2025
f928baf
Make libheif an optional dependency for ext_gd
mszabo-wikia Sep 24, 2025
9bedc6b
Increase workflow timeout
mszabo-wikia Oct 10, 2025
79c3683
Update to Rust 1.91
mszabo-wikia Apr 14, 2025
bc6e94b
Fix system gflags
mszabo-wikia Jul 29, 2025
29b1b77
Consolidate security-related compiler flags
mszabo-wikia Oct 10, 2025
0af5306
Update fmt to 12.1.0 to fix libc++ 21 compat
mszabo-wikia Nov 11, 2025
c488100
Fix using an incomplete type with libstdc++
mszabo-wikia Nov 13, 2025
be9dfda
Build on a custom runner
mszabo-wikia Nov 13, 2025
fbe4e9d
Update HackEventLogger stubs
mszabo-wikia Nov 13, 2025
f4d7c83
Use LLVM 20
mszabo-wikia Nov 13, 2025
5255d60
Fix build dir perms
mszabo-wikia Nov 14, 2025
4ffe338
Fix asan check in UninitializedMemoryHacks.h
mszabo-wikia Jan 23, 2026
0f07103
Build all of folly rather than patching out bits and pieces
mszabo-wikia Jan 23, 2026
3946159
Actually fix glog vendoring
mszabo-wikia Jan 23, 2026
52762c1
Help Rust interop code find folly
mszabo-wikia Mar 13, 2026
0dbd4d9
temp revert "Migrate external consumers to namespaced MySQL include t…
mszabo-wikia Mar 14, 2026
64cf1f9
Update extension count
mszabo-wikia Mar 14, 2026
f2370ba
Use monolithic mvfst library
mszabo-wikia Mar 14, 2026
9cca1c7
Update mvfst submodule ref
mszabo-wikia Feb 1, 2025
6b7fbfa
Fix deadlock in SubprocessScheduler
mszabo-wikia Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 25 additions & 48 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Ubuntu CI

on:
push:
branches-ignore:
# Exclude the push event for exported diffs, because the CI for export
# should have been covered by GitHub Actions triggered by pull requests.
- 'export-D+'
pull_request:

concurrency:
Expand All @@ -25,47 +20,29 @@ env:
DEBIAN_FRONTEND: "noninteractive"

jobs:
build_ubuntu_focal_nightly:
runs-on: 16-core
container:
image: ubuntu:focal
env:
DISTRO: ubuntu-20.04-focal
IS_NIGHTLY: 1
CLANG_VERSION: 12
build_ubuntu_noble_nightly:
timeout-minutes: 660 # 12 hours
runs-on: hhvm-builder
steps:
- name: Installing dependencies to bootstrap env
run: apt update -y && apt install -y git wget lsb-release software-properties-common gpg
- name: Installing llvm
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
# Note: Keep this version in sync with the one in the Debian control file.
./llvm.sh ${CLANG_VERSION}
- name: Making LLVM the default compiler
run: |
if [ -f /etc/alternatives/cc ]
then
update-alternatives --remove-all cc
fi

if [ -f /etc/alternatives/c++ ]
then
update-alternatives --remove-all c++
fi

update-alternatives --install /usr/bin/cc cc /usr/bin/clang++-${CLANG_VERSION} 500
update-alternatives --set cc /usr/bin/clang++-${CLANG_VERSION}
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${CLANG_VERSION} 500
update-alternatives --set c++ /usr/bin/clang++-${CLANG_VERSION}
- name: Fetching HHVM and its submodules
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Installing HHVM deps and building HHVM
run: ci/bin/make-debianish-package
- name: Uploading artifacts
uses: actions/upload-artifact@v6
with:
name: out-directory
path: ${{ env.OUT }}
# The HHVM build requires more disk space than what is available
# on a default Actions runner, so remove some cruft.
#- name: Free up disk space
# uses: jlumbroso/free-disk-space@v1.3.1
- name: Fetching HHVM and its submodules
uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Installing HHVM deps and building HHVM
uses: docker://ubuntu:noble
env:
DISTRO: ubuntu-24.04-noble
IS_NIGHTLY: 1
CLANG_VERSION: 20
with:
entrypoint: /bin/bash
args: ci/bin/make-debianish-package
- name: Uploading artifacts
uses: actions/upload-artifact@v6
with:
name: out-directory
path: ${{ env.OUT }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ install_manifest.txt
/hphp/hack/test/.mypy_cache
/hphp/util/generated-hhjs-babel-transform.txt

# Generated core systemlib
/hphp/runtime/ext/core/ext_core.php

# CPack
CPackConfig.cmake
CPackSourceConfig.cmake
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "xed-xed"]
path = third-party/xed/xed
url = https://github.com/intelxed/xed.git
[submodule "third-party/mvfst/src"]
path = third-party/mvfst/src
url = https://github.com/facebook/mvfst.git
69 changes: 53 additions & 16 deletions CMake/FindLibDwarf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,72 @@ endif (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
find_package(PkgConfig)
pkg_check_modules(PkgConfig_LibDwarf QUIET libdwarf)

set(
LIBDWARF_INCLUDE_PATHS
${PkgConfig_LibDwarf_INCLUDE_DIRS}
/usr/include
/usr/include/libdwarf
/usr/local/include
/usr/local/include/libdwarf
/opt/local/include
/sw/include
)

find_path (DWARF_INCLUDE_DIR
NAMES
libdwarf.h dwarf.h
PATHS
${PkgConfig_LibDwarf_INCLUDE_DIRS}
/usr/include
/usr/include/libdwarf
/usr/local/include
/usr/local/include/libdwarf
/opt/local/include
/sw/include
${LIBDWARF_INCLUDE_PATHS}
ENV CPATH) # PATH and INCLUDE will also work

if (DWARF_INCLUDE_DIR)
set (LIBDWARF_INCLUDE_DIRS ${DWARF_INCLUDE_DIR})
endif ()

set(LIBDWARF_LIBRARY_NAMES dwarf libdwarf)

find_path (LIBDWARF_PRODUCER_PATHS
NAMES
libdwarfp.h
PATHS
${LIBDWARF_INCLUDE_PATHS}
ENV CPATH
)

set(
LIBDWARF_LIBRARY_PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${PkgConfig_LibDwarf_LIBRARY_DIRS}
ENV LIBRARY_PATH # PATH and LIB will also work
ENV LD_LIBRARY_PATH
)

if (LIBDWARF_PRODUCER_PATHS)
set(LIBDWARF_USE_NEW_PRODUCER_API 1)
else()
set(LIBDWARF_USE_NEW_PRODUCER_API 0)
endif()

find_library (LIBDWARF_LIBRARIES
NAMES
dwarf libdwarf
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${PkgConfig_LibDwarf_LIBRARY_DIRS}
ENV LIBRARY_PATH # PATH and LIB will also work
ENV LD_LIBRARY_PATH)
include (FindPackageHandleStandardArgs)
${LIBDWARF_LIBRARY_PATHS})

if (LIBDWARF_USE_NEW_PRODUCER_API)
find_library (LIBDWARFP_LIBRARIES
NAMES
dwarfp libdwarfp
PATHS
${LIBDWARF_LIBRARY_PATHS})

list(APPEND LIBDWARF_LIBRARIES ${LIBDWARFP_LIBRARIES})
endif()

include (FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set LIBDWARF_FOUND to TRUE
# if all listed variables are TRUE
Expand Down Expand Up @@ -106,7 +142,7 @@ if (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)

# Order is important, last one is used.
CHECK_LIBDWARF_INIT("dwarf_producer_init"
"0, dwarfCallback, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr" 0)
"0, dwarfCallback, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr" 0)
CHECK_LIBDWARF_INIT("dwarf_producer_init_c" "0, dwarfCallback, nullptr, nullptr, nullptr, nullptr" 1)

set(CMAKE_REQUIRED_INCLUDES)
Expand All @@ -127,3 +163,4 @@ endif()
mark_as_advanced(LIBDW_INCLUDE_DIR DWARF_INCLUDE_DIR)
mark_as_advanced(LIBDWARF_INCLUDE_DIRS LIBDWARF_LIBRARIES)
mark_as_advanced(LIBDWARF_CONST_NAME LIBDWARF_USE_INIT_C)
mark_as_advanced(LIBDWARF_USE_NEW_PRODUCER_API)
14 changes: 6 additions & 8 deletions CMake/HHVMExtensionConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,13 @@ function (HHVM_EXTENSION_INTERNAL_HANDLE_LIBRARY_DEPENDENCY extensionID dependen
HHVM_EXTENSION_INTERNAL_ADD_DEFINES("-DHAVE_LIBGMP")
endif()
elseif (${libraryName} STREQUAL "heif")
find_package(Libheif ${requiredVersion} REQUIRED)
if (NOT LIBHEIF_INCLUDE_DIR OR NOT LIBHEIF_LIBRARY)
HHVM_EXTENSION_INTERNAL_SET_FAILED_DEPENDENCY(${extensionID} ${dependencyName})
return()
endif()
find_package(libheif 1.19.8 CONFIG)

if (${addPaths})
HHVM_EXTENSION_INTERNAL_ADD_INCLUDE_DIRS(${LIBHEIF_INCLUDE_DIR})
HHVM_EXTENSION_INTERNAL_ADD_LINK_LIBRARIES(${LIBHEIF_LIBRARY})
if (libheif_FOUND AND ${addPaths})
get_target_property(DEPENDENCY_TARGET_INCLUDE_DIR heif INTERFACE_INCLUDE_DIRECTORIES)
HHVM_EXTENSION_INTERNAL_ADD_INCLUDE_DIRS("${DEPENDENCY_TARGET_INCLUDE_DIR}")
HHVM_EXTENSION_INTERNAL_ADD_LINK_LIBRARIES(heif)
HHVM_EXTENSION_INTERNAL_ADD_DEFINES("-DHAVE_LIBHEIF")
endif()
elseif (${libraryName} STREQUAL "iconv")
find_package(Libiconv ${requiredVersion})
Expand Down
6 changes: 6 additions & 0 deletions CMake/HPHPCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
if (IS_X64)
list(APPEND GENERAL_CXX_OPTIONS "march=x86-64-v3")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -march=x86-64-v3")
elseif (IS_AARCH64)
list(APPEND GENERAL_CXX_OPTIONS "march=armv8.2-a")
endif()

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") # using Clang
Expand All @@ -145,6 +147,10 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
if(CLANG_FORCE_LIBCPP)
list(APPEND GENERAL_CXX_OPTIONS "stdlib=libc++")
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20)
list(APPEND GENERAL_OPTIONS "Wno-nontrivial-memcall")
endif()
else() # using GCC
list(APPEND DISABLED_NAMED_WARNINGS
"deprecated-declarations"
Expand Down
28 changes: 19 additions & 9 deletions CMake/HPHPFindLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ include_directories(${LIBEVENT_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES "${LIBEVENT_LIB}")
CHECK_FUNCTION_EXISTS("evhttp_bind_socket_with_fd" HAVE_CUSTOM_LIBEVENT)
if(HAVE_CUSTOM_LIBEVENT)
message("Using custom LIBEVENT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_CUSTOM_LIBEVENT")
message("Using custom LIBEVENT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_CUSTOM_LIBEVENT")
endif()
set(CMAKE_REQUIRED_LIBRARIES)

Expand Down Expand Up @@ -83,6 +83,9 @@ if (FASTLZ_INCLUDE_DIR)
include_directories(${FASTLZ_INCLUDE_DIR})
endif()

# ldap
find_package(Ldap)

# ICU
find_package(ICU REQUIRED)
if (ICU_FOUND)
Expand Down Expand Up @@ -235,6 +238,10 @@ if (NOT WINDOWS)
add_definitions("-DLIBDWARF_USE_INIT_C")
endif()

if (LIBDWARF_USE_NEW_PRODUCER_API)
add_definitions("-DLIBDWARF_USE_NEW_PRODUCER_API")
endif()

find_package(LibElf REQUIRED)
include_directories(${LIBELF_INCLUDE_DIRS})
if (ELF_GETSHDRSTRNDX)
Expand Down Expand Up @@ -275,6 +282,7 @@ if (LINUX)
find_package(systemd REQUIRED)
find_package(Bpf REQUIRED)
find_package(LibUnwind REQUIRED)
find_package(Bpf REQUIRED)
endif()

# This is required by Homebrew's libc. See
Expand All @@ -285,6 +293,9 @@ if (PAM_INCLUDE_PATH)
include_directories(${PAM_INCLUDE_PATH})
endif()

# Needed by fbthrift.
find_package(Xxhash REQUIRED)

include_directories(${HPHP_HOME}/hphp)

macro(hphp_link target)
Expand Down Expand Up @@ -340,6 +351,7 @@ macro(hphp_link target)

if (LINUX)
target_link_libraries(${target} ${VISIBILITY} ${BPF_LIBRARIES} ${SYSTEMD_LIBRARIES})
target_link_libraries(${target} ${VISIBILITY} ${LIBUNWIND_LIBRARIES})
endif()

if (LIBINOTIFY_LIBRARY)
Expand Down Expand Up @@ -380,6 +392,8 @@ macro(hphp_link target)

target_link_libraries(${target} ${VISIBILITY} ${LBER_LIBRARIES})

target_link_libraries(${target} ${VISIBILITY} ${Xxhash_LIBRARY})

if (CRYPT_LIB)
target_link_libraries(${target} ${VISIBILITY} ${CRYPT_LIB})
endif()
Expand Down Expand Up @@ -418,11 +432,7 @@ macro(hphp_link target)
target_link_libraries(${target} ${VISIBILITY} fizz)
target_link_libraries(${target} ${VISIBILITY} brotli)
target_link_libraries(${target} ${VISIBILITY} hhbc_ast_header)
target_link_libraries(${target} ${VISIBILITY} compiler_ffi)
target_link_libraries(${target} ${VISIBILITY} package_ffi)
target_link_libraries(${target} ${VISIBILITY} parser_ffi)
target_link_libraries(${target} ${VISIBILITY} hhvm_types_ffi)
target_link_libraries(${target} ${VISIBILITY} hhvm_hhbc_defs_ffi)
target_link_libraries(${target} ${VISIBILITY} hack_rust_ffi_bridge)

target_link_libraries(${target} ${VISIBILITY} tbb)

Expand Down Expand Up @@ -450,9 +460,9 @@ macro(hphp_link target)

if (ENABLE_XED)
if (LibXed_FOUND)
target_link_libraries(${target} ${VISIBILITY} ${LibXed_LIBRARY})
target_link_libraries(${target} ${VISIBILITY} ${LibXed_LIBRARY})
else()
target_link_libraries(${target} ${VISIBILITY} xed)
target_link_libraries(${target} ${VISIBILITY} xed)
endif()
endif()

Expand Down
35 changes: 26 additions & 9 deletions CMake/HPHPFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ function(append_systemlib TARGET SOURCE SECTNAME)
else()
set(${TARGET}_SLIBS ${${TARGET}_SLIBS} "--add-section" "${SECTNAME}=${SOURCE}" PARENT_SCOPE)
endif()
# Add the systemlib file to the "LINK_DEPENDS" for the systemlib, this will cause it
# to be relinked and the systemlib re-embedded
set_property(TARGET ${TARGET} APPEND PROPERTY LINK_DEPENDS ${SOURCE})
endfunction(append_systemlib)

function(embed_sections TARGET DEST)
Expand Down Expand Up @@ -152,10 +149,10 @@ function(embed_sections TARGET DEST)
endfunction(embed_sections)

macro(embed_systemlib_byname TARGET SLIB)
get_filename_component(SLIB_BN ${SLIB} "NAME_WE")
string(LENGTH ${SLIB_BN} SLIB_BN_LEN)
math(EXPR SLIB_BN_REL_LEN "${SLIB_BN_LEN} - 4")
string(SUBSTRING ${SLIB_BN} 4 ${SLIB_BN_REL_LEN} SLIB_EXTNAME)
get_filename_component(SLIB_FILENAME ${SLIB} "NAME")

set(SLIB_EXTNAME "/:${SLIB_FILENAME}")

string(MD5 SLIB_HASH_NAME ${SLIB_EXTNAME})
# Some platforms limit section names to 16 characters :(
string(SUBSTRING ${SLIB_HASH_NAME} 0 12 SLIB_HASH_NAME_SHORT)
Expand All @@ -165,10 +162,30 @@ endmacro()

function(embed_all_systemlibs TARGET ROOT DEST)
add_dependencies(${TARGET} systemlib)
append_systemlib(${TARGET} ${ROOT}/system/systemlib.php systemlib)

foreach(SLIB ${EXTENSION_SYSTEMLIB_SOURCES} ${EZC_SYSTEMLIB_SOURCES})
embed_systemlib_byname(${TARGET} ${SLIB})
get_filename_component(SLIB_FILENAME ${SLIB} NAME)
file(RELATIVE_PATH SLIB_RELATIVE_PATH ${CMAKE_SOURCE_DIR} ${SLIB})
list(APPEND SLIB_RELATIVE_PATHS ${SLIB_RELATIVE_PATH})
list(
APPEND PRECOMPILED_SYSTEMLIB_FILES
${CMAKE_CURRENT_BINARY_DIR}/slib/${SLIB_FILENAME}.decls
${CMAKE_CURRENT_BINARY_DIR}/slib/${SLIB_FILENAME}.ue
)
endforeach()

add_custom_command(
TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/slib
COMMAND $<TARGET_FILE:hhvm> --compile-systemlib --input-dir ${CMAKE_SOURCE_DIR} --output-dir ${CMAKE_CURRENT_BINARY_DIR}/slib ${SLIB_RELATIVE_PATHS}
COMMENT "Precompiling systemlib files"
VERBATIM)

foreach(PRECOMPILED_SLIB ${PRECOMPILED_SYSTEMLIB_FILES})
get_filename_component(PRECOMPILED_SLIB_FILENAME ${PRECOMPILED_SLIB} NAME)
embed_systemlib_byname(${TARGET} ${PRECOMPILED_SLIB})
endforeach()

embed_sections(${TARGET} ${DEST})
endfunction(embed_all_systemlibs)

Expand Down
Loading
Loading