Skip to content

Commit

Permalink
build: Fix clean checkout with pretty build log mode
Browse files Browse the repository at this point in the history
`BuildExecutor#system` should not return anything, but it raises an
exception when the command fails. So, we should not use handle command
failure in caller side.
  • Loading branch information
kateinoigakukun committed Nov 27, 2023
1 parent 2371b7f commit 9b6d49c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/ruby_wasm/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def system(*args, chdir: nil, env: nil)
printer.done
end
end
return
rescue => e
$stdout.flush
$stderr.puts "Try running with `rake --verbose` for more complete output."
Expand Down
10 changes: 4 additions & 6 deletions lib/ruby_wasm/build/product/ruby_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ def fetch(executor)
"origin",
"#{@params[:rev]}:origin/#{@params[:rev]}",
chdir: src_dir
) or raise "failed to clone #{repo_url}"
)
executor.system(
"git",
"checkout",
"origin/#{@params[:rev]}",
chdir: src_dir
) or raise "failed to checkout #{@params[:rev]}"
)
when "local"
executor.mkdir_p File.dirname(src_dir)
executor.cp_r @params[:src], src_dir
Expand All @@ -80,10 +80,8 @@ def build(executor)
"gnu",
"config.guess",
"config.sub",
chdir: src_dir or
raise "failed to download config.guess and config.sub"
executor.system "./autogen.sh", chdir: src_dir or
raise "failed to run autogen.sh"
chdir: src_dir
executor.system "./autogen.sh", chdir: src_dir
end
end
end
Expand Down

0 comments on commit 9b6d49c

Please sign in to comment.