Enable invariant globalization mode to remove ICU dependency#146
Enable invariant globalization mode to remove ICU dependency#146BrettKinny merged 1 commit intomainfrom
Conversation
The app uses only culture-invariant operations (ordinal string comparisons, fixed format strings, ISO 8601 timestamps), so full ICU/globalization support is unnecessary. Setting InvariantGlobalization=true in all .csproj files eliminates the runtime dependency on libicu, simplifying Linux deployment. https://claude.ai/code/session_01FJHaXGtwgSBicEuLMHpvVg
Code ReviewSummaryThis PR enables invariant globalization mode to remove the ICU library dependency. While the goal is excellent (simplifying deployment), there are critical test failures that must be addressed before merging. 🔴 Critical Issues1. OPC Foundation Server SDK IncompatibilityAll integration tests fail with the following error when the test server attempts to start: Impact: 93 out of 523 tests fail (all integration tests that require the test server). Root cause: The OPC Foundation's Recommendation:
2. Flaky Test - CsvRecordingManagerTests.RecordValue_WritesValueToFileThis test passes in isolation but fails intermittently when run with the full suite. This appears to be a pre-existing timing/isolation issue unrelated to this PR, but should be noted. ✅ What Works Well
📋 Testing ResultsNon-integration tests: ✅ 429/430 passed (1 flaky test) 🔧 Recommended Fixdiff --git a/Tests/Opcilloscope.TestServer/Opcilloscope.TestServer.csproj b/Tests/Opcilloscope.TestServer/Opcilloscope.TestServer.csproj
index 7b0dbb8..b85e40c 100644
--- a/Tests/Opcilloscope.TestServer/Opcilloscope.TestServer.csproj
+++ b/Tests/Opcilloscope.TestServer/Opcilloscope.TestServer.csproj
@@ -7,7 +7,6 @@
<Nullable>enable</Nullable>
<RootNamespace>Opcilloscope.TestServer</RootNamespace>
<AssemblyName>Opcilloscope.TestServer</AssemblyName>
- <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
diff --git a/Tests/Opcilloscope.Tests/Opcilloscope.Tests.csproj b/Tests/Opcilloscope.Tests/Opcilloscope.Tests.csproj
index b2e5c40..9f27636 100644
--- a/Tests/Opcilloscope.Tests/Opcilloscope.Tests.csproj
+++ b/Tests/Opcilloscope.Tests/Opcilloscope.Tests.csproj
@@ -7,7 +7,6 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
- <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>This approach:
🔍 Additional ConsiderationsSecurity: ✅ No security concerns VerdictRequest changes: The test failures must be fixed before merging. The suggested fix (removing InvariantGlobalization from test projects only) maintains all the deployment benefits while ensuring tests pass. Once tests are green, this will be an excellent improvement to the project! 🚀 |
Summary
This PR removes the runtime dependency on ICU (International Components for Unicode) libraries by enabling .NET's invariant globalization mode. This simplifies deployment and eliminates the need for platform-specific library installation steps.
Key Changes
<InvariantGlobalization>true</InvariantGlobalization>to all three project files:Opcilloscope.csproj(main application)Opcilloscope.TestServer.csproj(test server)Opcilloscope.Tests.csproj(test project).github/workflows/ci.yml)Implementation Details
By enabling invariant globalization mode, the application will use the invariant culture for all globalization operations rather than relying on system-provided ICU libraries. This is a common approach for applications that don't require locale-specific formatting or collation, reducing deployment complexity and improving portability across different Linux distributions.
https://claude.ai/code/session_01FJHaXGtwgSBicEuLMHpvVg