Skip to content

Fix vcpkg packaging: debug headers, DLL exports, YAML_USE_CXX17 typo, x86 exclusion#197

Merged
matajoh merged 1 commit intomainfrom
copilot/fix-portfile-workarounds-add-dll-export
Apr 13, 2026
Merged

Fix vcpkg packaging: debug headers, DLL exports, YAML_USE_CXX17 typo, x86 exclusion#197
matajoh merged 1 commit intomainfrom
copilot/fix-portfile-workarounds-add-dll-export

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

vcpkg and CMake refinements

Decouple from snmalloc headers and add shared library (DLL) support

  • Introduce include/trieste/compiler.h with self-contained TRIESTE_SLOW_PATH,
    TRIESTE_FAST_PATH, TRIESTE_LIKELY/UNLIKELY, and TRIESTE_USED_FUNCTION macros,
    replacing all uses of snmalloc/ds_core/defines.h macros throughout the
    headers (ast.h, intrusive_ptr.h, logging.h, pass.h, rewrite.h, wf.h).

  • Make snmalloc an optional dependency controlled by TRIESTE_USE_SNMALLOC.
    When disabled, the core library no longer fetches or links snmalloc at all.
    The vcpkg port moves snmalloc from a hard dependency to an opt-in "snmalloc"
    feature.

  • Add DLL export support for the JSON and YAML parser libraries:

    • Use CMake's GenerateExportHeader to produce json_export.h / yaml_export.h.
    • Annotate all public API functions with JSON_EXPORT / YAML_EXPORT.
    • Define JSON_STATIC_DEFINE / YAML_STATIC_DEFINE for static builds.
    • Rename output libraries to trieste-json / trieste-yaml.
    • Add a Windows shared-libs CI job (BUILD_SHARED_LIBS=ON).
  • CMake modernisation:

    • Bump cmake_minimum_required to 3.28 and remove the cmake_utils
      dependency entirely. EXCLUDE_FROM_ALL is used natively on all
      FetchContent declarations.
    • Disable C++20 module scanning (CMAKE_CXX_SCAN_FOR_MODULES=OFF) since
      Trieste does not use modules.
    • Guard header installs on non-Debug builds to avoid installing into Debug
      prefixes.
    • Only define the clangformat target when snmalloc is available (it
      provides the clangformat_targets macro).
  • vcpkg port fixes:

    • Prefix release tag refs with "v" to match actual Git tags.
    • Drop redundant PACKAGE_NAME from vcpkg_cmake_config_fixup.
    • Add "supports": "!x86" platform constraint.
  • Fix C++17 compatibility in yaml reader (replace std::set::contains with
    find/end).

  • Bump VERSION to 1.1.0.

Copilot AI changed the title [WIP] Fix portfile workarounds and add DLL export support for parsers Fix vcpkg packaging: debug headers, DLL exports, YAML_USE_CXX17 typo, x86 exclusion Apr 1, 2026
Copilot AI requested a review from matajoh April 1, 2026 22:41
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch from eea9633 to c99d2f1 Compare April 2, 2026 00:50
Copy link
Copy Markdown
Member

@matajoh matajoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to test the DLL functionality on windows to ensure it is working properly.

Copilot AI requested a review from matajoh April 2, 2026 01:07
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch 4 times, most recently from 9cd0f97 to d1a4c18 Compare April 9, 2026 15:22
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch 3 times, most recently from 8310242 to e29cf8a Compare April 9, 2026 15:44
@matajoh matajoh marked this pull request as ready for review April 9, 2026 15:52
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch 5 times, most recently from a827f8b to c0905b3 Compare April 11, 2026 00:41
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch from c0905b3 to c4b776c Compare April 13, 2026 09:00
Decouple from snmalloc headers and add shared library (DLL) support

- Introduce include/trieste/compiler.h with self-contained TRIESTE_SLOW_PATH,
  TRIESTE_FAST_PATH, TRIESTE_LIKELY/UNLIKELY, and TRIESTE_USED_FUNCTION macros,
  replacing all uses of snmalloc/ds_core/defines.h macros throughout the
  headers (ast.h, intrusive_ptr.h, logging.h, pass.h, rewrite.h, wf.h).

- Make snmalloc an optional dependency controlled by TRIESTE_USE_SNMALLOC.
  When disabled, the core library no longer fetches or links snmalloc at all.
  The vcpkg port moves snmalloc from a hard dependency to an opt-in "snmalloc"
  feature.

- Add DLL export support for the JSON and YAML parser libraries:
  - Use CMake's GenerateExportHeader to produce json_export.h / yaml_export.h.
  - Annotate all public API functions with JSON_EXPORT / YAML_EXPORT.
  - Define JSON_STATIC_DEFINE / YAML_STATIC_DEFINE for static builds.
  - Rename output libraries to trieste-json / trieste-yaml.
  - Add a Windows shared-libs CI job (BUILD_SHARED_LIBS=ON).

- CMake modernisation:
  - Bump cmake_minimum_required to 3.28 and remove the cmake_utils
    dependency entirely. EXCLUDE_FROM_ALL is used natively on all
    FetchContent declarations.
  - Disable C++20 module scanning (CMAKE_CXX_SCAN_FOR_MODULES=OFF) since
    Trieste does not use modules.
  - Guard header installs on non-Debug builds to avoid installing into Debug
    prefixes.
  - Only define the clangformat target when snmalloc is available (it
    provides the clangformat_targets macro).

- vcpkg port fixes:
  - Prefix release tag refs with "v" to match actual Git tags.
  - Drop redundant PACKAGE_NAME from vcpkg_cmake_config_fixup.
  - Add "supports": "!x86" platform constraint.

- Fix C++17 compatibility in yaml reader (replace std::set::contains with
  find/end).

- Bump VERSION to 1.1.0.

Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
@matajoh matajoh force-pushed the copilot/fix-portfile-workarounds-add-dll-export branch from c4b776c to 1f8b324 Compare April 13, 2026 09:34
@matajoh matajoh merged commit 3a5d7f6 into main Apr 13, 2026
32 checks passed
@matajoh matajoh deleted the copilot/fix-portfile-workarounds-add-dll-export branch April 13, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vcpkg packaging: fix portfile workarounds and add DLL export support for parsers

4 participants