From 6443472e83877d5b0e20dd033a145ccd82824517 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 12:51:38 -0700 Subject: [PATCH 1/9] Add GitHub Action for MacOS --- .github/workflows/macos.yml | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..55e6eb84 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,105 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# https://go.microsoft.com/fwlink/?LinkID=324981 + +name: 'CMake (MacOS)' + +on: + push: + branches: "main" + paths-ignore: + - '*.md' + - LICENSE + - '.azuredevops/**' + - '.github/*.md' + - '.nuget/*' + - build/*.cmd + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml + pull_request: + branches: "main" + paths-ignore: + - '*.md' + - LICENSE + - '.azuredevops/**' + - '.github/*.md' + - '.nuget/*' + - build/*.cmd + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml + workflow_dispatch: {} + +permissions: + contents: read + +jobs: + build: + runs-on: macos-latest + + strategy: + fail-fast: false + + matrix: + build_type: [arm64-Debug-Linux, arm64-Release-Linux] + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6 + + - name: Get vcpkg commit hash + shell: pwsh + run: | + if ($Env:vcpkgRelease) { + echo "Using vcpkg commit from repo variable..." + $VCPKG_COMMIT_ID = $Env:vcpkgRelease + } + else { + echo "Fetching latest vcpkg commit hash..." + $commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value + $VCPKG_COMMIT_ID = $commit + } + Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" + echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV + env: + vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}' + + - uses: lukka/run-vcpkg@305c06bd4dee21e23dcf142c85c657a993f7aa1a # v11 + with: + runVcpkgInstall: true + vcpkgJsonGlob: '**/build/vcpkg.json' + vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' + runVcpkgFormatString: '[`install`, `--allow-unsupported`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `arm64-macos`]' + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + run: > + cmake --preset=${{ matrix.build_type }} + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" + -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" + -DVCPKG_TARGET_TRIPLET="arm64-macos" + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: cmake --build out/build/${{ matrix.build_type }} + + - name: 'Clean up' + working-directory: ${{ github.workspace }} + run: rm -rf out + + - name: 'Configure CMake (-shared)' + working-directory: ${{ github.workspace }} + run: > + cmake --preset=${{ matrix.build_type }} + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" + -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" + -DVCPKG_TARGET_TRIPLET="arm64-macos" -DBUILD_SHARED_LIBS=ON + + - name: 'Build (-shared)' + working-directory: ${{ github.workspace }} + run: cmake --build out/build/${{ matrix.build_type }} From 3f0610e0e811a410e35e0247fa15a48475fb5341 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 12:55:50 -0700 Subject: [PATCH 2/9] Fix triplet --- .github/workflows/macos.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 55e6eb84..c001b7be 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -74,7 +74,7 @@ jobs: runVcpkgInstall: true vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' - runVcpkgFormatString: '[`install`, `--allow-unsupported`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `arm64-macos`]' + runVcpkgFormatString: '[`install`, `--allow-unsupported`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `arm64-osx`]' - name: 'Configure CMake' working-directory: ${{ github.workspace }} @@ -82,7 +82,7 @@ jobs: cmake --preset=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" - -DVCPKG_TARGET_TRIPLET="arm64-macos" + -DVCPKG_TARGET_TRIPLET="arm64-osx" - name: 'Build' working-directory: ${{ github.workspace }} @@ -98,7 +98,7 @@ jobs: cmake --preset=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" - -DVCPKG_TARGET_TRIPLET="arm64-macos" -DBUILD_SHARED_LIBS=ON + -DVCPKG_TARGET_TRIPLET="arm64-osx" -DBUILD_SHARED_LIBS=ON - name: 'Build (-shared)' working-directory: ${{ github.workspace }} From eb1f9540237fcf58674566e7adb95db795489d99 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 13:00:15 -0700 Subject: [PATCH 3/9] More fixes --- .github/workflows/macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c001b7be..c4526010 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -82,7 +82,7 @@ jobs: cmake --preset=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" - -DVCPKG_TARGET_TRIPLET="arm64-osx" + -DVCPKG_TARGET_TRIPLET="arm64-osx" -DVCPKG_INSTALL_OPTIONS=--allow-unsupported - name: 'Build' working-directory: ${{ github.workspace }} @@ -98,7 +98,7 @@ jobs: cmake --preset=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" - -DVCPKG_TARGET_TRIPLET="arm64-osx" -DBUILD_SHARED_LIBS=ON + -DVCPKG_TARGET_TRIPLET="arm64-osx" -DVCPKG_INSTALL_OPTIONS=--allow-unsupported -DBUILD_SHARED_LIBS=ON - name: 'Build (-shared)' working-directory: ${{ github.workspace }} From 05daff5a0a6304f947f2b7df5ce1e092115f828c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 13:04:29 -0700 Subject: [PATCH 4/9] malloc.h is Win32 only --- DirectXMesh/DirectXMeshP.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DirectXMesh/DirectXMeshP.h b/DirectXMesh/DirectXMeshP.h index 82890dd3..211339a4 100644 --- a/DirectXMesh/DirectXMeshP.h +++ b/DirectXMesh/DirectXMeshP.h @@ -141,7 +141,9 @@ #include "DirectXMesh.h" +#ifdef _WIN32 #include +#endif #include "scoped.h" From aa2823dca94d24dc0ee9ebd681f8521663f95c10 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 13:09:36 -0700 Subject: [PATCH 5/9] Pick lint --- .github/workflows/macos.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c4526010..5d9c2d92 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -74,7 +74,9 @@ jobs: runVcpkgInstall: true vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' - runVcpkgFormatString: '[`install`, `--allow-unsupported`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `arm64-osx`]' + runVcpkgFormatString: > + [`install`, `--allow-unsupported`, `--recurse`, `--clean-after-build`, `--x-install-root`, + `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `arm64-osx`] - name: 'Configure CMake' working-directory: ${{ github.workspace }} From f6783572fe4f1b2cf50f6c624b6a9a8996926850 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 13:18:11 -0700 Subject: [PATCH 6/9] Update copilot instr --- .github/copilot-instructions.md | 34 ++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0a3b9d9d..5aa2fd68 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,14 +19,14 @@ These instructions define how GitHub Copilot should assist with this project. Th ## General Guidelines -- **Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXMesh/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`). The command-line tools also use C++17, including `` for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, and GCC on Linux or Windows. +- **Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXMesh/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`). The command-line tools also use C++17, including `` for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, MinGW, and GCC on Linux or Windows. > Notable `.editorconfig` rules: C/C++ files use 4-space indentation, `crlf` line endings, and `latin1` charset — avoid non-ASCII characters in source files. - **Documentation**: The project provides documentation in the form of wiki pages available at [Documentation](https://github.com/microsoft/DirectXMesh/wiki/). - **Error Handling**: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed. For some functions that return HRESULT error codes, they are marked `noexcept`, use `std::nothrow` for memory allocation, and should not throw exceptions. - **Testing**: Unit tests for this project are implemented in this repository [Test Suite](https://github.com/walbourn/directxmeshtest/) and can be run using CTest per the instructions at [Test Documentation](https://github.com/walbourn/directxmeshtest/wiki). See [test copilot instructions](https://github.com/walbourn/directxmeshtest/blob/main/.github/copilot-instructions.md) for additional information on the tests. - **Security**: This project uses secure coding practices from the Microsoft Secure Coding Guidelines, and is subject to the `SECURITY.md` file in the root of the repository. Functions that read input from geometry files are subject to OneFuzz fuzz testing to ensure they are secure against malformed files. - **Dependencies**: The project uses CMake and VCPKG for managing dependencies, making optional use of DirectXMath and DirectX-Headers. The project can be built without these dependencies, relying on the Windows SDK for core functionality. -- **Continuous Integration**: This project implements GitHub Actions for continuous integration, ensuring that all code changes are tested and validated before merging. Platforms tested include Windows (MSVC, clang-cl, MinGW), Windows on ARM64, Xbox, UWP, and WSL (Linux). This includes building the project for a number of configurations and toolsets, running a subset of unit tests, and static code analysis including GitHub super-linter, CodeQL, and MSVC Code Analysis. +- **Continuous Integration**: This project implements GitHub Actions for continuous integration, ensuring that all code changes are tested and validated before merging. Platforms tested include Windows (MSVC, clang-cl, MinGW), Windows on ARM64, Xbox, UWP, WSL (Linux with GCC), and macOS (Apple Clang). This includes building the project for a number of configurations and toolsets, running a subset of unit tests, and static code analysis including GitHub super-linter, CodeQL, and MSVC Code Analysis. - **Code of Conduct**: The project adheres to the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). All contributors are expected to follow this code of conduct in all interactions related to the project. ## File Structure @@ -223,9 +223,11 @@ When creating documentation: ## Cross-platform Support Notes -- The code targets Win32 desktop applications for Windows 8.1 or later, Xbox One, Xbox Series X\|S, Universal Windows Platform (UWP) apps for Windows 10 and Windows 11, and Linux. -- Portability and conformance of the code is validated by building with Visual C++, clang/LLVM for Windows, MinGW, and GCC for Linux compilers. +- The code targets Win32 desktop applications for Windows 8.1 or later, Xbox One, Xbox Series X\|S, Universal Windows Platform (UWP) apps for Windows 10 and Windows 11, and Windows Subsystem for Linux (WSL). +- macOS is not officially supported due to a lack of support for Direct3D, which is reflected in the fact that the *directx-headers* VCPKG port is not supported for macOS. +- Portability and conformance of the code is validated by building with Visual C++ (MSVC), clang/LLVM for Windows (clang-cl), MinGW, GCC for Linux, and Apple Clang for macOS. - The project ships MSBuild projects for Visual Studio 2022 (`.sln` / `.vcxproj`) and Visual Studio 2026 (`.slnx` / `.vcxproj`). VS 2019 projects have been retired. +- CMake is the primary build system and can be used on all supported platforms. ### Platform and Compiler `#ifdef` Guards @@ -250,7 +252,7 @@ Use these established guards — do not invent new ones: > `_M_ARM`/ `__arm__` is legacy 32-bit ARM which is deprecated. -Non-Windows builds (Linux/WSL) use `` and `` from the DirectX-Headers package instead of the Windows SDK. +Non-Windows builds (Linux/WSL/macOS) use `` and `` from the DirectX-Headers package instead of the Windows SDK. ### Error Codes @@ -291,3 +293,25 @@ When reviewing documentation, do the following: ## Release Process The release process is documented in the [release skill](.github/skills/release/SKILL.md). Invoke the `release` skill for step-by-step guidance when performing a release. + +The release workflow includes: +- Preparing release branch with version updates in `CMakeLists.txt`, `README.md`, and `.nuspec` files +- Tagging releases with verified GPG signatures +- Creating GitHub releases with release notes from `CHANGELOG.md` +- Publishing to MSCodeHub mirror, Azure DevOps signed binaries, and NuGet packages +- Source archive signing with minisign +- NuGet package validation and publishing to nuget.org + +## CoPilot Skills + +The project includes published CoPilot skills for developers: + +- **Release-Process**: Guide for performing the DirectXMesh release process. Invoked when asked to help with releasing a new version, publishing packages, or updating ports. See [Release Process skill](.github/skills/release/SKILL.md) for details. +- **directxmesh-usage**: Provides usage guidance for the DirectXMesh library. Located in the `skills/directxmesh-usage/` directory. +- **mesh-converter**: Provides guidance for using the meshconvert command-line tool. Located in the `skills/mesh-converter/` directory. + +To use these skills in the Copilot CLI: +```bash +/skills list +/skills search directxmesh +``` From ece5828fda00398fad0f894df8ecef192aa0b2d6 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 13:23:33 -0700 Subject: [PATCH 7/9] Pick lint --- .github/copilot-instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5aa2fd68..4afeb01a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -311,6 +311,7 @@ The project includes published CoPilot skills for developers: - **mesh-converter**: Provides guidance for using the meshconvert command-line tool. Located in the `skills/mesh-converter/` directory. To use these skills in the Copilot CLI: + ```bash /skills list /skills search directxmesh From f9878d744b33c4a2db4461942c11e743d808edf5 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 14:18:45 -0700 Subject: [PATCH 8/9] Review --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 4afeb01a..5dd14937 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,7 +19,7 @@ These instructions define how GitHub Copilot should assist with this project. Th ## General Guidelines -- **Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXMesh/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`). The command-line tools also use C++17, including `` for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, MinGW, and GCC on Linux or Windows. +- **Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXMesh/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`). The command-line tools also use C++17, including `` for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, MinGW, and GCC on Linux. > Notable `.editorconfig` rules: C/C++ files use 4-space indentation, `crlf` line endings, and `latin1` charset — avoid non-ASCII characters in source files. - **Documentation**: The project provides documentation in the form of wiki pages available at [Documentation](https://github.com/microsoft/DirectXMesh/wiki/). - **Error Handling**: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed. For some functions that return HRESULT error codes, they are marked `noexcept`, use `std::nothrow` for memory allocation, and should not throw exceptions. From c8d117495b6a6824df0f972af7b9c9ab8da49390 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 16 Jul 2026 17:48:17 -0700 Subject: [PATCH 9/9] Update copilot instr --- .github/copilot-instructions.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5dd14937..d81b0408 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -290,6 +290,28 @@ When reviewing documentation, do the following: - Read the documentation on the wiki located in [this git repository](https://github.com/microsoft/DirectXMesh.wiki.git). - Report any specific gaps in the documentation compared to the public interface. +## Code Change Rules + +- Make precise, surgical changes that **fully** address the request. Don't modify unrelated code, but ensure changes are complete and correct. +- Don't fix pre-existing issues unrelated to your task. However, if you discover bugs directly caused by or tightly coupled to the code you're changing, fix those too. +- Update documentation if it is directly related to the changes you are making. +- Always validate that your changes don't break existing behavior. + +### Linting, Building, Testing + +- Only run linters, builds and tests that already exist. Do not add new linting, building or testing tools unless necessary for the task. +- Use the smallest targeted test, build, or lint command that covers the changed behavior. When related targeted selectors use the same runner, include them in one invocation; escalate to full-suite or baseline runs only when targeted validation shows they are needed. +- Documentation changes do not need to be linted, built or tested unless there are specific tests for documentation. + +### Using Ecosystem Tools + +- Prefer ecosystem tools (package managers, scaffolding, refactoring tools, linters) over manual changes. +- Install packages only when changing dependencies or after a missing-dependency failure. + +### Code Commenting Style + +- Only comment code that needs a bit of clarification. Do not comment otherwise. + ## Release Process The release process is documented in the [release skill](.github/skills/release/SKILL.md). Invoke the `release` skill for step-by-step guidance when performing a release.