feat: pure C API isolation layer for cross-compiler compatibility#1
Merged
feat: pure C API isolation layer for cross-compiler compatibility#1
Conversation
Introduce a pure C ABI boundary between the C++/Fortran core library (wsjtx_core) and the Node.js N-API binding (.node). This solves the Windows crash where MSVC-compiled Node.js failed to load MinGW-compiled native extensions due to ABI incompatibility. Architecture: .node (N-API) -> C ABI -> wsjtx_core shared library (C++/Fortran) - New: native/wsjtx_c_api.h and .cpp (pure C interface with opaque handle) - Modified: wsjtx_wrapper to use C API instead of C++ direct linking - Rewritten: CMakeLists.txt with dual-target build (wsjtx_core + .node) - Windows: two-phase build (MinGW core DLL + MSVC .node) - Linux/macOS: single cmake build produces both targets - CI workflow simplified from 773 to ~200 lines Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Linux/macOS build failed because std::invalid_argument needs <stdexcept> (MSVC includes it transitively, GCC does not) - macOS packaging failed because libwsjtx_core.dylib was manually copied before dylibbundler tried to copy it as a dependency. Removed manual copy, added build/Release to search paths, and use -of flag for overwrite safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dylibbundler already follows transitive dependencies when processing .node, so it bundles libwsjtx_core.dylib and all its deps (fftw, gfortran, etc.) in a single pass. The second dylibbundler call was redundant and failed because it tried to copy already-bundled files onto themselves. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add `publish` job to build.yml: triggers only on v* tag push, downloads prebuilds from collect-artifacts, validates all 5 platforms, runs npm publish, and creates GitHub Release with platform archives - Simplify prepublishOnly to just build:ts (CI handles validation) - Remove manual scripts/create-release.sh (now integrated in CI) - Update PUBLISHING.md to reflect the new one-step workflow New release flow: npm version patch && git push --tags → fully automated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add npm run test:full to CI test steps, which runs the comprehensive test suite including FT8 encode→WAV→decode round-trip verification. This ensures the native binaries actually work end-to-end, not just load. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.node(N-API) → C ABI →wsjtx_coreshared library (C++/Fortran)Changes
native/wsjtx_c_api.hand.cpp— pure C interface with opaque handlewsjtx_wrapperto use C API instead of C++ direct linkingCMakeLists.txtwith dual-target build (wsjtx_core + .node)Test plan
🤖 Generated with Claude Code