Skip to content

Commit 45ebafc

Browse files
build: Bring local source as symlink instead of copying it
1 parent b1e0d20 commit 45ebafc

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), "lib")
77
require "bundler/gem_tasks"
88
require "ruby_wasm/rake_task"
99
require "ruby_wasm/packager"
10+
require "ruby_wasm/cli"
1011

1112
BUILD_SOURCES = %w[3.3 3.2 head]
1213
BUILD_PROFILES = %w[full minimal]

lib/ruby_wasm/build/executor.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def mkdir_p(list)
128128
FileUtils.mkdir_p(list)
129129
end
130130

131+
def ln_s(src, dest)
132+
FileUtils.ln_s(src, dest)
133+
end
134+
131135
def write(path, data)
132136
File.write(path, data)
133137
end

lib/ruby_wasm/build/product/ruby_source.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def fetch(executor)
7575
)
7676
when "local"
7777
executor.mkdir_p File.dirname(src_dir)
78-
executor.cp_r @params[:path], src_dir
78+
executor.ln_s File.expand_path(@params[:path]), src_dir
7979
else
8080
raise "unknown source type: #{@params[:type]}"
8181
end

rakelib/ci.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def latest_build_sources
22
BUILD_SOURCES
33
.filter_map do |name|
4-
src = RubyWasm::Packager.build_source_aliases(LIB_ROOT)[name]
4+
src = RubyWasm::CLI.build_source_aliases(LIB_ROOT)[name]
55
case src[:type]
66
when "github"
77
url = "repos/#{src[:repo]}/commits/#{src[:rev]}"
@@ -23,7 +23,7 @@ def release_note
2323
EOS
2424

2525
BUILD_SOURCES.each do |name|
26-
source = RubyWasm::Packager.build_source_aliases(LIB_ROOT)[name]
26+
source = RubyWasm::CLI.build_source_aliases(LIB_ROOT)[name]
2727
case source[:type]
2828
when "github"
2929
output +=

sig/ruby_wasm/build.rbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ module RubyWasm
274274
def cp_r: (FileUtils::pathlist src, path dest) -> void
275275
def mv: (FileUtils::pathlist src, path dest) -> void
276276
def mkdir_p: (FileUtils::pathlist list) -> void
277+
def ln_s: (String src, String dest) -> void
277278
def write: (String path, _ToS data) -> void
278279

279280
def begin_section: (Class klass, String name, String note) -> void

0 commit comments

Comments
 (0)