Skip to content

Commit

Permalink
silence linking log messages by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Sep 6, 2024
1 parent 56b00f1 commit 763d5e9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ruby_wasm/packager/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ def _link_gem_exts(executor, build, ruby_root, gem_home, module_bytes)

linker.library("ruby", module_bytes, false)

RubyWasm.logger.info "Linking Ruby with extensions"

libraries.each do |lib|
# Non-DL openable libraries should be referenced as base name
lib_name = File.basename(lib)
module_bytes = File.binread(lib)
RubyWasm.logger.info "Linking #{lib_name} (#{module_bytes.size} bytes)"
RubyWasm.logger.debug "Linking #{lib_name} (#{module_bytes.size} bytes)"
linker.library(lib_name, module_bytes, false)
end

Expand All @@ -160,7 +162,7 @@ def _link_gem_exts(executor, build, ruby_root, gem_home, module_bytes)
# DL openable lib_name should be a relative path from ruby_root
lib_name = "/" + Pathname.new(lib).relative_path_from(Pathname.new(File.dirname(root))).to_s
module_bytes = File.binread(lib)
RubyWasm.logger.info "Linking #{lib_name} (#{module_bytes.size} bytes)"
RubyWasm.logger.debug "Linking #{lib_name} (#{module_bytes.size} bytes)"
linker.library(lib_name, module_bytes, true)
end
end
Expand All @@ -170,7 +172,7 @@ def _link_gem_exts(executor, build, ruby_root, gem_home, module_bytes)
# e.g. wasi_snapshot_preview1.command.wasm -> wasi_snapshot_preview1
adapter_name = adapter_name.split(".")[0]
module_bytes = File.binread(adapter)
RubyWasm.logger.info "Linking adapter #{adapter_name}=#{adapter} (#{module_bytes.size} bytes)"
RubyWasm.logger.debug "Linking adapter #{adapter_name}=#{adapter} (#{module_bytes.size} bytes)"
linker.adapter(adapter_name, module_bytes)
end
return linker.encode()
Expand Down

0 comments on commit 763d5e9

Please sign in to comment.