fix: harden macOS support and shorten the README - #68
Merged
Merged
Conversation
- WebSocketClient's network thread blocks SIGPIPE. OpenSSL sends with write(), so a reset peer raised SIGPIPE on every POSIX platform once an application restored the default handler that libwebsockets turns off. - KALSHI_NATIVE_ARCH probes -march=native at configure time and stops when the compiler rejects it for the target, as universal builds do. - make lint/format/tidy find Homebrew's keg-only llvm@18. - CI builds macOS against 13.3, the minimum deployment target that std::to_chars(double) requires. - README is shorter: an Errors section explains Result/std::expected after the first example, and the setup states the tested platforms.
Reddimus
force-pushed
the
fix/macos-readme
branch
from
September 25, 2026 21:35
3e78cfa to
5381855
Compare
…h probe Review of everything since v0.6.1: - macOS and the BSDs send a write's SIGPIPE to the whole process, so the network thread's mask protected only Linux. Sockets now also set SO_NOSIGPIPE in LWS_CALLBACK_CONNECTING where the OS defines it. A local wss server that resets connections killed the mask-only build with SIGPIPE; the fixed build survives on macOS and Linux. - check_cxx_compiler_flag cached the -march=native result, so a reconfigure with different architectures reused a stale answer. - LoopReport counted the allocation made by recording the instructions counter on macOS.
Reddimus
added a commit
that referenced
this pull request
Sep 25, 2026
## Summary Releases 0.6.2: sets the CMake version, moves the `[Unreleased]` notes into a `[0.6.2]` section, adds its compare links, and points the README's FetchContent example at `v0.6.2`. 0.6.2 contains #65 (allocation and instruction counters in the benchmarks, with realistic fixtures), #67 (`RateLimitedTransport` stays inside the batch body and no longer copies each order: 26 allocations down to 6 for 20 orders), and #68 (SIGPIPE protection, macOS build fixes, and the shorter README). No public API changes. After this merges, tagging `v0.6.2` on the merge commit runs `release.yml`. It checks the tag against the CMake version and the CHANGELOG section, waits for CI on that commit, publishes the release, and dispatches the API reference deploy to GitHub Pages. ## Checks - [x] `tools/project_version.sh` prints 0.6.2 - [x] `release.yml`'s extraction of the `[0.6.2]` section yields the notes - [x] `make lint-docs` and `./tools/test_consumers.sh` pass - [x] SemVer impact: this is the 0.6.2 patch release
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
This makes macOS support explicit and tested, and shortens the README.
SIGPIPE. A connection the peer resets can no longer end the process.
WebSocketClientrelied on libwebsockets callingsignal(SIGPIPE, SIG_IGN)process-wide, and an app that restores the default handler undoes that. OpenSSL sends with plainwrite(), soMSG_NOSIGNALnever applied to wss://. Two mechanisms are needed, because the kernels differ:SO_NOSIGPIPEinLWS_CALLBACK_CONNECTING.Tests check the socket option and the thread mask. An end-to-end run uses a real client against a local wss server that resets every connection, with SIGPIPE at its default. The earlier mask-only build dies with exit 141 on macOS. This build survives 23 resets on both macOS and Ubuntu 24.04.
macOS 13.3 minimum.
std::to_chars(double)needs it: a 13.2 build fails only on that call insrc/api/support.cpp. The README now states the minimum, and the macOS CI job builds atCMAKE_OSX_DEPLOYMENT_TARGET=13.3. The linker warns that Homebrew's dylibs target 26.0; that's expected.KALSHI_NATIVE_ARCHnow probes-march=nativeon every configure and stops with a clear message when the compiler rejects it for the target. That covers universal builds,CMAKE_OSX_ARCHITECTURES=x86_64, andCMAKE_APPLE_SILICON_PROCESSOR=x86_64. Before, the build failed partway through withunknown target CPU 'apple-m4'.Tools.
make lint,make format, andmake tidyfind Homebrew's keg-onlyllvm@18, so CONTRIBUTING drops itsCLANG_FORMATexport.Benchmarks (macOS).
allocsno longer counts the allocation made by recording theinstructionscounter. This came up in the review of test(bench): count allocations and use realistic fixtures #65.README. It's shorter.
Result/std::expectedmoves from the intro into a short Errors section after the first example, and the setup names the tested platforms. The repo description will dropstd::expectedtoo; I'll update it after merge.No Intel macOS CI job: Homebrew has stopped building Intel bottles, and the Linux and Windows jobs already cover x86_64 code generation. Instead, I built an x86_64 slice once, locally under Rosetta, with vcpkg
x64-osxdependencies (Glaze 8.4). All 282 tests passed.Checks
make format lint test(282 tests), with the stockPATHfinding llvm@18make sanitize,make tsan,make tidy,./tools/test_consumers.sh,make docsto_charsas expected. Ran theKALSHI_NATIVE_ARCHprobe witharm64;x86_64,x86_64,CMAKE_APPLE_SILICON_PROCESSOR=x86_64, a presetCMAKE_SYSTEM_NAME, and the host.-Wall -Wextra -Wpedantic -Werror; markdownlint cleanCHANGELOG.mdupdated under[Unreleased]