Skip to content

Commit 6a05e2e

Browse files
Merge pull request #618 from ruby/katei/fix-release
Fix revision pinning in release builds
2 parents 9da490d + 5be28e7 commit 6a05e2e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/ruby_wasm/cli.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,25 @@ def self.build_config_aliases(root)
309309
.uniq
310310
end
311311

312+
aliases_by_name = aliases.to_h { |config| [config[:name], config] }
313+
312314
# Pin the revisions based on build_manifest.json if available.
313315
build_manifest = File.join(root, "build_manifest.json")
314316
if File.exist?(build_manifest)
315317
begin
316318
manifest = JSON.parse(File.read(build_manifest))
317319
manifest["ruby_revisions"].each do |name, rev|
318-
source = aliases[name][:src]
320+
source = aliases_by_name[name][:src]
319321
next unless source[:type] == "github"
320322
# @type var source: RubyWasm::Packager::build_source_github
321323
source[:rev] = rev
322324
end
323325
rescue StandardError => e
324326
RubyWasm.logger.warn "Failed to load build_manifest.json: #{e}"
327+
raise e
325328
end
326329
end
327-
aliases.to_h { |config| [config[:name], config] }
330+
aliases_by_name
328331
end
329332

330333
# Retrieves the root directory of the Ruby project.

0 commit comments

Comments
 (0)