Skip to content

Rewrite package for box2d v3+ - #3

Open
helmesjo wants to merge 6 commits into
masterfrom
rewrite-v3
Open

Rewrite package for box2d v3+#3
helmesjo wants to merge 6 commits into
masterfrom
rewrite-v3

Conversation

@helmesjo

@helmesjo helmesjo commented Jul 26, 2026

Copy link
Copy Markdown

CI: All pass.

Why rewrite the build2 packaging for Box2D 3.x

Box2D v3 was not an incremental release of the v2.4 C++ API. It is a new C17 library with a different layout (include/box2d/ + flat src/), different public headers, and a different build (compiled C objects, own export macros, SIMD/validate options).

The existing packaging targeted v2.4.x (C++, split collision/common/dynamics/rope trees, separate libbox2d-tests / libbox2d-testbed with doctest/imgui-style deps). That structure does not map cleanly onto v3.x.

A full replace on top of packaging master is appropriate so that:

  • the package matches upstream v3.x layout via submodule + symlinks.
  • tests stay in-tree, matching the new box3d package.

Version 3.1.1 is a major jump relative to 2.4.1, which matches the upstream break.
Since both Box2D and the new Box3D now share layout, I rewrote this package to match Box3D build2 package.

NOTE:
Keeping the unit suite and benchmarks under libbox2d/tests/ for now matches the box3d layout and keeps white-box tests next to src/. Box2d differs from box3d here: it has no built-in scheduler, so tests/benches need enkiTS, while box3d can use its in-tree one. That is a test-only dep, not part of the library API, and we can split packages later when we know upstreams intentions.

helmesjo added 2 commits July 26, 2026 22:51
Branch from packaging master. Drop the 2.4.1 C++ package layout and install the v3 C packaging tree from helmesjo/build2-box2d main. Source patches applied in follow-up commits.
@helmesjo

Copy link
Copy Markdown
Author

@Rookfighter Let me know if you have any objections against this. It's been a long time since the last update so if you don't have any opinion I'll just go ahead and complete it. :)

@helmesjo

helmesjo commented Jul 27, 2026

Copy link
Copy Markdown
Author

helmesjo added 2 commits July 28, 2026 17:12
Add libenkits as a package dependency and resolve it from
pkg.cppget.org testing. Link enkiTS into the unit suite, restore the
upstream main.c symlink, drop the omit-DeterminismTest patch, and
symlink test_determinism.c so the multithreaded determinism check is
included again.
Symlink main.c from the upstream benchmark app and wire it like the
unit suite via shared helpers, liba{box2d}, and libenkits for the
task scheduler. Mark the executable test=false because a default full
run exceeds a unit-test time budget. Ignore generated timing CSV and
DAT files in the repository root .gitignore and under tests/benchmark.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant