From f9f78c05f55f4cec1bc3095a98ec0ff9d5580e1e Mon Sep 17 00:00:00 2001 From: SWS-Chipkin Date: Thu, 3 Dec 2026 13:11:50 -0700 Subject: [PATCH 1/2] Update CAS BACnet Stack submodule to 6.x 83e04a2d (6.1.2) --- CHANGELOG.md | 4 ++++ submodules/cas-bacnet-stack | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ea2bc..9725184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [Unreleased] +### Changed + +- Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02). + ## [1.2.1] - 2026-11-02 Built on CAS BACnet Stack 6.x (`1e7dffe2b`). diff --git a/submodules/cas-bacnet-stack b/submodules/cas-bacnet-stack index 1e7dffe..83e04a2 160000 --- a/submodules/cas-bacnet-stack +++ b/submodules/cas-bacnet-stack @@ -1 +1 @@ -Subproject commit 1e7dffe2b8f4c2e74463e78749653abe2d4c85da +Subproject commit 83e04a2d9bbc8ec944c2474eac906f65e8a08a66 From 05b6ea7fedd2d37c6f7999d4bf074a3ec33d8bb4 Mon Sep 17 00:00:00 2001 From: SWS-Chipkin Date: Thu, 3 Dec 2026 19:52:51 -0700 Subject: [PATCH 2/2] Find the stack library in the submodule's dist/ (stack 6.1.2 moved it from bin/) Stack 6.1.2 (#5077) installs the library into dist/ instead of bin/, so the CI workflow failed after the stack build and the example could not find the library at run time. The workflow, the run-time search and the docs now use dist/. CHANGELOG updated. --- .github/workflows/release.yml | 8 ++++---- .gitignore | 2 +- AGENTS.md | 2 +- BACnetProfileExampleBSSCS.csproj | 10 +++++----- CHANGELOG.md | 1 + README.md | 12 ++++++------ TUTORIAL.md | 4 ++-- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58bac6d..dc8e22e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ # Unlike the C++/Node siblings, this build has TWO stages: (1) build the native CAS BACnet # Stack shared library from the stack submodule's C++ source with the stack's CMake, its # only build (the windows-x64-dll preset on Windows, linux-x64-release-shared on Linux, -# then `cmake --install` into the submodule's bin/ - see README.md "Build the native CAS +# then `cmake --install` into the submodule's dist/ - see README.md "Build the native CAS # BACnet Stack library"), then (2) `dotnet build -c Release` this project and copy that # native library next to its output so the P/Invoke adapter can find it at run time. The # C# adapter is compiled in place from submodules/cas-bacnet-stack/adapters/csharp/. @@ -88,7 +88,7 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll build failed" } cmake --install build-windows-x64-dll --config Release if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll install failed" } - Get-ChildItem bin\CASBACnetStack_x64_Release.dll + Get-ChildItem dist\CASBACnetStack_x64_Release.dll - name: Build the native CAS BACnet Stack library (Linux - CMake preset linux-x64-release-shared) if: runner.os == 'Linux' @@ -100,7 +100,7 @@ jobs: cmake --preset linux-x64-release-shared cmake --build --preset linux-x64-release-shared cmake --install build-linux-x64-release-shared - ls -la bin/libCASBACnetStack_x64_Release.so + ls -la dist/libCASBACnetStack_x64_Release.so - name: dotnet build (Release) shell: bash @@ -108,7 +108,7 @@ jobs: - name: Copy the native library next to the .NET output shell: bash - run: cp "submodules/cas-bacnet-stack/bin/${{ matrix.nativelib }}" "${{ matrix.outdir }}/${{ matrix.nativelib }}" + run: cp "submodules/cas-bacnet-stack/dist/${{ matrix.nativelib }}" "${{ matrix.outdir }}/${{ matrix.nativelib }}" - name: Smoke test + metrics (starts, binds, stays up; measures time to 'ready') shell: bash diff --git a/.gitignore b/.gitignore index 73a243b..a892333 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ obj/ *.log # The CAS BACnet Stack library is a BUILD ARTIFACT of the separately licensed stack, built -# from the submodule into submodules/cas-bacnet-stack/bin/ (README.md "Build the native CAS +# from the submodule into submodules/cas-bacnet-stack/dist/ (README.md "Build the native CAS # BACnet Stack library") and copied by the .csproj only into the gitignored build output # (bin/Release/net8.0/). It is never committed or released from this repository - whatever # its name or platform. diff --git a/AGENTS.md b/AGENTS.md index 715b1d3..0058773 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -76,7 +76,7 @@ windows-x64-dll`, `cmake --build --preset windows-x64-dll-release`, `cmake `linux-x64-release-shared` preset on Linux) - a customer-interface build, never the test-tool library. The stack no longer has `projects/msvs/` or `projects/linux/` (removed before `6.x` @ `29b83de6`). See README.md for the -exact commands. `cmake --install` puts the library in the submodule's `bin/`; +exact commands. `cmake --install` puts the library in the submodule's `dist/`; the `.csproj` copies it from there into the build output when it exists there. Do not try to fold that into the `.csproj` as a pre-build target unless you also make it a no-op when the DLL/.so is already diff --git a/BACnetProfileExampleBSSCS.csproj b/BACnetProfileExampleBSSCS.csproj index f34d0a6..e1ca957 100644 --- a/BACnetProfileExampleBSSCS.csproj +++ b/BACnetProfileExampleBSSCS.csproj @@ -60,13 +60,13 @@ - - diff --git a/CHANGELOG.md b/CHANGELOG.md index 9725184..88f0f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ### Changed - Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02). +- The stack library is now found in the submodule's `dist/` folder, where 6.1.2's `cmake --install` puts it (it was `bin/`). The CI workflow, the run-time search and the build instructions all use `dist/`. ## [1.2.1] - 2026-11-02 diff --git a/README.md b/README.md index fcf8427..7afdbae 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ The C# adapter's P/Invoke declarations resolve `CASBACnetStack_x64_Release.dll` (Windows) / `libCASBACnetStack_x64_Release.so` (Linux) from the process's own directory (or the system library search path) at run time - there is no bundled copy and no NuGet package. **Build it yourself -from the stack submodule**: it lands in `submodules/cas-bacnet-stack/bin/`, and +from the stack submodule**: it lands in `submodules/cas-bacnet-stack/dist/`, and `dotnet build` copies it from there into this project's build output. **The stack library is never committed to this repository and never released.** @@ -271,7 +271,7 @@ in the submodule; its README's "Building and testing" and AGENTS.md "Building" list the presets). Each preset builds into `submodules/cas-bacnet-stack/build-/` (ignored by the stack's own `.gitignore`), and `cmake --install build-` copies the library into -the submodule's `bin/`, under exactly the name the adapter loads. It is a +the submodule's `dist/`, under exactly the name the adapter loads. It is a customer-interface build (no test-tool exports; `CASBACNET_LIBRARY_TESTTOOL` is off by default). Run the commands from the submodule's folder, because `cmake --preset` reads `CMakePresets.json` from the current directory. @@ -284,10 +284,10 @@ Visual Studio 2022). PowerShell or a Developer Prompt: cd submodules\cas-bacnet-stack cmake --preset windows-x64-dll cmake --build --preset windows-x64-dll-release -cmake --install build-windows-x64-dll --config Release # -> bin\CASBACnetStack_x64_Release.dll +cmake --install build-windows-x64-dll --config Release # -> dist\CASBACnetStack_x64_Release.dll cd ..\.. -dotnet build -c Release # copies submodules\cas-bacnet-stack\bin\CASBACnetStack_x64_Release.dll next to the .exe +dotnet build -c Release # copies submodules\cas-bacnet-stack\dist\CASBACnetStack_x64_Release.dll next to the .exe ``` The install step copies the DLL only: its import library has the stack's @@ -299,14 +299,14 @@ static-library name and stays in the build tree. cd submodules/cas-bacnet-stack cmake --preset linux-x64-release-shared cmake --build --preset linux-x64-release-shared -cmake --install build-linux-x64-release-shared # -> bin/libCASBACnetStack_x64_Release.so +cmake --install build-linux-x64-release-shared # -> dist/libCASBACnetStack_x64_Release.so cd ../.. dotnet build -c Release # copies it next to the executable ``` The `.csproj` copies the DLL (or `libCASBACnetStack_x64_Release.so`) from the -submodule's `bin/` into the build output whenever it exists there, so build the +submodule's `dist/` into the build output whenever it exists there, so build the native library first and `dotnet build` second. Either way it lands in the same directory as `BACnetProfileExampleBSSCS.dll`/`.exe` (`bin/Release/net8.0/`, gitignored) - the .NET native-library resolver looks diff --git a/TUTORIAL.md b/TUTORIAL.md index 00e25cc..d8fab64 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -291,9 +291,9 @@ defect, not a feature. | Symptom | Cause / fix | |---------|-------------| -| `ERROR: This example cannot run without the CAS BACnet Stack library.` (exit code 1) | The CAS BACnet Stack library (`CASBACnetStack_x64_Release.dll` / `libCASBACnetStack_x64_Release.so`) is not in the folder that holds the executable - the "Looked in" line names it. A release never includes it: it is a commercially licensed (paid) library from Chipkin (). Licensed customers build it from the submodule (README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library)) and put it next to the executable; a source build's `dotnet build -c Release` copies it there from `submodules/cas-bacnet-stack/bin/`. | +| `ERROR: This example cannot run without the CAS BACnet Stack library.` (exit code 1) | The CAS BACnet Stack library (`CASBACnetStack_x64_Release.dll` / `libCASBACnetStack_x64_Release.so`) is not in the folder that holds the executable - the "Looked in" line names it. A release never includes it: it is a commercially licensed (paid) library from Chipkin (). Licensed customers build it from the submodule (README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library)) and put it next to the executable; a source build's `dotnet build -c Release` copies it there from `submodules/cas-bacnet-stack/dist/`. | | The same message followed by `Details: ...` | The library file is there but could not be loaded: the wrong architecture (this build is x64), a missing dependency, or a damaged file. The `Details` line is the runtime's reason. | -| `DllNotFoundException: Unable to load DLL 'CASBACnetStack_x64_Release'` | The native library is missing from the build output directory. See README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library) - it is a separate step from `dotnet build`: build it from the submodule into `submodules/cas-bacnet-stack/bin/`, then run `dotnet build -c Release` again, which copies it next to `BACnetProfileExampleBSSCS.dll`/`.exe`. | +| `DllNotFoundException: Unable to load DLL 'CASBACnetStack_x64_Release'` | The native library is missing from the build output directory. See README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library) - it is a separate step from `dotnet build`: build it from the submodule into `submodules/cas-bacnet-stack/dist/`, then run `dotnet build -c Release` again, which copies it next to `BACnetProfileExampleBSSCS.dll`/`.exe`. | | `DllNotFoundException` mentioning `CASBACnetStack_x64_Debug` | You built/ran in `Debug` configuration. The stack's CMake DLL presets build only the Release library (`CASBACnetStack_x64_Release`) - see README.md [Why only a Release build](README.md#why-only-a-release-build). Build and run with `-c Release`. | | `BadImageFormatException` | The native library's architecture does not match this process. This example targets `x64` (`x64`) - make sure the DLL/.so you built is also x64. | | `System.InvalidOperationException` from `Console.KeyAvailable` | Should not happen - `CASExampleHelper.PollKey()` checks `Console.IsInputRedirected` first and reads a redirected stdin on a background thread instead. If you see this after a local edit, you likely removed that check; see [Interactive keys are a simplification](#interactive-keys-are-a-simplification). |