Repository navigation
Build native modules in CI, ship them in the zips, and add git version info - #31
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
CI builds the native modules.
build.ymlconfigures with-DMODULES=ONon Windows, macOS and Linux. The Linux runner also installslibgtk-3-dev, so the GTK module is built there.Zips include module binaries.
package.shcopies each built module next to its.mylofile, which is whereimport nativeloads 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_gamelinksws2_32on 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_gamelink error fixed in 7c723f3 passed CI but failed localMODULES=ONbuilds.Notes for review
MODULES=ONbuild. The package contained all three module binaries and the smoke test loaded raylib from it. Configuring without GTK skips the module cleanly.my_gameand the module DLLs are built on Windows. Module DLLs land in aRelease/subfolder there;package.shfinds them withfind, so the location shouldn't matter.MODULES=ON,pixel_windowis also linked statically intomylo, so the packaged Linuxmylonow needs libX11 to run. This is existing CMake behaviour; it just takes effect in CI now.Git version in the version string
myloand Mylo IDE show the newest tag and commit, e.g.Mylo version 0.5.0 (0.4.0-22-g793005a): the hard-coded version plusgit describe --tags --always --dirty. The tags are lightweight, so--tagsis needed.cmake/GitVersion.cmakeregeneratesbuild/generated/mylo_git_version.heach 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.fetch-depth: 0, so tags are available togit describe. It no longer passes the short hash asMYLO_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 showed0.4.0-23-g241f1b3without reconfiguring.🤖 Generated with Claude Code