Skip to content

Support building and running on Ubuntu 26 (GCC 15, CMake 4.2, Boost 1.90) - #419

Merged
Seifert69 merged 3 commits into
masterfrom
ubuntu-26-support
Aug 9, 2026
Merged

Support building and running on Ubuntu 26 (GCC 15, CMake 4.2, Boost 1.90)#419
Seifert69 merged 3 commits into
masterfrom
ubuntu-26-support

Conversation

@Seifert69

Copy link
Copy Markdown
Owner

Summary

Gets DikuMUD3 building warning-free and running on Ubuntu 26 after the distro upgrade brought GCC 15, CMake 4.2, and Boost 1.90 — and fixes a 20-year-old memory-corruption bug the new toolchain exposed.

Build fixes

  • Boost components: Drop system from find_package(Boost) — Boost.System has been header-only since 1.69 and Boost 1.90 no longer ships it as a findable component. Removed the corresponding Boost::system link in mplex.
  • CMP0167: Set to NEW (guarded by if(POLICY ...)) so find_package(Boost) uses Boost's own BoostConfig.cmake instead of CMake's removed FindBoost module.
  • websocketpp: Updated the vendored copy with upstream PR Boost 1.90 zaphoyd/websocketpp#1190, as shipped by Debian/Ubuntu — Boost 1.87+ removed asio::io_service and expires_from_now, which websocketpp 0.8.2 still used. The locally added TLS example is preserved.
  • Split filesystem headers: Include <boost/filesystem/directory.hpp> explicitly in convert.cpp and dilexp.cpp; newer Boost no longer provides directory_iterator transitively via operations.hpp.

Warning cleanup (build is warning-free again)

  • t_array.h: C++20 forbids template-ids on destructors (~t_array<T>()~t_array()).
  • Fixed a malformed add_custom_command (stray valueless WORKING_DIRECTORY, invalid DEPENDS in the TARGET form) flagged by CMP0175.
  • vmcpar.y: declared the 2 known shift/reduce conflicts with %expect 2; dropped the vestigial -y (POSIX yacc) bison flag that rejects %expect.
  • Unit tests: cast [[nodiscard]] returns to void in BOOST_CHECK_THROW assertions.

Bug fix

apf_affect.cpp: the NPC weapon/spell tree-climbing loops used > GROUP_MAX instead of >= GROUP_MAX, so an affect resolving to index exactly GROUP_MAX wrote one element past the end of npc_data's fixed-size skill arrays. This has been silently corrupting adjacent memory for 20+ years; Ubuntu 26's libstdc++ bounds-checks std::array in debug builds, turning it into a SIGABRT during zone reset at boot, which is how it was found.

Testing

  • Full clean rebuild with zero warnings on Ubuntu 26 (GCC 15.2, CMake 4.2, Boost 1.90)
  • All 5 unit test suites pass via ctest
  • vme server boots fully (previously aborted during boot_db zone reset), runs, and shuts down cleanly

🤖 Generated with Claude Code

https://claude.ai/code/session_01N7CqwMRW1CqvQiBLrYPKqD

Seifert69 and others added 3 commits August 9, 2026 07:12
….90)

Build fixes:
- Drop the 'system' component from find_package(Boost): Boost.System is
  header-only since 1.69 and Boost 1.90 no longer ships it as a findable
  component. Remove the corresponding Boost::system link in mplex.
- Set policy CMP0167 to NEW (when available) so find_package(Boost) uses
  Boost's own BoostConfig.cmake instead of CMake's removed FindBoost module.
- Update vendored websocketpp with upstream PR #1190 (as shipped by
  Debian/Ubuntu): Boost 1.87+ removed asio::io_service and
  expires_from_now, which websocketpp 0.8.2 still used.
- Include <boost/filesystem/directory.hpp> explicitly in convert.cpp and
  dilexp.cpp; newer Boost no longer pulls directory_iterator in via
  operations.hpp.

Warning cleanup (build is warning-free again):
- t_array.h: C++20 forbids template-id destructors (~t_array<T> -> ~t_array).
- Fix malformed add_custom_command (stray empty WORKING_DIRECTORY, invalid
  DEPENDS in the TARGET form) flagged by CMP0175.
- Declare the 2 known shift/reduce conflicts in vmcpar.y with %expect and
  drop the vestigial -y (POSIX yacc) bison flag that rejects %expect.
- Cast [[nodiscard]] returns to void in BOOST_CHECK_THROW tests.

Bug fix:
- apf_affect.cpp: off-by-one in the weapon/spell tree-climbing loops for
  NPCs ('> GROUP_MAX' instead of '>= GROUP_MAX') wrote one element past the
  end of npc_data's skill arrays when an affect resolved to index exactly
  GROUP_MAX. Silent memory corruption for 20+ years; surfaced as SIGABRT at
  boot now that Ubuntu 26's libstdc++ bounds-checks std::array in debug
  builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7CqwMRW1CqvQiBLrYPKqD
CMake's Doxygen integration writes CMakeDoxyfile.in,
CMakeDoxygenDefaults.cmake and per-target Doxyfile.* into the source tree
on every configure; mplex writes its log to vme/. None of these belong in
version control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7CqwMRW1CqvQiBLrYPKqD
- utils.h: PC_SKI_LVL returned getSpellSkillAtIndex instead of
  getSkillLevelAtIndex, corrupting player skill levels with spell values.
  Fixes #418.
- npc_data.cpp: decreaseSpellSkillAtIndexBy used += instead of -=, so
  removing a spell affect from an NPC increased the skill instead of
  restoring it.

Found by auditing the whole PC_/NPC_ skill accessor family and sweeping
all increase/decrease/set accessors for swapped operators; these two were
the only mismatches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7CqwMRW1CqvQiBLrYPKqD
@Seifert69
Seifert69 merged commit abac8bd into master Aug 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant