Skip to content

Commit 4864614

Browse files
Remove wasi-vfs CLI downloading code
1 parent 8d1a4c7 commit 4864614

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

lib/ruby_wasm/build/product/wasi_vfs.rb

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ class WasiVfsProduct < BuildProduct
77
def initialize(build_dir)
88
@build_dir = build_dir
99
@need_fetch_lib = ENV["LIB_WASI_VFS_A"].nil?
10-
installed_cli_path =
11-
ENV["WASI_VFS_CLI"] || Toolchain.find_path("wasi-vfs")
12-
@need_fetch_cli = installed_cli_path.nil?
13-
@cli_path =
14-
installed_cli_path || File.join(cli_product_build_dir, "wasi-vfs")
1510
end
1611

1712
def lib_product_build_dir
@@ -26,18 +21,6 @@ def lib_wasi_vfs_a
2621
ENV["LIB_WASI_VFS_A"] || File.join(lib_product_build_dir, "libwasi_vfs.a")
2722
end
2823

29-
def cli_product_build_dir
30-
File.join(
31-
@build_dir,
32-
RbConfig::CONFIG["host"],
33-
"wasi-vfs-#{WASI_VFS_VERSION}"
34-
)
35-
end
36-
37-
def cli_bin_path
38-
@cli_path
39-
end
40-
4124
def name
4225
"wasi-vfs-#{WASI_VFS_VERSION}-#{RbConfig::CONFIG["host"]}"
4326
end
@@ -58,26 +41,5 @@ def build(executor)
5841
executor.mv File.join(tmpdir, "libwasi_vfs.a"), lib_wasi_vfs_a
5942
end
6043
end
61-
62-
def install_cli
63-
return if !@need_fetch_cli || File.exist?(cli_bin_path)
64-
FileUtils.mkdir_p cli_product_build_dir
65-
zipfile = File.join(cli_product_build_dir, "wasi-vfs-cli.zip")
66-
system "curl", "-L", "-o", zipfile, self.cli_download_url
67-
system "unzip", zipfile, "-d", cli_product_build_dir
68-
end
69-
70-
def cli_download_url
71-
assets = [
72-
[/x86_64-linux/, "wasi-vfs-cli-x86_64-unknown-linux-gnu.zip"],
73-
[/x86_64-darwin/, "wasi-vfs-cli-x86_64-apple-darwin.zip"],
74-
[/arm64e?-darwin/, "wasi-vfs-cli-aarch64-apple-darwin.zip"]
75-
]
76-
asset = assets.find { |os, _| os =~ RUBY_PLATFORM }&.at(1)
77-
if asset.nil?
78-
raise "unsupported platform for fetching wasi-vfs CLI: #{RUBY_PLATFORM}"
79-
end
80-
"https://github.com/kateinoigakukun/wasi-vfs/releases/download/v#{WASI_VFS_VERSION}/#{asset}"
81-
end
8244
end
8345
end

rakelib/packaging.rake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ namespace :npm do
9393

9494
desc "Make tarball for npm package #{pkg[:name]}"
9595
task pkg[:name] do
96-
wasi_vfs.install_cli
9796
wasi_sdk.install_binaryen
9897
Rake::Task["npm:#{pkg[:name]}:build"].invoke
9998
sh "npm pack", chdir: pkg_dir
@@ -137,7 +136,6 @@ namespace :standalone do
137136

138137
desc "Build standalone package #{pkg[:name]}"
139138
task "#{pkg[:name]}" => ["build:#{pkg[:build]}"] do
140-
wasi_vfs.install_cli
141139
wasi_sdk.install_binaryen
142140
base_dir = Dir.pwd
143141
sh tools,

0 commit comments

Comments
 (0)