Files
bitcoin/depends/packages/capnp.mk
xyzconstant e07224f2d5 depends: fix IPC listeners on macOS dying when accepting a dead socket
After `accept()`, kj unconditionally calls `setsockopt(TCP_NODELAY)` on the
connection socket. For Unix sockets, kj handles the usual "not supported"
error codes, however, on macOS EINVAL is returned when the client has already
disconnected and kj only tolerates that code when built for FreeBSD.
The unexpected error then goes uncaught in the accept loop, causing the
listener to stop accepting new connections.

See https://github.com/bitcoin-core/libmultiprocess/issues/319 for more details.

Patch is the upstream commit https://github.com/capnproto/capnproto/commit/85d8e47f,
the 1.x backport of https://github.com/capnproto/capnproto/commit/7df5bd078
(https://github.com/capnproto/capnproto/pull/2748).
2026-08-24 21:01:15 -03:00

35 lines
1008 B
Makefile

package=capnp
$(package)_version=$(native_$(package)_version)
$(package)_download_path=$(native_$(package)_download_path)
$(package)_download_file=$(native_$(package)_download_file)
$(package)_file_name=$(native_$(package)_file_name)
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
$(package)_patches=macos_accept_dead_socket.patch
define $(package)_set_vars
$(package)_config_opts := -DBUILD_TESTING=OFF
$(package)_config_opts += -DWITH_OPENSSL=OFF
$(package)_config_opts += -DWITH_ZLIB=OFF
$(package)_cxxflags += -fdebug-prefix-map=$($(package)_extract_dir)=/usr -fmacro-prefix-map=$($(package)_extract_dir)=/usr
endef
define $(package)_preprocess_cmds
patch -p2 < $($(package)_patch_dir)/macos_accept_dead_socket.patch
endef
define $(package)_config_cmds
$($(package)_cmake) .
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef
define $(package)_postprocess_cmds
rm -rf lib/pkgconfig
endef