Skip to content

Build native modules in CI, ship them in the zips, and add git version info - #31

Merged
bl1tmaps merged 1 commit into
mainfrom
feature/ci-modules
Nov 9, 2026
Merged

bl1tmaps merged 1 commit into
mainfrom
feature/ci-modules

Conversation

@bl1tmaps

@bl1tmaps bl1tmaps commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • CI builds the native modules. build.yml configures with -DMODULES=ON on Windows, macOS and Linux. The Linux runner also installs libgtk-3-dev, so the GTK module is built there.

  • Zips include module binaries. package.sh copies each built module next to its .mylo file, which is where import native loads it from:

    • modules/raylib/raylib_binding.{so,dll}
    • modules/pixel_window/pixel_window.{so,dll}
    • modules/gtk/gtk_bridge.so (Linux only)

    Raylib and pixel_window are required on every platform and GTK on Linux; a required binary that's missing fails packaging.

  • Package smoke test covers modules. A script that imports the packaged modules is run with the packaged mylo (no window opens).

  • GTK is optional at configure time. When GTK3 isn't found, the module is skipped with a message instead of pkg_check_modules(... REQUIRED) stopping CMake. The macOS and Windows runners don't have GTK.

  • my_game links ws2_32 on Windows, because the VM and debug adapter use Winsock.

Why

Before this, CI never built the modules, so the zips shipped only their sources. Running a Raylib app from a release meant building the module yourself. It also let breakages through: the raylib my_game link error fixed in 7c723f3 passed CI but failed local MODULES=ON builds.

Notes for review

  • Tested: a local macOS (arm64) MODULES=ON build. The package contained all three module binaries and the smoke test loaded raylib from it. Configuring without GTK skips the module cleanly.
  • Not tested before this PR: Windows and Linux. This is the first time my_game and the module DLLs are built on Windows. Module DLLs land in a Release/ subfolder there; package.sh finds them with find, so the location shouldn't matter.
  • Linux runtime dependency: with MODULES=ON, pixel_window is also linked statically into mylo, so the packaged Linux mylo now needs libX11 to run. This is existing CMake behaviour; it just takes effect in CI now.
  • Build time: raylib is now downloaded and compiled for both the IDE and the raylib module, so CI runs take a little longer.

Git version in the version string

  • mylo and Mylo IDE show the newest tag and commit, e.g. Mylo version 0.5.0 (0.4.0-22-g793005a): the hard-coded version plus git describe --tags --always --dirty. The tags are lightweight, so --tags is needed.
  • The version refreshes on every build. cmake/GitVersion.cmake regenerates build/generated/mylo_git_version.h each build, so the version follows new merges and tags without re-running CMake. It only rewrites the header when the text changes, so unchanged builds recompile nothing.
  • Builds without git (for example a source zip) show the plain version.
  • CI checks out with fetch-depth: 0, so tags are available to git describe. It no longer passes the short hash as MYLO_VERSION_SUFFIX, which would now duplicate it. The option is still there for extra text such as -beta.

Tested locally: a build with uncommitted changes showed 0.4.0-22-g793005a-dirty. After committing, a plain rebuild showed 0.4.0-23-g241f1b3 without reconfiguring.

🤖 Generated with Claude Code

CI configured without MODULES, so the raylib, pixel_window and GTK modules
were never built: the zips shipped module sources only, and breakages like
the raylib my_game link error went unnoticed.

- CI configures with -DMODULES=ON; Linux installs libgtk-3-dev.
- package.sh puts each built module binary next to its .mylo file, where
  'import native' loads it from, and fails if a required one is missing.
  The package smoke test now imports the packaged modules.
- The GTK module is skipped when GTK3 isn't found instead of failing
  configure, since the macOS and Windows runners don't have it.
- my_game links ws2_32 on Windows for the VM's Winsock use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bl1tmaps
bl1tmaps merged commit e4d2099 into main Nov 9, 2026
5 checks passed
@bl1tmaps bl1tmaps changed the title Build native modules in CI and ship them in the release zips Build native modules in CI, ship them in the zips, and add git version info Nov 9, 2026
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