-
Notifications
You must be signed in to change notification settings - Fork 123
build: keep CMake and Meson definitions in sync #896
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -422,7 +422,7 @@ function(resolve_croaring_dependency) | |
| set(CROARING_URL "$ENV{ICEBERG_CROARING_URL}") | ||
| else() | ||
| set(CROARING_URL | ||
| "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.4.3.tar.gz") | ||
| "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.3.11.tar.gz") | ||
| endif() | ||
|
|
||
| fetchcontent_declare(croaring | ||
|
|
@@ -443,8 +443,16 @@ function(resolve_croaring_dependency) | |
| endif() | ||
|
|
||
| set(CROARING_VENDORED TRUE) | ||
| set_target_properties(roaring PROPERTIES OUTPUT_NAME "iceberg_vendored_croaring" | ||
| POSITION_INDEPENDENT_CODE ON) | ||
| # CRoaring 4.3.11 exposes its header-only helper targets in roaring's install | ||
| # interface. Iceberg installs roaring in its own export without those helper | ||
| # targets, so downstream find_package(iceberg) would otherwise reject the | ||
| # package. Preserve the build dependencies without leaking them to consumers. | ||
| set_target_properties(roaring | ||
| PROPERTIES OUTPUT_NAME "iceberg_vendored_croaring" | ||
| POSITION_INDEPENDENT_CODE ON | ||
| INTERFACE_LINK_LIBRARIES | ||
| "$<BUILD_INTERFACE:roaring-headers>;$<BUILD_INTERFACE:roaring-headers-cpp>" | ||
| ) | ||
| install(TARGETS roaring | ||
| EXPORT iceberg_targets | ||
| RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}" | ||
|
|
@@ -532,7 +540,7 @@ function(resolve_nlohmann_json_dependency) | |
| set(NLOHMANN_JSON_URL "$ENV{ICEBERG_NLOHMANN_JSON_URL}") | ||
| else() | ||
| set(NLOHMANN_JSON_URL | ||
| "https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz") | ||
| "https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest upgrade these versions in a separate PR. |
||
| endif() | ||
|
|
||
| fetchcontent_declare(nlohmann_json | ||
|
|
@@ -828,7 +836,7 @@ function(resolve_gtest_dependency) | |
|
|
||
| fetchcontent_declare(googletest | ||
| GIT_REPOSITORY https://github.com/google/googletest.git | ||
| GIT_TAG b514bdc898e2951020cbdca1304b75f5950d1f59 # release-1.15.2 | ||
| GIT_TAG 52eb8108c5bdec04579160ae17225d66034bd723 # release-1.17.0 | ||
| FIND_PACKAGE_ARGS | ||
| NAMES | ||
| GTest) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| import re | ||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| ROOT = Path(__file__).resolve().parents[1] | ||
|
|
||
|
|
||
| def read(relative_path: str) -> str: | ||
| return (ROOT / relative_path).read_text(encoding="utf-8") | ||
|
|
||
|
|
||
| def extract(pattern: str, relative_path: str) -> str: | ||
| match = re.search(pattern, read(relative_path)) | ||
| if match is None: | ||
| raise AssertionError(f"Could not find {pattern!r} in {relative_path}") | ||
| return match.group(1) | ||
|
|
||
|
|
||
| class BuildDefinitionParityTest(unittest.TestCase): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this check cover all the relevant files? ISTM we could simply add a section to |
||
| def test_public_headers_are_installed_by_both_build_systems(self) -> None: | ||
| self.assertIn("puffin_dv_io.h", read("src/iceberg/meson.build")) | ||
| self.assertIn( | ||
| "token_refresh_scheduler.h", | ||
| read("src/iceberg/catalog/rest/auth/meson.build"), | ||
| ) | ||
| self.assertIn( | ||
| "iceberg_install_all_headers(iceberg/catalog)", | ||
| read("src/iceberg/catalog/CMakeLists.txt"), | ||
| ) | ||
|
|
||
| def test_core_tests_are_run_by_both_build_systems(self) -> None: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't look right to me. We shouldn't run a test for a previously missing file. |
||
| self.assertIn( | ||
| "snapshot_summary_builder_test.cc", | ||
| read("src/iceberg/test/meson.build"), | ||
| ) | ||
|
|
||
| def test_fallback_dependency_versions_match(self) -> None: | ||
| versions = { | ||
| "CRoaring": ( | ||
| extract( | ||
| r"CRoaring/.+?/v([0-9.]+)\.tar\.gz", | ||
| "cmake_modules/IcebergThirdpartyToolchain.cmake", | ||
| ), | ||
| extract(r"directory = CRoaring-([0-9.]+)", "subprojects/croaring.wrap"), | ||
| ), | ||
| "nlohmann/json": ( | ||
| extract( | ||
| r"nlohmann/json/releases/download/v([0-9.]+)", | ||
| "cmake_modules/IcebergThirdpartyToolchain.cmake", | ||
| ), | ||
| extract( | ||
| r"directory = nlohmann_json-([0-9.]+)", | ||
| "subprojects/nlohmann_json.wrap", | ||
| ), | ||
| ), | ||
| "GoogleTest": ( | ||
| extract( | ||
| r"# release-([0-9.]+)", | ||
| "cmake_modules/IcebergThirdpartyToolchain.cmake", | ||
| ), | ||
| extract(r"directory = googletest-([0-9.]+)", "subprojects/gtest.wrap"), | ||
| ), | ||
| } | ||
| mismatches = { | ||
| name: pair for name, pair in versions.items() if pair[0] != pair[1] | ||
| } | ||
| self.assertEqual({}, mismatches) | ||
|
|
||
| def test_croaring_build_only_targets_are_not_exported(self) -> None: | ||
| toolchain = read("cmake_modules/IcebergThirdpartyToolchain.cmake") | ||
| self.assertIn("$<BUILD_INTERFACE:roaring-headers>", toolchain) | ||
| self.assertIn("$<BUILD_INTERFACE:roaring-headers-cpp>", toolchain) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure downgrade the third-party version is the right way to go :-(