From dbfcfc0e207201a2036d7bb04434337ca525a08d Mon Sep 17 00:00:00 2001 From: Edward Nolan Date: Fri, 1 May 2026 00:21:33 -0400 Subject: [PATCH] Exemplar updates since 2026-04-27 Raised gtest_discover_tests DISCOVERY_TIMEOUT to 60s for both elide test executables. Added vcpkg port templates, manifest, and CI/release workflows; bumped infra-workflows from 1.5.3 to 1.6.0 and updated infra submodule pointer. Bumped vcpkg-configuration.json default and beman registry baselines. Removed superfluous comments around project() statement in CMakeLists.txt. Added .swp and .orig entries to .gitignore. Bumped infra/ beman-submodule to 1b14bad2cd2cf0e44d1aeb608557e0e35ce27eaa (BEMAN_LOCKFILE/Beman_provideDependency rename, telemetry.sh typo, llvm-libc++ toolchain SPDX header, README beman_install_library snippet update). --- .exemplar_version | 2 +- .github/workflows/ci_tests.yml | 13 +- .github/workflows/pre-commit-check.yml | 2 +- .github/workflows/pre-commit-update.yml | 2 +- .github/workflows/vcpkg-release.yml | 13 ++ .gitignore | 6 + .pre-commit-config.yaml | 2 +- CMakeLists.txt | 3 +- CONTRIBUTING.md | 24 +++ README.md | 11 ++ infra/.beman_submodule | 2 +- infra/README.md | 4 +- infra/cmake/llvm-libc++-toolchain.cmake | 2 +- infra/cmake/telemetry.sh | 2 +- infra/cmake/use-fetch-content.cmake | 217 +++++++++++------------- port/portfile.cmake.in | 28 +++ port/vcpkg.json.in | 17 ++ tests/beman/elide/CMakeLists.txt | 4 +- vcpkg-configuration.json | 15 ++ vcpkg.json | 10 ++ 20 files changed, 240 insertions(+), 139 deletions(-) create mode 100644 .github/workflows/vcpkg-release.yml create mode 100644 port/portfile.cmake.in create mode 100644 port/vcpkg.json.in create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/.exemplar_version b/.exemplar_version index 447909a..8f59e27 100644 --- a/.exemplar_version +++ b/.exemplar_version @@ -1 +1 @@ -ab5c7c0cbf1f67eb43b7be9c2d18acd4d6de1ea4 +0131279454a8b54a6038203a7b714e2e0a835039 diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 6f0ef58..90bf440 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -13,10 +13,10 @@ on: jobs: beman-submodule-check: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.6.0 preset-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.6.0 with: matrix_config: > [ @@ -31,7 +31,7 @@ jobs: ] build-and-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.6.0 with: matrix_config: > { @@ -144,7 +144,12 @@ jobs: ] } + vcpkg-ci: + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.6.0 + with: + port_name: beman-elide + create-issue-when-fault: needs: [preset-test, build-and-test] if: failure() && github.event_name == 'schedule' - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.6.0 diff --git a/.github/workflows/pre-commit-check.yml b/.github/workflows/pre-commit-check.yml index 980f6c5..15c5280 100644 --- a/.github/workflows/pre-commit-check.yml +++ b/.github/workflows/pre-commit-check.yml @@ -16,4 +16,4 @@ permissions: jobs: pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.6.0 diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml index 08e2c03..28682ed 100644 --- a/.github/workflows/pre-commit-update.yml +++ b/.github/workflows/pre-commit-update.yml @@ -9,7 +9,7 @@ on: jobs: auto-update-pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.5.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.6.0 secrets: APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }} PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }} diff --git a/.github/workflows/vcpkg-release.yml b/.github/workflows/vcpkg-release.yml new file mode 100644 index 0000000..f8b3887 --- /dev/null +++ b/.github/workflows/vcpkg-release.yml @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +name: vcpkg registry release +on: + release: + types: [published] +jobs: + vcpkg-release: + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.6.0 + with: + port_name: beman-elide + secrets: + VCPKG_REGISTRY_TOKEN: ${{ secrets.VCPKG_REGISTRY_TOKEN }} diff --git a/.gitignore b/.gitignore index d293e3b..d62996c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,9 @@ # ignore vscode settings .vscode + +# ignore vim swap files +.swp + +# ignore merge/patch backup files +.orig diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eb01186..b4dce7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,4 +45,4 @@ repos: hooks: - id: beman-tidy -exclude: 'cookiecutter/|infra/' +exclude: 'cookiecutter/|infra/|port/' diff --git a/CMakeLists.txt b/CMakeLists.txt index 28d7072..29a26b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,7 @@ cmake_minimum_required(VERSION 3.30...4.3) project( - beman.elide # CMake Project Name, which is also the name of the top-level - # targets (e.g., library, executable, etc.). + beman.elide DESCRIPTION "Implements proposed std::elide" LANGUAGES CXX VERSION 0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 921aef8..448c31a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,30 @@ ctest --test-dir build ## Dependency Management +### vcpkg + +The best way to install the project's dependencies is to use the vcpkg workflow. + +To do so, make sure vcpkg is installed and `VCPKG_ROOT` is defined in your environment, +then specify +`-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"`. Vcpkg will handle +the project's dependencies, including GoogleTest. + +Example commands: + +``` +cmake \ + -B build \ + -S . \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" +cmake --build build +ctest --test-dir build +``` + +The file `./vcpkg.json` configures the list of dependencies that will be configured by +vcpkg. + ### FetchContent Instead of installing the project's dependencies via a package manager, you can optionally diff --git a/README.md b/README.md index a97042d..5a31cc4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,17 @@ For details on building beman.elide without using a CMake preset, refer to the ### Installation +#### Vcpkg + +The preferred way to install elide is via vcpkg. To do so, after installing vcpkg +itself, you need to add support for the Beman project's [vcpkg +registry](https://github.com/bemanproject/vcpkg-registry) by configuring a +`vcpkg-configuration.json` file (which elide [provides](vcpkg-configuration.json)). + +Then, simply run `vcpkg install beman-elide`. + +#### Manual + To install beman.elide globally after building with the `gcc-release` preset, you can run: diff --git a/infra/.beman_submodule b/infra/.beman_submodule index 56dbbcc..a2ad45f 100644 --- a/infra/.beman_submodule +++ b/infra/.beman_submodule @@ -1,3 +1,3 @@ [beman_submodule] remote=https://github.com/bemanproject/infra.git -commit_hash=ea3ef79f77fdcc378149ebc7406e81e9ceb04146 +commit_hash=1b14bad2cd2cf0e44d1aeb608557e0e35ce27eaa diff --git a/infra/README.md b/infra/README.md index bf9bbb0..6cb8dd6 100644 --- a/infra/README.md +++ b/infra/README.md @@ -22,7 +22,7 @@ This repository is intended to be used as a beman-submodule in other Beman repos #### `beman_install_library` The CMake modules in this repository are intended to be used by Beman libraries. Use the -`beman_add_install_library_config()` function to install your library, along with header +`beman_install_library()` function to install your library, along with header files, any metadata files, and a CMake config file for `find_package()` support. ```cmake @@ -31,7 +31,7 @@ add_library(beman::something ALIAS beman.something) # ... configure your target as needed ... -find_package(beman-install-library REQUIRED) +include(infra/cmake/beman-install-library.cmake) beman_install_library(beman.something) ``` diff --git a/infra/cmake/llvm-libc++-toolchain.cmake b/infra/cmake/llvm-libc++-toolchain.cmake index 76264c6..eabf363 100644 --- a/infra/cmake/llvm-libc++-toolchain.cmake +++ b/infra/cmake/llvm-libc++-toolchain.cmake @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: BSL-1.0 +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # This toolchain file is not meant to be used directly, # but to be invoked by CMake preset and GitHub CI. diff --git a/infra/cmake/telemetry.sh b/infra/cmake/telemetry.sh index 307cc94..323982e 100755 --- a/infra/cmake/telemetry.sh +++ b/infra/cmake/telemetry.sh @@ -29,7 +29,7 @@ _ME="$(basename "${0}")" _print_help() { cat <_FOUND tells CMake that `find_package` is # not needed for this package anymore - set("${BemanExemplar_pkgName}_FOUND" TRUE PARENT_SCOPE) + set("${Beman_pkgName}_FOUND" TRUE PARENT_SCOPE) endif() endif() endforeach() endfunction() +set(BEMAN_USE_FETCH_CONTENT_ENABLED ON) + cmake_language( - SET_DEPENDENCY_PROVIDER BemanExemplar_provideDependency + SET_DEPENDENCY_PROVIDER Beman_provideDependency SUPPORTED_METHODS FIND_PACKAGE ) diff --git a/port/portfile.cmake.in b/port/portfile.cmake.in new file mode 100644 index 0000000..34fb3ea --- /dev/null +++ b/port/portfile.cmake.in @@ -0,0 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO bemanproject/elide + REF "v@VERSION@" + SHA512 @SHA512@ + HEAD_REF main +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBEMAN_ELIDE_BUILD_TESTS=OFF + -DBEMAN_ELIDE_BUILD_EXAMPLES=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup( + PACKAGE_NAME beman.elide + CONFIG_PATH lib/cmake/beman.elide +) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug" + "${CURRENT_PACKAGES_DIR}/lib" +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/port/vcpkg.json.in b/port/vcpkg.json.in new file mode 100644 index 0000000..c02f624 --- /dev/null +++ b/port/vcpkg.json.in @@ -0,0 +1,17 @@ +{ + "name": "beman-elide", + "version-semver": "@VERSION@", + "description": "Implements proposed std::elide", + "homepage": "https://github.com/bemanproject/elide", + "license": "Apache-2.0 WITH LLVM-exception", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/tests/beman/elide/CMakeLists.txt b/tests/beman/elide/CMakeLists.txt index a620323..7372b5b 100644 --- a/tests/beman/elide/CMakeLists.txt +++ b/tests/beman/elide/CMakeLists.txt @@ -17,5 +17,5 @@ target_link_libraries( ) include(GoogleTest) -gtest_discover_tests(beman.elide.tests.elide) -gtest_discover_tests(beman.elide.tests.deduce) +gtest_discover_tests(beman.elide.tests.elide DISCOVERY_TIMEOUT 60) +gtest_discover_tests(beman.elide.tests.deduce DISCOVERY_TIMEOUT 60) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..25169b2 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,15 @@ +{ + "default-registry": { + "kind": "git", + "repository": "https://github.com/microsoft/vcpkg.git", + "baseline": "80f9bcfa455e875d9c1bf7a7c6692d7e1e481061" + }, + "registries": [ + { + "kind": "git", + "repository": "https://github.com/bemanproject/vcpkg-registry.git", + "baseline": "5195f94f2b550163917c1152180fc59bbd760556", + "packages": ["beman-*"] + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..07987ed --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "beman-elide", + "version-semver": "0.1.0", + "dependencies": [ + { + "name": "gtest", + "host": true + } + ] +}