From 49955cf6e628cb6c0d0eb8ff69031c08f31df7d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 16:55:25 +0000 Subject: [PATCH 01/18] Initial plan From 97241cab89e67fdd8a989f12e65e14022cf142b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 16:58:54 +0000 Subject: [PATCH 02/18] Fix CPP build: update copy targets to use PublishDir instead of OutDir/native The .NET 10 ILCompiler publishes files directly to the publish directory, not to a 'native' subdirectory. Updated MSBuild targets to: - Use AfterTargets="Publish" instead of AfterTargets="ComputeFilesToPublish" - Use $(PublishDir) instead of $(OutDir)native/ This ensures native binaries are correctly copied to AngouriMath.CPP.Importing/out-x64/ Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting.csproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index 9cca1aadc..31b36f720 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -8,16 +8,16 @@ true - - + + - - + + - - + + From 76d62f53429512ac5ea9ff6693f6bc68bc1d78fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 16:59:58 +0000 Subject: [PATCH 03/18] Fix path separator in Linux copy command Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index 31b36f720..ea4e33425 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -13,7 +13,7 @@ - + From 5f0323be12431d4d6c6291a89064dc5b121ae829 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 17:05:16 +0000 Subject: [PATCH 04/18] Fix macOS library renaming: add conditional checks for file existence Added ls -la to debug output and conditional checks before renaming to handle cases where: - The file might already have the lib prefix - The file might not exist yet - Different .NET versions may output different file names Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index 505d8c98b..57584b759 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -62,14 +62,21 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 - mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so + if [ -f "AngouriMath.CPP.Exporting.so" ]; then + mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so + fi - name: 'Renaming the library for OS X' if: ${{ matrix.os == 'macos-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 - mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib - install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib + ls -la + if [ -f "AngouriMath.CPP.Exporting.dylib" ]; then + mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib + fi + if [ -f "libAngouriMath.CPP.Exporting.dylib" ]; then + install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib + fi - name: 'Uploading artifacts' uses: actions/upload-artifact@v6 From 57aeb2cbe2c642d5b0d21f83bc927acec9e8af85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 17:18:32 +0000 Subject: [PATCH 05/18] Remove conditional checks - files must exist for build to succeed Removed if checks so the build fails if the expected library files don't exist. This will help diagnose the actual issue rather than silently skipping. Kept ls -la for debugging output. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index 57584b759..3a8448679 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -62,21 +62,16 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 - if [ -f "AngouriMath.CPP.Exporting.so" ]; then - mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so - fi + ls -la + mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so - name: 'Renaming the library for OS X' if: ${{ matrix.os == 'macos-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 ls -la - if [ -f "AngouriMath.CPP.Exporting.dylib" ]; then - mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib - fi - if [ -f "libAngouriMath.CPP.Exporting.dylib" ]; then - install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib - fi + mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib + install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib - name: 'Uploading artifacts' uses: actions/upload-artifact@v6 From a3a3ee9935f9270d363c12c2481b26892262f009 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 17:59:28 +0000 Subject: [PATCH 06/18] Change target framework from netstandard2.0 to net10.0 for NativeAOT NativeAOT requires an executable target framework, not a library target. Changed from netstandard2.0 to net10.0 and added PublishAot=true property to properly generate native shared libraries with the ILCompiler. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index ea4e33425..02ec0dc1c 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -1,11 +1,13 @@  - netstandard2.0 + net10.0 true true true + true + false From 55ba78cbb37c62dbc6b9e50a25481d1f0a01090e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 19:40:29 +0000 Subject: [PATCH 07/18] Add headerpad_max_install_names linker flag for macOS The install_name_tool was failing because the dylib didn't have enough space reserved in its Mach-O header. Added -headerpad_max_install_names linker flag via IlcArgs for macOS builds to reserve sufficient header space for install name modifications. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index 5e4059f22..93349d7dc 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -10,6 +10,10 @@ false + + $(IlcArgs) -Wl,-headerpad_max_install_names + + From 8285de6a742d637963dc4cf7bfffa16a3c53f081 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 19:41:47 +0000 Subject: [PATCH 08/18] Fix typo in target name: Unux -> Unix Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index 93349d7dc..08786d621 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -18,7 +18,7 @@ - + From f2a123675f46ac67abe69d1b059f33ce9cd3257a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 19:50:17 +0000 Subject: [PATCH 09/18] Remove duplicate PropertyGroup for macOS linker flags A duplicate PropertyGroup was created when the ci-fix branch merge added the same configuration. Removed the duplicate to keep only one instance with the comment. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .../AngouriMath.CPP.Exporting.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index b4e9e93fe..a025fdb52 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -10,10 +10,6 @@ false - - $(IlcArgs) -Wl,-headerpad_max_install_names - - $(IlcArgs) -Wl,-headerpad_max_install_names From 4a793df791df6969fceaf1642678dfe360de68c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 19:56:53 +0000 Subject: [PATCH 10/18] Remove redundant install_name_tool call in CPPTest workflow The dylib already has the correct install name (@rpath/libAngouriMath.CPP.Exporting.dylib) set in CPPBuild.yml. The second install_name_tool call in CPPTest was trying to change it to an absolute path, which failed because: 1. It's modifying an already-set install name (can't be "redone") 2. The absolute path is longer and exceeds available header space The @rpath approach is correct and works without modification. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPTest.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/CPPTest.yml b/.github/workflows/CPPTest.yml index 2a7979718..b7c4b7a4d 100644 --- a/.github/workflows/CPPTest.yml +++ b/.github/workflows/CPPTest.yml @@ -79,9 +79,6 @@ jobs: run: | cd ${{ env.tests_path }} cp -r "../../../Wrappers/AngouriMath.CPP.Importing/out-x64/AngouriMath.CPP.Exporting.dylib" "build/Debug/libAngouriMath.CPP.Exporting.dylib" - cd build/Debug - path=$(pwd) - install_name_tool -id "$path/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib - name: 'Building and running tests' run: | From 9abc969a27551f94b3fb8377af91b66cb450e8ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 08:44:59 +0000 Subject: [PATCH 11/18] Fix architecture mismatch: use osx-arm64 for macOS builds GitHub Actions macos-latest runners now use Apple Silicon (arm64), but the workflows were building for x86_64 (osx-x64). This caused a linker error: "found architecture 'x86_64', required architecture 'arm64'". Changed the runtime identifier from osx-x64 to osx-arm64 in both CPPBuild.yml and CPPTest.yml to match the runner architecture. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 2 +- .github/workflows/CPPTest.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index e663f53e3..7f5efcb37 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -19,7 +19,7 @@ jobs: - os: ubuntu-latest flag: linux-x64 - os: macos-latest - flag: osx-x64 + flag: osx-arm64 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/CPPTest.yml b/.github/workflows/CPPTest.yml index b7c4b7a4d..979cfc800 100644 --- a/.github/workflows/CPPTest.yml +++ b/.github/workflows/CPPTest.yml @@ -21,7 +21,7 @@ jobs: - os: ubuntu-latest flag: linux-x64 - os: macos-latest - flag: osx-x64 + flag: osx-arm64 runs-on: ${{ matrix.os }} From 13570c02b1b0ec6d6dbd454e0d36f3fff327272b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 08:54:56 +0000 Subject: [PATCH 12/18] Copy .lib file for Windows builds in CPPTest workflow On Windows, linking against a shared library requires both the .dll file (runtime) and the .lib file (import library). The CPPTest workflow was only copying the .dll, causing the linker error "cannot open file 'AngouriMath.CPP.Exporting.lib'". Added a second copy command to also copy the .lib file to the build directory. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPTest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CPPTest.yml b/.github/workflows/CPPTest.yml index 979cfc800..2ff64f882 100644 --- a/.github/workflows/CPPTest.yml +++ b/.github/workflows/CPPTest.yml @@ -67,6 +67,7 @@ jobs: run: | cd ${{ env.tests_path }} copy "..\..\..\Wrappers\AngouriMath.CPP.Importing\out-x64\AngouriMath.CPP.Exporting.dll" "build\Debug\AngouriMath.CPP.Exporting.dll" + copy "..\..\..\Wrappers\AngouriMath.CPP.Importing\out-x64\AngouriMath.CPP.Exporting.lib" "build\Debug\AngouriMath.CPP.Exporting.lib" - name: 'Copying the library for Linux' if: ${{ matrix.os == 'ubuntu-latest' }} From 0945b2e8762268064a3d5da8ae3a950a28e721cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 09:08:40 +0000 Subject: [PATCH 13/18] Add debugging to list Windows output files Added a debug step to list files in the out-x64 directory after the Windows build to diagnose why the .lib file is not being found. This will help identify if the file is not being generated or not being copied correctly. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index 7f5efcb37..cc621eb2a 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -51,6 +51,13 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" dotnet publish -p:NativeLib=Shared -p:SelfContained=true -p:PublishAot=true -r ${{ matrix.flag }} -c release + - name: 'Debug: List files in out-x64 for Windows' + if: ${{ matrix.os == 'windows-latest' }} + shell: cmd + run: | + cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + dir + - name: 'Building the library into native for Linux & MacOS' if: ${{ matrix.os != 'windows-latest' }} run: | From 9cb6407fda7cd7e30b18575381341f22a731ec80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 09:26:45 +0000 Subject: [PATCH 14/18] Copy .lib file from bin directory for Windows The NativeAOT publish with NativeLib=Shared only copies the .dll to the publish directory. The .lib import library remains in the intermediate build output directory (bin\Release\net10.0\win-x64). Added: - Debug step to list .lib files in the bin directory - Copy command to explicitly copy .lib files from bin to out-x64 Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index cc621eb2a..bda93e51c 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -57,6 +57,17 @@ jobs: run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 dir + cd ..\..\AngouriMath.CPP.Exporting\bin\Release\net10.0\win-x64 + echo. + echo Listing bin directory: + dir *.lib + + - name: 'Copy .lib file for Windows' + if: ${{ matrix.os == 'windows-latest' }} + shell: cmd + run: | + cd Sources/Wrappers/AngouriMath.CPP.Exporting + copy bin\Release\net10.0\win-x64\*.lib ..\AngouriMath.CPP.Importing\out-x64\ - name: 'Building the library into native for Linux & MacOS' if: ${{ matrix.os != 'windows-latest' }} From 9626fd5ceb4eba1de63ac3394caa41bfc816f011 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 09:51:08 +0000 Subject: [PATCH 15/18] Generate import library from DLL using lib.exe NativeAOT with NativeLib=Shared doesn't generate a .lib import library automatically. Since no .lib files exist in the bin directory, we need to generate one from the DLL. Using lib.exe with /def flag to generate an import library from the exported symbols in the DLL. This creates AngouriMath.CPP.Exporting.lib from AngouriMath.CPP.Exporting.dll. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index bda93e51c..ece093b37 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -61,13 +61,15 @@ jobs: echo. echo Listing bin directory: dir *.lib + dir *.dll - - name: 'Copy .lib file for Windows' + - name: 'Generate .lib file for Windows' if: ${{ matrix.os == 'windows-latest' }} shell: cmd run: | - cd Sources/Wrappers/AngouriMath.CPP.Exporting - copy bin\Release\net10.0\win-x64\*.lib ..\AngouriMath.CPP.Importing\out-x64\ + call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + lib /def /out:AngouriMath.CPP.Exporting.lib /machine:x64 AngouriMath.CPP.Exporting.dll - name: 'Building the library into native for Linux & MacOS' if: ${{ matrix.os != 'windows-latest' }} From b25fc67eb71ab483fdd14df16fadf6cfa5633289 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 09:52:40 +0000 Subject: [PATCH 16/18] Fix import library generation to use dumpbin and .def file The previous lib.exe command was incorrect - lib /def expects a .def file, not a DLL directly. Updated to: 1. Use dumpbin to extract exported symbols from the DLL 2. Parse the exports and create a .def file 3. Use lib.exe with the .def file to generate the import library This properly creates the .lib import library needed for linking. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index ece093b37..e8f03185d 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -69,7 +69,11 @@ jobs: run: | call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 - lib /def /out:AngouriMath.CPP.Exporting.lib /machine:x64 AngouriMath.CPP.Exporting.dll + dumpbin /exports AngouriMath.CPP.Exporting.dll > exports.txt + echo LIBRARY AngouriMath.CPP.Exporting > AngouriMath.CPP.Exporting.def + echo EXPORTS >> AngouriMath.CPP.Exporting.def + for /f "skip=19 tokens=4" %%A in (exports.txt) do if not "%%A"=="" echo %%A >> AngouriMath.CPP.Exporting.def + lib /def:AngouriMath.CPP.Exporting.def /out:AngouriMath.CPP.Exporting.lib /machine:x64 - name: 'Building the library into native for Linux & MacOS' if: ${{ matrix.os != 'windows-latest' }} From 43ef0990ab634b2d46b9eef1ffa14a4ea976d0b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:37:10 +0000 Subject: [PATCH 17/18] Add debugging and error checking for vcvars64.bat The tools weren't found despite calling vcvars64.bat. Added: - Error check after vcvars64.bat to ensure it succeeds - where commands to show the actual paths of dumpbin and lib - This will help diagnose why the MSVC tools aren't in the PATH Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index e8f03185d..a36faca8d 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -68,7 +68,14 @@ jobs: shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + if errorlevel 1 ( + echo ERROR: Failed to initialize MSVC environment + exit /b 1 + ) cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + echo Checking for dumpbin and lib... + where dumpbin + where lib dumpbin /exports AngouriMath.CPP.Exporting.dll > exports.txt echo LIBRARY AngouriMath.CPP.Exporting > AngouriMath.CPP.Exporting.def echo EXPORTS >> AngouriMath.CPP.Exporting.def From 7ce6675241d808b86a4cd6e16daab35e9cb5d0df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:49:46 +0000 Subject: [PATCH 18/18] Use ilammy/msvc-dev-cmd action to setup MSVC environment The hardcoded vcvars64.bat path was incorrect - VS 2022 Enterprise isn't installed at that location on GitHub Actions runners. Switched to using the ilammy/msvc-dev-cmd@v1 action which: - Automatically finds the VS installation - Sets up the MSVC environment properly - Works across different VS editions and versions - Persists environment variables across steps This ensures dumpbin and lib.exe are available in the PATH. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> --- .github/workflows/CPPBuild.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index a36faca8d..308a09a26 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -42,13 +42,16 @@ jobs: sudo apt-get install zlib1g-dev sudo apt-get install libkrb5-dev + - name: 'Setup MSVC environment' + if: ${{ matrix.os == 'windows-latest' }} + uses: ilammy/msvc-dev-cmd@v1 + - name: 'Building the library into native for Windows' if: ${{ matrix.os == 'windows-latest' }} shell: cmd run: | cd Sources/Wrappers/AngouriMath.CPP.Exporting mkdir ../AngouriMath.CPP.Importing/out-x64 - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" dotnet publish -p:NativeLib=Shared -p:SelfContained=true -p:PublishAot=true -r ${{ matrix.flag }} -c release - name: 'Debug: List files in out-x64 for Windows' @@ -67,11 +70,6 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - if errorlevel 1 ( - echo ERROR: Failed to initialize MSVC environment - exit /b 1 - ) cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 echo Checking for dumpbin and lib... where dumpbin