Skip to content

Commit 5d617bd

Browse files
harukasanclaude
andcommitted
Match the build workflow's Ruby setup in release.yml
The previous attempt kept bundler-cache: true in release.yml and relied on Bundler.with_unbundled_env to unbundle the child rake. That also reverted GEM_PATH to its pre-Bundler value, so freetype (only installed in vendor/bundle) disappeared from the PicoRuby sub-build's load path and ttf2c.rb failed with "cannot load such file -- freetype". Follow the working build.yml pattern instead: drop bundler-cache and install rake / freetype into the system gem path with `gem install`. The child rake then finds both via the default Gem.path with no bundler env to inherit in the first place. Make `require "bundler/setup"` optional in the Rakefile and guard sh_unbundled with `defined?(Bundler)` so the same Rakefile works for local `bundle exec rake` and for CI's gem-install setup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e935352 commit 5d617bd

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
uses: ruby/setup-ruby@v1
3131
with:
3232
ruby-version: '4.0.1'
33-
bundler-cache: true
33+
34+
- name: Install Ruby gems
35+
run: gem install rake freetype
3436

3537
- name: Build combined UF2 (firmware + dictionary)
3638
run: rake

Rakefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
require "bundler/setup"
1+
# Bundler is convenient for local development (ensures the Gemfile gems
2+
# are on the load path) but not required — CI may install gems globally
3+
# via `gem install`. Treat its absence as a no-op so the Rakefile works
4+
# either way.
5+
begin
6+
require "bundler/setup"
7+
rescue LoadError
8+
end
29

310
PROJECT_DIR = __dir__
411
BUILD_DIR = File.join(PROJECT_DIR, "build")
@@ -18,7 +25,11 @@ end
1825
# setup and must not inherit BUNDLE_GEMFILE / RUBYOPT from this rake,
1926
# or they try to load this project's Gemfile and fail.
2027
def sh_unbundled(*cmd, **opts)
21-
Bundler.with_unbundled_env { sh(*cmd, **opts) }
28+
if defined?(Bundler)
29+
Bundler.with_unbundled_env { sh(*cmd, **opts) }
30+
else
31+
sh(*cmd, **opts)
32+
end
2233
end
2334

2435
desc "Configure, build and produce combined UF2 (default)"

0 commit comments

Comments
 (0)