Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/ruby_wasm/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading