Commit Graph

1784 Commits

Author SHA1 Message Date
Claude
13739445e8 docs(cmake): document add_subdirectory support and the target changes
- FairMQ::FairMQ exists in the build tree
- FairMQ uses PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR
- The exported library links Boost::headers

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
7b2923d6d5 refactor(cmake): drop legacy export option and public test includes
- EXPORT_LINK_INTERFACE_LIBRARIES has no effect with policy CMP0022
- Test targets are executables, so their include directories are private

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
44bdfe9ddc refactor(cmake): link CMAKE_DL_LIBS and Boost::headers
- Use the platform variable instead of the literal dl
- Use Boost::headers instead of the legacy alias Boost::boost

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
268fcafcc6 feat(cmake): add the FairMQ::FairMQ alias target to the build tree
- Projects that add FairMQ with add_subdirectory() use the same target
  name as projects that use the installed package

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
0dfbb73d86 refactor(cmake): use PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR
- CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR point to the top-level project
  and break add_subdirectory() and FetchContent
- Find the helper modules relative to the CMakeLists.txt that includes them
- Replace @CMAKE_BINARY_DIR@ in the example test scripts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
ba286b4449 docs(cmake): document the CMake 3.25 minimum
- Update the dependency table, the build options and the test helper

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
6afa1b7aa1 ci: test the minimum CMake version
- Build, test and check the installation with CMake 3.25.0 from PyPI

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
c8d9fe355d refactor(cmake): replace fairmq_build_option with CMake commands
- Use option() and cmake_dependent_option() directly
- Keep the error for BUILD_TESTING or BUILD_EXAMPLES without BUILD_FAIRMQ
- Option names and defaults are unchanged

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
d4644ae33a build!: require CMake 3.25
- Raise the minimum from 3.15 to 3.25 and the policy range to 3.31
- Remove the 3.22 version guards for ENVIRONMENT_MODIFICATION
- Link the GoogleTest target GTest::gtest, which FindGTest and the
  GoogleTest package config both provide

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:32 +01:00
Claude
6cce60be0a refactor(cmake): remove the Boost::boost fallback
- Boost::headers exists in every supported FindBoost and BoostConfig
- The else branch could never run

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
a167e96dbd refactor(cmake): remove unused asio find module and bundle script
- Nothing includes Findasio.cmake or extern/bundled_asio.cmake
- FairMQ uses Boost.Asio and has no asio submodule

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
043dd323a4 docs(cmake): describe the fixed CMake behavior
- Remove the notes about the empty FairMQ_PACKAGE_COMPONENTS, the typo in
  the Boost.Asio definition, the unused IWYU variable and the
  installed start scripts
- Document that the installed scripts use the install-time prefix and
  that FairMQ no longer sets CMAKE_CONFIGURATION_TYPES

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
201d784ee4 fix(examples): drop the empty transport suffix from the test name
- A NO_TRANSPORT example is now the test Example.<name>
- The test script no longer gets an empty transport argument

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
9447556d7c fix(examples): use the installed program directory for built-in devices
- Installed programs are in <prefix>/bin, not <prefix>/bin/fairmq
- Installed start scripts did not find the built-in devices

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
ac1857c7d8 ci: check the installed package with a downstream project
- Install to a prefix, relocate it and build a minimal consumer that uses
  find_package(FairMQ) and FairMQ::FairMQ
- Fail if documented package variables are missing or if installed files
  still refer to the original prefix

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
488bbddf9c fix(examples): resolve the install prefix at install time
- Configure installed example scripts and topologies in install(CODE) so
  cmake --install --prefix and DESTDIR produce correct paths
- Drop the second configure_file() copy per script
- Remove the stale fairmq/sdk directory from the build-tree PATH
- Remove commented-out DDS test blocks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
2061b8636d fix(cmake): drop misspelled BOOST_ASIO_HAS_HAS_STD_CHRONO definition
- The macro name is a typo and has no effect
- It was exported to every consumer as a PUBLIC definition

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
cd29ff72be fix(cmake): parse multi-digit ZeroMQ version components
- The version regexes accepted a single digit only
- A version such as 4.3.10 was misread

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
29060378b7 fix(cmake): respect multi-config generators
- Set a default CMAKE_BUILD_TYPE only for single-config generators
- Stop overriding CMAKE_CONFIGURATION_TYPES
- Do not require CMAKE_BUILD_TYPE when generating the package config

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
b6407c53a4 fix(cmake): use the real variables for static analysis tools
- CMAKE_CXX_IWYU is not a CMake variable. Use
  CMAKE_CXX_INCLUDE_WHAT_YOU_USE and the include-what-you-use program
- Store find_program results in their own variables instead of misusing
  the *_FOUND names as cache entries

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
7d268912ae fix(cmake): find git with find_package(Git)
- The old check dereferenced GIT_EXECUTABLE, so it tested an empty name
  and re-ran find_program every time by accident
- FindGit provides the same GIT_EXECUTABLE variable

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
1a98b90d09 fix(cmake): remove stray brace from package components list
- The list name contained a trailing brace, so the joined string was empty
- The installed FairMQConfig.cmake then set FairMQ_PACKAGE_COMPONENTS to
  an empty value

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:21:31 +01:00
Claude
25f44828d7 docs(shmem): document that sender and receiver must use the same kind of type
- shmem uses one metadata format for a single message and another for
  a multipart message; Receive(Parts) of a single send, or
  Receive(MessagePtr) of a multipart send, gives wrong metadata or a
  crash
- Add a sender/receiver table to the messages page of the
  documentation and a note to Channel::Receive()
- Update the source line links into Channel.h
- Keep PartsTransfer.SingleSendMultipartReceive disabled: a fix
  changes the shmem wire format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
102cdaf40e fix(shmem): refuse to send an empty Parts
- zeromq refuses an empty Parts with TransferCode::error; shmem sent a
  message with zero parts and returned 0, and the receiver got a
  Receive() with zero parts
- Refuse it in shmem too, with the same warning
- Enable PartsTransfer.EmptyPartsIsRefused
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
50387fe5cc fix(shmem): fill the result of Monitor::GetDebugInfo()
- The function reserved each result vector and then wrote to
  result[segment][handle], past the end of the vector: it returned
  empty vectors and corrupted the heap
- Append one entry per buffer, in the order of the buffer offset
- Check the debug map for null before its first use
- Name the map entries (segment id, offset, buffer) instead of
  .first and .second
- Enable Monitor.GetDebugInfo (needs FAIRMQ_DEBUG_MODE)
- Update the documentation page that described the defect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
47784207d6 fix(control): handle all keys of one input in interactive mode
- The REPL polled the stdin fd, then read one key with std::cin; the
  other keys of the same read stayed in the std::cin buffer, and
  poll() did not report them again
- Read one key with read(2), so poll() reports each key that is not
  handled yet; skip whitespace, as operator>> did
- Stop reading at end of input: before, a closed stdin (e.g.
  < /dev/null) made the loop print the help without a pause
- Enable ControlPlugin.SeveralKeysInOneInput
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
9b6662f6a9 fix(device): print --print-channels and --version output to stdout
- DeviceRunner sets the console log severity to "nolog" for both
  options, but printed their output with LOGV(info), so both options
  printed nothing
- Add Device::PrintRegisteredChannels(std::ostream&) for the
  machine-readable channel list; the version goes to std::cout, like
  --help and --print-options
- Enable DeviceRunner.PrintChannels and DeviceRunner.Version
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
b70595cebe fix(config): reject channel properties of the wrong type
- ptree::get(key, default) returns the default also for a value that
  does not convert, so a typo (e.g. sndBufSize=big) silently gave the
  default value
- Use the default only for a missing key; throw ParserError with the
  key and the value for a value of the wrong type
- Rethrow parser errors in the config plugin: before, the device
  logged the error and continued without its channel configuration
- Enable JSONParser and SuboptParser RejectsValuesOfTheWrongType
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
442b203d0d fix(fsm): refuse all transitions in the Error state
- The Error state is a terminate state: the state machine ignores all
  events in it and calls no action, so ChangeState() returned the
  result of the previous transition (ErrorFound: true)
- Return false for each transition in the Error state, except for
  ErrorFound: the device is already in the Error state, so callers
  such as ChangeStateOrThrow(ErrorFound) in Device::RunWrapper() or
  in user code do not throw
