hegeltest: adopt the released 0.1.1 gem
Its platform gems bundle libhegel, retiring the staged engine under
tmp/, the HEGEL_LIBHEGEL_PATH override, and the rake libhegel:fetch
task. As a real installed gem it also loads outside bundler, which
the git checkout never did — bare rake aborted on requiring it.
Assisted-by: GLM-5.3 via pi
diff --git a/.ramekin/Dockerfile b/.ramekin/Dockerfile
index eb27630..05de8b4 100644
--- a/.ramekin/Dockerfile
+++ b/.ramekin/Dockerfile
@@ -41,11 +41,11 @@ RUN wget -q "https://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION%.*}/ruby-${RUBY
RUN gem install bundler -v 4.0.3
# Install project gems at build time so bundle/rake/puma are ready each session.
-# Build context is expected to be the project root. The lockfile is darwin-only,
-# so add the linux platforms before resolving or the native gems won't install.
+# Build context is expected to be the project root. The lockfile carries all
+# three platforms (arm64-darwin plus both linux ones), so the platform gems
+# with bundled natives — sqlite3, ffi, and hegeltest's libhegel engine —
+# install without compiling anything.
COPY Gemfile Gemfile.lock /tmp/bundle/
RUN cd /tmp/bundle \
- && bundle lock --add-platform aarch64-linux \
- && bundle lock --add-platform x86_64-linux \
&& bundle install --jobs 4 \
&& rm -rf /tmp/bundle
diff --git a/.ramekin/config.kdl b/.ramekin/config.kdl
index ea5bc94..5ee9ad5 100644
--- a/.ramekin/config.kdl
+++ b/.ramekin/config.kdl
@@ -3,11 +3,5 @@
env {
RANGER_DEFAULT_BACKLOG "pro-tacts"
- // hegeltest's native engine, staged by `rake libhegel:fetch`. Relative
- // because env values take no interpolation and the workspace mount point
- // is slugged per host path; it resolves against the agent's cwd, which is
- // the workspace root.
- HEGEL_LIBHEGEL_PATH "tmp/libhegel/0.32.5"
-
RUBYOPT "--enable-frozen-string-literal"
}
diff --git a/Gemfile b/Gemfile
index 2b3c8a7..4b7598a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,7 +12,7 @@ gem "sequel"
gem "sqlite3"
group :development do
- gem "hegeltest", git: "https://github.com/meganemura/hegel-ruby"
+ gem "hegeltest"
gem "irb"
gem "minitest"
gem "rack-test"
diff --git a/Gemfile.lock b/Gemfile.lock
index 471ebfa..9083d92 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,10 +1,3 @@
-GIT
- remote: https://github.com/meganemura/hegel-ruby
- revision: 06b4d9b460c5ba2e52385d13531616bf67250a0d
- specs:
- hegeltest (0.1.0)
- ffi (~> 1.17, >= 1.17.4)
-
GEM
remote: https://rubygems.org/
specs:
@@ -18,6 +11,12 @@ GEM
ffi (1.17.4-arm64-darwin)
ffi (1.17.4-x86_64-linux-gnu)
fileutils (1.8.0)
+ hegeltest (0.1.1-aarch64-linux)
+ ffi (~> 1.17, >= 1.17.4)
+ hegeltest (0.1.1-arm64-darwin)
+ ffi (~> 1.17, >= 1.17.4)
+ hegeltest (0.1.1-x86_64-linux)
+ ffi (~> 1.17, >= 1.17.4)
io-console (0.9.2)
irb (1.18.0)
pp (>= 0.6.0)
@@ -126,7 +125,7 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
- hegeltest!
+ hegeltest
irb
logger
minitest
@@ -154,7 +153,9 @@ CHECKSUMS
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
fileutils (1.8.0) sha256=8c6b1df54e2540bdb2f39258f08af78853aa70bad52b4d394bbc6424593c6e02
- hegeltest (0.1.0)
+ hegeltest (0.1.1-aarch64-linux) sha256=9a52c25200b09930cac91a2056005cbdb778962aa07049f5e1e9dd7b74e88891
+ hegeltest (0.1.1-arm64-darwin) sha256=885c9b16fb3aaee5f2c5c6ab3d2b2d990c536334f78f3c21ebd456defa4115e0
+ hegeltest (0.1.1-x86_64-linux) sha256=1d16acb3841db1f1fc06ff00ce3af045c7861c92f7641f9f22c765e2c23d74ab
io-console (0.9.2) sha256=efa74f891dd03c0939a931dfc6e74c2813d904763d456ea9762b0525e748db08
irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
diff --git a/tasks/libhegel.rake b/tasks/libhegel.rake
deleted file mode 100644
index 526e203..0000000
--- a/tasks/libhegel.rake
+++ /dev/null
@@ -1,65 +0,0 @@
-
-# Stages the native libhegel engine that the hegeltest gem drives — the
-# gem is pre-release and bundles no binary yet. Once it ships a real gem
-# with a bundled engine, delete this file and the tasks/ import line in
-# the Rakefile and this all goes away.
-#
-# The engine version comes from the gem (Hegel::LIBHEGEL_VERSION) because
-# the binding targets a specific engine ABI. The asset is downloaded with
-# gh (which handles the release-asset redirects), verified against its
-# published SHA-256, and installed under tmp/libhegel/<version>/ (see
-# .gitignore). HEGEL_LIBHEGEL_PATH in .envrc points at that directory, so
-# whichever platform's asset landed there resolves.
-
-require "digest"
-require "pathname"
-require "rbconfig"
-require "fileutils"
-require "tmpdir"
-require "hegel/libhegel_version"
-
-LIBHEGEL_VERSION = Hegel::LIBHEGEL_VERSION
-LIBHEGEL_ASSETS = {
- "arm64-darwin" => "libhegel-darwin-arm64.dylib",
- "aarch64-linux" => "libhegel-linux-arm64.so",
- "x86_64-linux" => "libhegel-linux-amd64.so",
-}.freeze
-
-# RbConfig's host_os carries version detail ("darwin25", "linux-gnu") that
-# the asset table does not key on.
-def libhegel_asset_name
- os = RbConfig::CONFIG.fetch("host_os")
- os = "darwin" if os.start_with?("darwin")
- os = "linux" if os.start_with?("linux")
- LIBHEGEL_ASSETS.fetch("#{RbConfig::CONFIG.fetch('host_cpu')}-#{os}")
-rescue KeyError
- raise "no published libhegel for #{RbConfig::CONFIG.fetch('host_cpu')}-#{RbConfig::CONFIG.fetch('host_os')}; build one and point HEGEL_LIBHEGEL_PATH at it"
-end
-
-LIBHEGEL_DIR = Pathname.new(__dir__).parent / "tmp" / "libhegel" / LIBHEGEL_VERSION
-LIBHEGEL_PATH = LIBHEGEL_DIR / libhegel_asset_name
-
-file LIBHEGEL_PATH do |task|
- asset = Pathname.new(task.name).basename.to_s
- Dir.mktmpdir do |dir|
- staging = Pathname.new(dir)
- sh "gh", "release", "download", "v#{LIBHEGEL_VERSION}",
- "--repo", "hegeldev/hegel-rust",
- "--pattern", asset, "--pattern", "#{asset}.sha256",
- "--dir", dir, verbose: false
-
- expected = File.read(staging / "#{asset}.sha256").split.first
- actual = Digest::SHA256.hexdigest(File.binread(staging / asset))
- raise "SHA-256 mismatch for #{asset}: expected #{expected}, got #{actual}" unless actual == expected
-
- FileUtils.mkdir_p(LIBHEGEL_DIR)
- FileUtils.mv(staging / asset, task.name)
- end
-end
-
-# Keep a bare `rake test` self-contained: the engine resolves through
-# HEGEL_LIBHEGEL_PATH when direnv has loaded .envrc, and through the
-# staged copy otherwise.
-ENV["HEGEL_LIBHEGEL_PATH"] = LIBHEGEL_DIR.to_s if ENV.fetch("HEGEL_LIBHEGEL_PATH", "").empty?
-
-task test: LIBHEGEL_PATH