-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathbuild.rbs
331 lines (277 loc) · 9.87 KB
/
build.rbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
module RubyWasm
VERSION: String
interface _Cacheable
def cache_key: (Digest::SHA256 digest) -> void
end
class Target
include _Cacheable
@triple: String
@pic: bool
attr_reader triple: String
def initialize: (String triple, ?pic: bool) -> void
def pic?: -> bool
end
class Build
include _Cacheable
@target: Target
@build_dir: String
@rubies_dir: String
@toolchain: Toolchain
@libyaml: LibYAMLProduct
@zlib: ZlibProduct
@openssl: OpenSSLProduct
@wasi_vfs: WasiVfsProduct?
@baseruby: BaseRubyProduct
@crossruby: CrossRubyProduct
@source: BuildSource
attr_reader toolchain: Toolchain
attr_reader baseruby: BaseRubyProduct
def initialize: (
string name,
target: Target,
src: Packager::build_source,
toolchain: Toolchain?,
build_dir: string,
rubies_dir: string,
?wasi_vfs: :default | WasiVfsProduct?,
**untyped
) -> void
def crossruby: () -> CrossRubyProduct
end
class BuildParams
attr_accessor name: String
attr_accessor target: Target
attr_accessor default_exts: String
def initialize: (name: string, target: Target, default_exts: string) -> void
end
class BuildProduct
def name: -> String
end
class AutoconfProduct < BuildProduct
@target: Target
@toolchain: Toolchain
def initialize: (Target target, Toolchain toolchain) -> void
def system_triplet_args: -> Array[String]
| -> Array[String]
def tools_args: -> Array[String]
| -> Array[String]
def configure_args: -> Array[String]
| -> Array[String]
end
class BuildSource < BuildProduct
@params: Hash[untyped, untyped]
@build_dir: String
def initialize: (untyped params, String build_dir) -> void
def name: -> String
def cache_key: (Digest::SHA256 digest) -> void
def src_dir: -> String
def configure_file: -> String
def fetch: (BuildExecutor executor) -> void
def build: (BuildExecutor executor) -> void
end
class BaseRubyProduct < BuildProduct
@build_dir: String
@source: BuildSource
@channel: String
def initialize: (String build_dir, BuildSource source) -> void
def product_build_dir: -> String
def install_dir: -> String
def name: -> String
def build: (BuildExecutor executor) -> void
end
class ZlibProduct < AutoconfProduct
ZLIB_VERSION: String
@build_dir: String
attr_reader target: Target
def initialize: (String build_dir, Target target, Toolchain toolchain) -> void
def product_build_dir: -> String
def destdir: -> String
def install_root: -> String
def name: -> String
def configure_args: -> Array[String]
def build: (BuildExecutor executor) -> void
end
class LibYAMLProduct < AutoconfProduct
LIBYAML_VERSION: String
@build_dir: String
attr_reader target: Target
def initialize: (String build_dir, Target target, Toolchain toolchain) -> void
def product_build_dir: -> String
def destdir: -> String
def install_root: -> String
def name: -> String
def build: (BuildExecutor executor) -> void
end
class OpenSSLProduct < AutoconfProduct
OPENSSL_VERSION: String
@build_dir: String
attr_reader target: Target
def initialize: (String build_dir, Target target, Toolchain toolchain) -> void
def product_build_dir: -> String
def destdir: -> String
def install_root: -> String
def name: -> String
def configure_args: -> Array[String]
def build: (BuildExecutor executor) -> void
end
class WasiVfsProduct < BuildProduct
WASI_VFS_VERSION: String
@build_dir: String
@need_fetch_lib: bool
@cli_path: String
@need_fetch_cli: bool
def initialize: (String build_dir) -> void
def lib_product_build_dir: -> String
def lib_wasi_vfs_a: -> String
def name: -> String
def build: (BuildExecutor executor) -> void
end
class CrossRubyExtProduct < BuildProduct
include RubyWasm::_Cacheable
@toolchain: Toolchain
@srcdir: String
@ext_relative_path: String
@features: RubyWasm::FeatureSet
attr_reader name: String
def initialize: (String srcdir, Toolchain toolchain, features: RubyWasm::FeatureSet, ?ext_relative_path: String?) -> void
def product_build_dir: (CrossRubyProduct crossruby) -> String
def linklist: (CrossRubyProduct crossruby) -> String
def metadata_json: (CrossRubyProduct crossruby) -> String
def feature_name: (CrossRubyProduct crossruby) -> String
def make_args: (CrossRubyProduct crossruby) -> Array[String]
def build: (BuildExecutor executor, CrossRubyProduct crossruby, Array[String] extra_mkargs) -> void
def do_extconf: (BuildExecutor executor, CrossRubyProduct crossruby) -> void
def do_install_rb: (BuildExecutor executor, CrossRubyProduct crossruby) -> void
private def do_legacy_extconf: (BuildExecutor executor, CrossRubyProduct crossruby) -> void
end
class CrossRubyProduct < AutoconfProduct
include RubyWasm::_Cacheable
@params: BuildParams
@rubies_dir: String
@build_dir: String
@baseruby: BaseRubyProduct
@libyaml: LibYAMLProduct
@zlib: ZlibProduct
@openssl: OpenSSLProduct
@wasi_vfs: WasiVfsProduct
attr_reader target: Target
attr_reader source: BuildSource
attr_reader toolchain: Toolchain
attr_accessor user_exts: Array[CrossRubyExtProduct]
attr_accessor wasmoptflags: Array[String]
attr_accessor cppflags: Array[String]
attr_accessor cflags: Array[String]
attr_accessor ldflags: Array[String]
attr_accessor debugflags: Array[String]
attr_accessor xcflags: Array[String]
attr_accessor xldflags: Array[String]
def initialize: (BuildParams params, String build_dir, String rubies_dir, BaseRubyProduct baseruby, BuildSource source, Toolchain toolchain) -> void
def configure: (BuildExecutor executor, ?reconfigure: bool) -> void
def need_exts_build?: -> bool
def need_extinit_obj?: -> bool
def build_exts: (BuildExecutor executor) -> void
def build: (BuildExecutor executor, ?remake: bool, ?reconfigure: bool) -> void
def clean: (BuildExecutor executor) -> void
def name: -> String
def build_dir: -> String
def ext_build_dir: -> String
def with_libyaml: (LibYAMLProduct libyaml) -> LibYAMLProduct
def with_zlib: (ZlibProduct zlib) -> ZlibProduct
def with_wasi_vfs: (WasiVfsProduct? wasi_vfs) -> WasiVfsProduct?
def with_openssl: (OpenSSLProduct openssl) -> OpenSSLProduct
def dest_dir: -> String
def artifact: -> String
def extinit_obj: -> String
def extinit_c_erb: -> String
def baseruby_path: -> String
def configure_args: (String build_triple, Toolchain toolchain) -> Array[String]
def rbconfig_rb: -> String?
end
class WitBindgen
@build_dir: String
@tool_dir: String
@revision: String
attr_reader bin_path: String
def initialize: (build_dir: String, ?revision: String) -> void
def install: -> void
end
class Toolchain
@tools: Hash[untyped, untyped]
@tools_cache: Hash[untyped, untyped]
attr_reader name: String
def initialize: -> void
def find_tool: (Symbol name) -> String
def check_envvar: (untyped name) -> void
def self.get: (Target target, ?String? build_dir) -> (Toolchain)
def self.find_path: (String command) -> String?
def self.check_executable: (String command) -> String
def cc: -> String
def cxx: -> String
def ranlib: -> String
def ld: -> String
def ar: -> String
def install: -> void
end
class WASISDK < Toolchain
@wasm_opt_path: String
@need_fetch_wasi_sdk: bool
@need_fetch_binaryen: bool
@tools: Hash[Symbol, String]
@wasi_sdk_path: String
@binaryen_version: Integer
@version_major: Integer
@version_minor: Integer
@binaryen_path: String
def initialize: (?String? wasi_sdk_path, ?build_dir: String?, ?version_major: Integer, ?version_minor: Integer, ?binaryen_version: Integer) -> void
def find_tool: (Symbol name) -> String
def wasm_opt: -> String
def wasi_sdk_path: -> String
def download_url: (Integer? version_major, Integer? version_minor) -> String
def binaryen_download_url: (Integer? version) -> String
def install_wasi_sdk: -> void
def install_binaryen: -> void
end
class Emscripten < Toolchain
@tools: Hash[Symbol, String]
def initialize: -> void
def find_tool: (Symbol name) -> String
end
class BuildExecutor
@verbose: bool
@github_actions_markup: bool
@process_count: Integer
@start_times: Hash[[Class, String], Time]
attr_reader process_count: Integer
def initialize: (?verbose: bool) -> void
def system: (*_ToS args, ?chdir: String?, ?env: Hash[String, String]?) -> void
def rm_rf: (FileUtils::pathlist list) -> void
def rm_f: (FileUtils::pathlist list) -> void
def cp_r: (FileUtils::pathlist src, path dest) -> void
def mv: (FileUtils::pathlist src, path dest) -> void
def mkdir_p: (FileUtils::pathlist list) -> void
def ln_s: (String src, String dest) -> void
def write: (String path, _ToS data) -> void
def begin_section: (Class klass, String name, String note) -> void
def end_section: (Class klass, String name) -> void
private def _print_command: (Array[_ToS] command, Hash[String, String]? env) -> void
end
class StatusPrinter
@mutex: Mutex
@counter: Integer
@indicators: String
def initialize: () -> void
def stdout: (String message) -> void
def stderr: (String message) -> void
def done: () -> void
end
class Downloader
def format_size: (Integer size) -> String
def download: (String url, String dest, String message) -> void
end
class BuildTask
@build: Build
attr_accessor name: String
def initialize: (String name, target: String, src: untyped, ?toolchain: Toolchain?, ?build_dir: String?, ?rubies_dir: String?, **untyped) -> void
def hexdigest: -> String
end
end