Skip to content

Commit 9c6df52

Browse files
Fetch source via git instead of tarball
To embed build revision in binaries
1 parent 215e077 commit 9c6df52

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/ruby_wasm/build_system/product/ruby_source.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ def configure_file
2323
def fetch
2424
case @params[:type]
2525
when "github"
26-
tarball_url =
27-
"https://api.github.com/repos/#{@params[:repo]}/tarball/#{@params[:rev]}"
26+
repo_url = "https://github.com/#{@params[:repo]}.git"
2827
mkdir_p src_dir
29-
sh "curl -L #{tarball_url} | tar xz --strip-components=1",
30-
chdir: src_dir
28+
sh "git init", chdir: src_dir
29+
sh "git remote add origin #{repo_url}", chdir: src_dir
30+
sh "git fetch --depth 1 origin #{@params[:rev]}", chdir: src_dir
31+
sh "git checkout #{@params[:rev]}", chdir: src_dir
3132
else
3233
raise "unknown source type: #{@params[:type]}"
3334
end

0 commit comments

Comments
 (0)