- Enable StateMachine.RefusesTransitionsInError
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
8de8505f8c fix(docs): center the content on wide screens
- Keep the table of contents at most 3rem wider than the sidebar
- Center the content between the two sidebars
- Use a content width of 52rem from a window width of 110rem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:33:04 +01:00
Claude
93dfef1a74 docs: replace the Markdown docs with links to the site
- Remove docs/*.md and docs/images/
- Rewrite README.md: description, install, first steps and links to
  the site
- Replace the READMEs of the examples, fairmq/shmem, fairmq/devices and
  fairmq/tools with links to the site pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:21:28 +01:00
Claude
b8d0cf7206 ci(docs): build the site and deploy it to GitHub Pages
- Build the site and check all links for each pull request
- Deploy the site of dev to GitHub Pages
- Let Dependabot update the npm packages of docs/ once a month

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:21:28 +01:00
Claude
992db82b91 feat(docs): add the documentation site
- Astro and Starlight site in docs/ for
  https://fairrootgroup.github.io/FairMQ/
- 64 pages in eight groups: start, concepts, guides, shared memory,
  examples, tools, reference and project
- API reference and source browser from the Doxygen XML of fairmq/
- Code samples are snippets of the repository files; the build fails
  when a snippet does not match
- Option tables take the names, types and defaults from the code
- Interactive diagrams: state machine, zero-copy transfer, region
  acknowledgements, session objects, topology and channel anatomy
- The 404 page sends the URLs of the Doxygen site to the new pages
- scripts/check-pages.mjs checks pages, snippets and links without a
  build; scripts/check-links.mjs checks all links in dist/

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:21:28 +01:00
Claude
866f39f54e build!: remove the Doxygen documentation target
- Remove the option BUILD_DOCS, the target docs and the install of the
  HTML files
- Remove the Doxygen lookup and the docs line of the configure summary
- Remove docs/footer.html and the Doxygen entries of README.md

BREAKING CHANGE: The option BUILD_DOCS and the package component docs do
not exist any more. The site in docs/ replaces the Doxygen HTML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:21:28 +01:00
Claude
e366c40139 test(shmem): add tests for the shared memory monitor API
- SegmentIsPresent() before, during and after the life of a factory
- RegionIsPresent() during and after the life of a region
- With shm-no-cleanup the segment stays, and Cleanup() removes it
- Add a disabled debug-mode test for a known defect: GetDebugInfo()
  writes past the end of its result vectors and returns them empty

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
4e4d21bbd0 test(device): add tests for the runner options and interactive keys
- --print-options prints the computed options and does not start the
  device
- --print-channels and --version do not start the device
- Interactive control: h, c, p, k and an invalid key print their action
- Register two channel endpoints in the StateAction device
- Add disabled tests for known defects: --print-channels and --version
  print nothing (console severity "nolog"); keys that arrive in one read
  stay in the std::cin buffer and are never handled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
89cbc968d8 test(shmem): add tests for allocation in a full segment
- For both allocation algorithms (rbtree_best_fit, simple_seq_fit)
- A message larger than the segment throws MessageBadAlloc
- A full segment throws, and allocates again after a release
- bad-alloc-max-attempts and bad-alloc-attempt-interval
- shm-throw-bad-alloc=false waits until memory is free;
  Interrupt() ends the wait with MessageBadAlloc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
4ae5a6d2f5 test(device): add tests for the data callbacks and ConditionalRun()
- OnData() with single messages and with Parts on all transports;
  a callback that returns false ends Run() and the device goes to Ready
- Two input channels (poller path) and one input channel per transport
  (one poll thread per transport, per-channel transport override)
- ConditionalRun() ends Run() when it returns false; the rate option
  limits the calls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
788ca57859 test(tools): add tests for the tools library
- RateLimiter: lower bound of the duration at 200 Hz; rate 0 does not
  sleep
- InstanceLimiter: throws above the limit, counts down on destruction
- Semaphore and SharedSemaphore: counts, blocking Wait(), shared count
- ToString(), StrStartsWith(), StrEndsWith(), ToStrVector()
- Uuid() and UuidHash() are unique
- execute(): output with prefix, stderr, exit code, stdin input,
  signal, timeout
- Skip Tools.NetworkDefaultIP on a machine without a default route

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
cc3297b2fd test(parts): add tests for Parts access and pmr messages on all transports
- Parts: variadic constructor, At() and operator[] (const and not),
  At() out of range throws, Empty(), Clear(), move
- Transfer of Parts with an empty part on all transports
- A pmr container from the transport memory resource becomes a message
  without a copy and transfers its data, on all transports
- Add disabled tests for two known defects: zeromq refuses an empty
  Parts and shmem sends it; shmem Receive(Parts) of a single-message
  Send() reads the message size as the number of parts and crashes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
bf128e0044 test(transport): add tests for the transport factory API edges
- An unknown transport name throws; an empty id gets a uuid
- shmem refuses pub and sub sockets, zeromq creates them
- GetType() per transport
- Receive is interrupted after Interrupt() and works after Resume()
- NewSimpleMessage() copies string, literal and value data;
  NewStaticMessage() uses the caller's buffer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
03465e1993 test(channel): add tcp tests with and without auto-bind
- AutoBind: a second bind on a port in use gets a port in the range,
  and both endpoints transfer data
- NoAutoBind: BindEndpoint() fails and keeps the endpoint
- PAIR over tcp in both directions, on all transports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
69064731af test(properties): add tests for the JSON and suboption channel parsers
- JSONParser: sub-channels inherit and override the channel values,
  numSockets expansion, defaults, device selection by key or id,
  errors for no id, no fairMQOptions, no channel name and no file
- SuboptParser: all keys with their types, one sub-channel per address,
  numSockets, unknown keys, no channel name, no device id
- Add disabled tests for a known defect: a value of the wrong type
  silently gives the default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
dadbecf49b test(fsm): add tests for the state machine and the state names
- Walk the device lifecycle; in each state check that the illegal
  transitions are refused and leave the state unchanged
- ResetDevice from each device state, ErrorFound from each state
- A transition is refused while another one is pending
- State change and new transition subscriptions, unsubscribe,
  PrepareState() and HandleStates() order
- Name round trips for all states and transitions; unknown names throw
- Add a disabled test for a known defect: ChangeState() returns true in
  the Error state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
f1ae05b45c test: use comparison assertions that print both values
- EXPECT_EQ/EXPECT_NE instead of EXPECT_TRUE(a == b) in the parts,
  memory resource and plugin manager tests; split the && checks
- ASSERT_NE on the message pointer before it is dereferenced
- ASSERT_TRUE/ASSERT_FALSE instead of ASSERT_EQ(x, true/false)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
8ff2214f9c test: parameterize the device state tests by state and control
- Add test::StateParam (state, control mode, stdin input) and
  WithControls() for INSTANTIATE_TEST_SUITE_P()
- Turn the 60 TEST() copies in the Exceptions, ErrorState, Signals and
  WaitFor files into one TEST_P() each
- The test names change, e.g. Exceptions.interactive_InRun is now
  Exceptions.Throw/interactive_Run, Signal_SIGINT.* is Signals.RaiseSIGINT/*
  and ErrorState.OrphanMessages is OrphanMessages.shmem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
5da5a35b4d test: parameterize the message, region, channel and option tests by transport
- Turn the per-transport TEST() copies into TEST_P() suites:
  Messages, ShmMessages, Regions, ConnectedPeers and Options
- The test names change, e.g. Resize.shmem_expanded_metadata is now
  Messages.Resize/shmem_expanded_metadata

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
6a55bf1d55 test: parameterize the protocol, poller and transfer tests by transport
- Add test::TransportParam with the transport, the expanded shm metadata
  flag and a name generator for INSTANTIATE_TEST_SUITE_P()
- Turn the per-transport TEST() copies into TEST_P() suites; the poller
  and transfer tests now also run with the expanded shm metadata
- Name the multipart suite PushPullMultipart (it shared PushPull)
- Discover the tests with NO_PRETTY_VALUES, so the ctest names are
  Suite.Case/transport
- The test names change, e.g. Pair.SingleMsg_MultiThreaded_ipc_shmem
  is now Pair.SingleMsg_MultiThreaded_ipc/shmem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
2a57a38efe refactor(test): merge the state action test devices
- Replace TestExceptions, TestErrorState, TestSignals and TestWaitFor
  with one StateAction device; the id selects the action and the state
- Run the device tests through test::RunDevices() instead of
  EXPECT_EXIT() and check the exit code and the expected log line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
be400e4752 test: run multi-process tests with one harness
- Add test::RunDevices(): starts the devices with the same session,
  transport, shm options and channel config, with a deadline per run
- Add the TestDevice base: Check() fails the device, Succeed() prints
  a marker with the transport name that the harness verifies
- Make the protocol, poller and transfer-timeout devices check their
  own results and drop the InitTask() sleeps
- Replace EXPECT_EXIT() and the copied launch code in the protocol,
  poller and transfer-timeout tests
- A device that uses the wrong transport now fails the test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00