Skip to content

Commit

Permalink
Fix zlib-ng build with cmake 3.31.0 (#110359)
Browse files Browse the repository at this point in the history
* Fix zlib-ng build with cmake 3.31.0

* Dummy change in JIT

* Use POST_BUILD in add_custom_command

* Normalize paths before install

* Revert dummy change; CI is green

* Update functions.cmake

* Update functions.cmake

* Update src/native/external/zlib-ng/CMakeLists.txt
  • Loading branch information
am11 authored Dec 5, 2024
1 parent df1eaf9 commit e99557b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/jit-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,10 @@ jobs:
container: ${{ matrix.os.container }}
name: Format jit codebase ${{ matrix.os.name }}
steps:
- name: Checkout jitutils
uses: actions/checkout@v4
with:
path: jitutils
repository: dotnet/jitutils
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build jitutils
run: |
./bootstrap${{ matrix.os.extension }}
working-directory: jitutils
- name: Checkout runtime
uses: actions/checkout@v4
with:
Expand All @@ -52,7 +41,7 @@ jobs:

- name: Run jitformat.py
run: |
python3 runtime/src/coreclr/scripts/jitformat.py --jitutils jitutils -r runtime -o ${{ matrix.os.name }} -a x64 ${{ matrix.os.cross }}
python3 runtime/src/coreclr/scripts/jitformat.py -r runtime -o ${{ matrix.os.name }} -a x64 ${{ matrix.os.cross }}
env:
ROOTFS_DIR: ${{ matrix.os.rootfs }}

Expand All @@ -61,4 +50,4 @@ jobs:
with:
path: runtime/format.patch
name: format.${{matrix.os.name}}.patch
if: failure()
if: failure()
3 changes: 2 additions & 1 deletion eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ endfunction()

function(install_symbol_file symbol_file destination_path)
if(CLR_CMAKE_TARGET_WIN32)
install(FILES ${symbol_file} DESTINATION ${destination_path}/PDB ${ARGN})
cmake_path(SET DEST NORMALIZE "${destination_path}/PDB")
install(FILES ${symbol_file} DESTINATION ${DEST} ${ARGN})
else()
install(FILES ${symbol_file} DESTINATION ${destination_path} ${ARGN})
endif()
Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ endif()
add_custom_command(
# The AsmOffsets.cs is consumed later by the managed build
TARGET Runtime.WorkstationGC
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS} -I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
DEPENDS "${RUNTIME_DIR}/AsmOffsets.cpp" "${RUNTIME_DIR}/AsmOffsets.h"
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS}
-I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
)

add_custom_command(
Expand Down
2 changes: 2 additions & 0 deletions src/native/external/zlib-ng-version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ We have removed the following folders from our local copy as these files are not
- zlib-ng/arch/s390/self-hosted-builder/

Also, if the next version does not yet contain the fixes included in 12bc7edc73308f017ec40c6b2db694a6e3490ac2, cherry-pick it as a patch.

Apply https://github.com/zlib-ng/zlib-ng/pull/1812
4 changes: 1 addition & 3 deletions src/native/external/zlib-ng/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_minimum_required(VERSION 3.5.1...3.29.0)
if(CMAKE_VERSION VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_VERSION})
else()
cmake_policy(VERSION 3.5.1...3.29.0)
endif()
message(STATUS "Using CMake version ${CMAKE_VERSION}")

Expand Down

0 comments on commit e99557b

Please sign in to comment.