From 5be28e77d07ad7618895ad43ca82c38d0a8898b4 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 29 Dec 2025 16:35:15 +0900 Subject: [PATCH] Fix revision pinning in release builds --- lib/ruby_wasm/cli.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ruby_wasm/cli.rb b/lib/ruby_wasm/cli.rb index c0b2b73a1..e399dc66a 100644 --- a/lib/ruby_wasm/cli.rb +++ b/lib/ruby_wasm/cli.rb @@ -309,22 +309,25 @@ def self.build_config_aliases(root) .uniq end + aliases_by_name = aliases.to_h { |config| [config[:name], config] } + # Pin the revisions based on build_manifest.json if available. build_manifest = File.join(root, "build_manifest.json") if File.exist?(build_manifest) begin manifest = JSON.parse(File.read(build_manifest)) manifest["ruby_revisions"].each do |name, rev| - source = aliases[name][:src] + source = aliases_by_name[name][:src] next unless source[:type] == "github" # @type var source: RubyWasm::Packager::build_source_github source[:rev] = rev end rescue StandardError => e RubyWasm.logger.warn "Failed to load build_manifest.json: #{e}" + raise e end end - aliases.to_h { |config| [config[:name], config] } + aliases_by_name end # Retrieves the root directory of the Ruby project.