Debian Codegraph @

mesonbuild/compilers/rust.py

raw
1 # SPDX-License-Identifier: Apache-2.0
2 # Copyright 2012-2022 The Meson development team
3 # Copyright © 2023-2025 Intel Corporation
4
5 from __future__ import annotations
6
7 import argparse
8 import functools
9 import os.path
10 import textwrap
11 import re
12 import typing as T
13
14 from .. import options
15 from ..dependencies import InternalDependency
16 from ..mesonlib import EnvironmentException, MesonException, Popen_safe, Popen_safe_logged, version_compare
17 from ..linkers.linkers import VisualStudioLikeLinkerMixin
18 from ..options import OptionKey
19 from .compilers import Compiler, CompileCheckMode, clike_debug_args, is_library
20
21 if T.TYPE_CHECKING:
22 from .. import build
23 from ..options import MutableKeyedOptionDictType
24 from ..environment import Environment # noqa: F401
25 from ..linkers.linkers import DynamicLinker
26 from ..mesonlib import MachineChoice
27 from ..dependencies import Dependency
28 from ..build import BuildTarget
29
30 from typing_extensions import Protocol
31
32 class TargetParse(Protocol):
33 target: T.Optional[str]
34
35
36 rust_optimization_args: T.Dict[str, T.List[str]] = {
37 'plain': [],
38 '0': [],
39 'g': ['-C', 'opt-level=0'],
40 '1': ['-C', 'opt-level=1'],
41 '2': ['-C', 'opt-level=2'],
42 '3': ['-C', 'opt-level=3'],
43 's': ['-C', 'opt-level=s'],
44 }
45
46
47 class _TargetParser:
48
49 """Helper for bindgen to look for --target in various command line arguments.
50
51 Storing this as a helper class avoids the need to set up the ArgumentParser
52 multiple times, and simplifies it's use as well as the typing.
53 """
54
55 def __init__(self) -> None:
56 parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
57 parser.add_argument('--target', action='store', default=None)
58 self._parser = parser
59
60 def parse(self, args: T.List[str]) -> T.Optional[str]:
61 """Parse arguments looking for --target
62
63 :param args: A list of arguments to search
64 :return: the argument to --target if it exists, otherwise None
65 """
66 parsed = T.cast('TargetParse', self._parser.parse_known_args(args)[0])
67 return parsed.target
68
69
70 parse_target = _TargetParser().parse
71
72 def get_rustup_run_and_args(exelist: T.List[str]) -> T.Optional[T.Tuple[T.List[str], T.List[str]]]:
73 """Given the command for a rustc executable, check if it is invoked via
74 "rustup run" and if so separate the "rustup [OPTIONS] run TOOLCHAIN"
75 part from the arguments to rustc. If the returned value is not None,
76 other tools (for example clippy-driver or rustdoc) can be run by placing
77 the name of the tool between the two elements of the tuple."""
78 e = iter(exelist)
79 try:
80 if os.path.basename(next(e)) != 'rustup':
81 return None
82 # minimum three strings: "rustup run TOOLCHAIN"
83 n = 3
84 opt = next(e)
85
86 # options come first
87 while opt.startswith('-'):
88 n += 1
89 opt = next(e)
90
91 # then "run TOOLCHAIN"
92 if opt != 'run':
93 return None
94
95 next(e)
96 next(e)
97 return exelist[:n], list(e)
98 except StopIteration:
99 return None
100
101 def rustc_link_args(args: T.List[str]) -> T.List[str]:
102 if not args:
103 return args
104 rustc_args: T.List[str] = []
105 for arg in args:
106 rustc_args.append('-C')
107 rustc_args.append(f'link-arg={arg}')
108 return rustc_args
109
110
111 class RustSystemDependency(InternalDependency):
112 pass
113
114
115 class RustCompiler(Compiler):
116
117 # rustc doesn't invoke the compiler itself, it doesn't need a LINKER_OPTION_STYLE
118 language = 'rust'
119 id = 'rustc'
120
121 USED_FOR_SEPARATE_LINKING_STEP = False
122
123 _WARNING_LEVELS: T.Dict[str, T.List[str]] = {
124 '0': ['--cap-lints', 'allow'],
125 '1': [],
126 '2': [],
127 '3': ['-W', 'warnings'],
128 'everything': ['-W', 'warnings'],
129 }
130
131 allow_nightly: bool
132
133 # libcore can be compiled with either static or dynamic CRT, so disable
134 # both of them just in case.
135 MSVCRT_ARGS: T.Mapping[str, T.List[str]] = {
136 'none': [],
137 'md': ['-Clink-arg=/nodefaultlib:libcmt', '-Clink-arg=/defaultlib:msvcrt'],
138 'mdd': ['-Clink-arg=/nodefaultlib:libcmt', '-Clink-arg=/nodefaultlib:msvcrt', '-Clink-arg=/defaultlib:msvcrtd'],
139 'mt': ['-Clink-arg=/defaultlib:libcmt', '-Clink-arg=/nodefaultlib:msvcrt'],
140 'mtd': ['-Clink-arg=/nodefaultlib:libcmt', '-Clink-arg=/nodefaultlib:msvcrt', '-Clink-arg=/defaultlib:libcmtd'],
141 }
142
143 def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
144 env: Environment, full_version: T.Optional[str] = None,
145 linker: T.Optional['DynamicLinker'] = None):
146 super().__init__([], exelist, version, for_machine, env,
147 full_version=full_version, linker=linker)
148 self.rustup_run_and_args: T.Optional[T.Tuple[T.List[str], T.List[str]]] = get_rustup_run_and_args(exelist)
149 self.base_options.update({OptionKey(o) for o in ['b_colorout', 'b_coverage', 'b_ndebug', 'b_pgo']})
150 if isinstance(self.linker, VisualStudioLikeLinkerMixin):
151 self.base_options.add(OptionKey('b_vscrt'))
152 self.native_static_libs: T.List[str] = []
153 self.is_beta = '-beta' in full_version
154 self.is_nightly = '-nightly' in full_version
155 self.has_check_cfg = version_compare(version, '>=1.80.0')
156
157 def init_from_options(self) -> None:
158 nightly_opt = self.get_compileropt_value('nightly', None)
159 if nightly_opt == 'enabled' and not self.is_nightly:
160 raise EnvironmentException(f'Rust compiler {self.name_string()} is not a nightly compiler as required by the "nightly" option.')
161 self.allow_nightly = nightly_opt != 'disabled' and self.is_nightly
162
163 def needs_static_linker(self) -> bool:
164 return False
165
166 def _sanity_check_compile_args(self, sourcename: str, binname: str
167 ) -> T.Tuple[T.List[str], T.List[str]]:
168 cmdlist, largs = super()._sanity_check_compile_args(sourcename, binname)
169 if self.info.kernel == 'none' and 'ld.' in self.get_linker_id():
170 largs.extend(rustc_link_args(['-nostartfiles']))
171 return cmdlist, largs
172
173 def _sanity_check_source_code(self) -> str:
174 if self.info.kernel != 'none':
175 return textwrap.dedent(
176 '''fn main() {
177 }
178 ''')
179 return textwrap.dedent(
180 '''#![no_std]
181 #![no_main]
182 #[no_mangle]
183 pub fn _start() {
184 }
185 #[panic_handler]
186 fn panic(_info: &core::panic::PanicInfo) -> ! {
187 loop {}
188 }
189 ''')
190
191 def sanity_check(self, work_dir: str) -> None:
192 super().sanity_check(work_dir)
193 source_name = self._sanity_check_filenames()[0]
194 self._native_static_libs(work_dir, source_name)
195
196 def _native_static_libs(self, work_dir: str, source_name: str) -> None:
197 # Get libraries needed to link with a Rust staticlib
198 if self.native_static_libs:
199 return
200
201 cmdlist = self.exelist + ['--crate-type', 'staticlib', '--print', 'native-static-libs', source_name]
202 p, stdo, stde = Popen_safe_logged(cmdlist, cwd=work_dir)
203 if p.returncode != 0:
204 raise EnvironmentException('Rust compiler cannot compile staticlib.')
205 match = re.search('native-static-libs: (.*)$', stde, re.MULTILINE)
206 if not match:
207 if self.info.kernel == 'none':
208 # no match and kernel == none (i.e. baremetal) is a valid use case.
209 # return and let native_static_libs list empty
210 return
211 if self.info.system == 'emscripten':
212 # no match and emscripten is valid after rustc 1.84
213 return
214 raise EnvironmentException('Failed to find native-static-libs in Rust compiler output.')
215 # Exclude some well known libraries that we don't need because they
216 # are always part of C/C++ linkers. Rustc probably should not print
217 # them, pkg-config for example never specify them.
218 # FIXME: https://github.com/rust-lang/rust/issues/55120
219 exclude = {'-lc', '-lgcc_s', '-lkernel32', '-ladvapi32', '/defaultlib:msvcrt'}
220 self.native_static_libs = [i for i in match.group(1).split() if i not in exclude]
221
222 def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]:
223 return ['--emit', f'dep-info={outfile}']
224
225 def get_output_args(self, outputname: str) -> T.List[str]:
226 return ['--emit', f'link={outputname}']
227
228 @functools.lru_cache(maxsize=None)
229 def get_sysroot(self) -> str:
230 cmd = self.get_exelist(ccache=False) + ['--print', 'sysroot']
231 p, stdo, stde = Popen_safe_logged(cmd)
232 return stdo.split('\n', maxsplit=1)[0]
233
234 @functools.lru_cache(maxsize=None)
235 def get_target_libdir(self) -> str:
236 cmd = self.get_exelist(ccache=False) + ['--print', 'target-libdir']
237 p, stdo, stde = Popen_safe_logged(cmd)
238 return stdo.split('\n', maxsplit=1)[0]
239
240 @functools.lru_cache(maxsize=None)
241 def get_cfgs(self) -> T.List[str]:
242 cmd = self.get_exelist(ccache=False) + ['--print', 'cfg']
243 p, stdo, stde = Popen_safe_logged(cmd)
244 return stdo.splitlines()
245
246 @functools.lru_cache(maxsize=None)
247 def get_target_triple(self) -> str:
248 # First check if --target is explicitly set in the compiler command
249 target = parse_target(self.get_exe_args())
250 if target:
251 return target
252 # Fall back to parsing the host triple from `rustc -vV`
253 cmd = self.get_exelist(ccache=False) + ['-vV']
254 p, stdo, stde = Popen_safe(cmd)
255 for line in stdo.splitlines():
256 if line.startswith('host:'):
257 return line.split(':', 1)[1].strip()
258 raise EnvironmentException('Could not determine Rust target triple')
259
260 @functools.lru_cache(maxsize=None)
261 def get_crt_static(self) -> bool:
262 return 'target_feature="crt-static"' in self.get_cfgs()
263
264 def get_nightly(self, target: T.Optional[BuildTarget]) -> bool:
265 if not target:
266 return self.allow_nightly
267 key = self.form_compileropt_key('nightly')
268 nightly_opt = self.environment.coredata.get_option_for_target(target, key)
269 if nightly_opt == 'enabled' and not self.is_nightly:
270 raise EnvironmentException(f'Rust compiler {self.name_string()} is not a nightly compiler as required by the "nightly" option.')
271 return nightly_opt != 'disabled' and self.is_nightly
272
273 def sanitizer_link_args(self, target: T.Optional[BuildTarget], value: T.List[str]) -> T.List[str]:
274 # Sanitizers are not supported yet for Rust code. Nightly supports that
275 # with -Zsanitizer=, but procedural macros cannot use them. But even if
276 # Rust code cannot be instrumented, we can link in the sanitizer libraries
277 # for the sake of C/C++ code
278 return rustc_link_args(super().sanitizer_link_args(target, value))
279
280 def get_soname_args(self, prefix: str, shlib_name: str, suffix: str, soversion: str,
281 darwin_versions: T.Tuple[str, str]) -> T.List[str]:
282 return rustc_link_args(super().get_soname_args(prefix, shlib_name, suffix, soversion, darwin_versions))
283
284 @functools.lru_cache(maxsize=None)
285 def has_verbatim(self) -> bool:
286 if version_compare(self.version, '< 1.67.0'):
287 return False
288 # GNU ld support '-l:PATH'
289 if 'ld.' in self.linker.id and self.linker.id != 'ld.wasm':
290 return True
291 # -l:+verbatim does not work (yet?) with MSVC link or Apple ld64
292 # (https://github.com/rust-lang/rust/pull/138753). For ld64, it
293 # works together with -l:+whole_archive because -force_load (the macOS
294 # equivalent of --whole-archive), receives the full path to the library
295 # being linked. However, Meson uses "bundle", not "whole_archive".
296 return False
297
298 def lib_file_to_l_arg(self, libname: str) -> T.Optional[str]:
299 """Undo the effects of -l on the filename, returning the
300 argument that can be passed to -l, or None if the
301 library name is not supported."""
302 if not is_library(libname):
303 return None
304 libname, ext = os.path.splitext(libname)
305
306 # On Windows, rustc's -lfoo searches either foo.lib or libfoo.a.
307 # Elsewhere, it searches both static and shared libraries and always with
308 # the "lib" prefix; for simplicity just skip .lib on non-Windows.
309 if self.info.is_windows():
310 if ext == '.lib':
311 return libname
312 if ext != '.a':
313 return None
314 else:
315 if ext == '.lib':
316 return None
317
318 if not libname.startswith('lib'):
319 return None
320 libname = libname[3:]
321 return libname
322
323 def get_debug_args(self, is_debug: bool) -> T.List[str]:
324 return clike_debug_args[is_debug]
325
326 def get_optimization_args(self, optimization_level: str) -> T.List[str]:
327 return rust_optimization_args[optimization_level]
328
329 def build_rpath_args(self, build_dir: str, from_dir: str, target: BuildTarget,
330 extra_paths: T.Optional[T.List[str]] = None
331 ) -> T.Tuple[T.List[str], T.Set[bytes]]:
332 # add rustc's sysroot to account for rustup installations
333 args, to_remove = super().build_rpath_args(
334 build_dir, from_dir, target, [self.get_target_libdir()])
335 return rustc_link_args(args), to_remove
336
337 def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str],
338 build_dir: str) -> T.List[str]:
339 for idx, i in enumerate(parameter_list):
340 if i[:2] == '-L':
341 for j in ['dependency', 'crate', 'native', 'framework', 'all']:
342 combined_len = len(j) + 3
343 if i[:combined_len] == f'-L{j}=':
344 parameter_list[idx] = i[:combined_len] + os.path.normpath(os.path.join(build_dir, i[combined_len:]))
345 break
346
347 return parameter_list
348
349 @classmethod
350 def use_linker_args(cls, linker: str, version: str) -> T.List[str]:
351 return ['-C', f'linker={linker}']
352
353 def get_options(self) -> MutableKeyedOptionDictType:
354 opts = super().get_options()
355
356 key = self.form_compileropt_key('std')
357 opts[key] = options.UserComboOption(
358 self.make_option_name(key),
359 'Rust edition to use',
360 'none',
361 choices=['none', '2015', '2018', '2021', '2024'])
362
363 key = self.form_compileropt_key('dynamic_std')
364 opts[key] = options.UserBooleanOption(
365 self.make_option_name(key),
366 'Whether to link Rust build targets to a dynamic libstd',
367 False)
368
369 key = self.form_compileropt_key('nightly')
370 opts[key] = options.UserFeatureOption(
371 self.make_option_name(key),
372 "Nightly Rust compiler (enabled=required, disabled=don't use nightly feature, auto=use nightly feature if available)",
373 'auto')
374
375 return opts
376
377 def get_dependency_compile_args(self, dep: 'Dependency') -> T.List[str]:
378 if isinstance(dep, RustSystemDependency):
379 return dep.get_compile_args()
380 # Rust doesn't have dependency compile arguments so simply return
381 # nothing here. Dependencies are linked and all required metadata is
382 # provided by the linker flags.
383 return []
384
385 def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]:
386 args = []
387 std = self.get_compileropt_value('std', target, subproject)
388 assert isinstance(std, str)
389 if std != 'none':
390 args.append('--edition=' + std)
391 return args
392
393 def get_crt_compile_args(self, crt_val: str) -> T.List[str]:
394 # Rust handles this for us, we don't need to do anything
395 return []
396
397 def get_crt_link_args(self, crt_val: str) -> T.List[str]:
398 if not isinstance(self.linker, VisualStudioLikeLinkerMixin):
399 return []
400 # Rustc always use non-debug Windows runtime. Inject the one selected
401 # by Meson options instead.
402 # https://github.com/rust-lang/rust/issues/39016
403 return self.MSVCRT_ARGS[self.get_crt_val(crt_val)]
404
405 def get_colorout_args(self, colortype: str) -> T.List[str]:
406 if colortype in {'always', 'never', 'auto'}:
407 return [f'--color={colortype}']
408 raise MesonException(f'Invalid color type for rust {colortype}')
409
410 def get_external_link_args(self) -> T.List[str]:
411 return rustc_link_args(super().get_external_link_args())
412
413 @functools.lru_cache(maxsize=None)
414 def get_linker_always_args(self) -> T.List[str]:
415 return rustc_link_args(super().get_linker_always_args()) + ['-Cdefault-linker-libraries']
416
417 def get_embed_bitcode_args(self, bitcode: bool, lto: bool) -> T.List[str]:
418 if bitcode:
419 return ['-C', 'embed-bitcode=yes']
420 elif lto:
421 return []
422 else:
423 return ['-C', 'embed-bitcode=no']
424
425 def get_lto_compile_args(self, *, target: T.Optional[BuildTarget] = None, threads: int = 0,
426 mode: str = 'default') -> T.List[str]:
427 if target.rust_crate_type in {'dylib', 'proc-macro'}:
428 return []
429
430 # TODO: what about -Clinker-plugin-lto?
431 rustc_lto = 'lto=thin' if mode == 'thin' else 'lto'
432 return ['-C', rustc_lto]
433
434 def get_lto_link_args(self, *, target: T.Optional[BuildTarget] = None, threads: int = 0,
435 mode: str = 'default', thinlto_cache_dir: T.Optional[str] = None) -> T.List[str]:
436 # no need to specify anything because the rustc command line
437 # includes the result of get_lto_compile_args()
438 return []
439
440 def get_lto_obj_cache_path(self, path: str) -> T.List[str]:
441 return rustc_link_args(super().get_lto_obj_cache_path(path))
442
443 def get_coverage_args(self) -> T.List[str]:
444 return ['-C', 'instrument-coverage']
445
446 def get_coverage_link_args(self) -> T.List[str]:
447 return rustc_link_args(super().get_coverage_link_args())
448
449 def gen_vs_module_defs_args(self, defsfile: str) -> T.List[str]:
450 return rustc_link_args(super().gen_vs_module_defs_args(defsfile))
451
452 def gen_export_dynamic_link_args(self) -> T.List[str]:
453 return rustc_link_args(self.linker.export_dynamic_args())
454
455 def get_profile_generate_args(self) -> T.List[str]:
456 return ['-C', 'profile-generate']
457
458 def get_profile_use_args(self) -> T.List[str]:
459 return ['-C', 'profile-use']
460
461 @functools.lru_cache(maxsize=None)
462 def get_asneeded_args(self) -> T.List[str]:
463 return rustc_link_args(super().get_asneeded_args())
464
465 def bitcode_args(self) -> T.List[str]:
466 return ['-C', 'embed-bitcode=yes']
467
468 @functools.lru_cache(maxsize=None)
469 def headerpad_args(self) -> T.List[str]:
470 return rustc_link_args(super().headerpad_args())
471
472 @functools.lru_cache(maxsize=None)
473 def get_linker_fatal_warnings(self) -> T.List[str]:
474 return rustc_link_args(super().get_linker_fatal_warnings())
475
476 @functools.lru_cache(maxsize=None)
477 def get_allow_undefined_link_args(self) -> T.List[str]:
478 return rustc_link_args(super().get_allow_undefined_link_args())
479
480 def get_build_link_args(self, target: BuildTarget, build: build.Build) -> T.List[str]:
481 return rustc_link_args(super().get_build_link_args(target, build))
482
483 def get_target_link_args(self, target: 'BuildTarget') -> T.List[str]:
484 return rustc_link_args(super().get_target_link_args(target))
485
486 def get_win_subsystem_args(self, value: str) -> T.List[str]:
487 return rustc_link_args(super().get_win_subsystem_args(value))
488
489 def get_werror_args(self) -> T.List[str]:
490 # Use -D warnings, which makes every warning not explicitly allowed an
491 # error
492 return ['-D', 'warnings']
493
494 def get_warn_args(self, level: str) -> T.List[str]:
495 # TODO: I'm not really sure what to put here, Rustc doesn't have warning
496 return self._WARNING_LEVELS[level]
497
498 def get_pic_args(self) -> T.List[str]:
499 # relocation-model=pic is rustc's default already.
500 return []
501
502 def get_std_link_args(self, env: Environment, is_thin: bool) -> T.List[str]:
503 # Rust handles static library creation via --crate-type
504 return []
505
506 def get_std_shared_lib_link_args(self) -> T.List[str]:
507 # Rust handles shared library creation via --crate-type
508 return []
509
510 def get_std_shared_module_link_args(self, target: BuildTarget) -> T.List[str]:
511 # Rust handles shared module creation via --crate-type
512 return []
513
514 def get_pie_args(self) -> T.List[str]:
515 # Rustc currently has no way to toggle this, it's controlled by whether
516 # pic is on by rustc
517 return []
518
519 def get_compile_only_args(self) -> T.List[str]:
520 return ['--crate-type', 'lib']
521
522 def get_pie_link_args(self) -> T.List[str]:
523 # Rustc currently has no way to toggle this, it's controlled by whether
524 # pic is on by rustc
525 return []
526
527 def get_assert_args(self, disable: bool) -> T.List[str]:
528 action = "no" if disable else "yes"
529 return ['-C', f'debug-assertions={action}', '-C', 'overflow-checks=no']
530
531 def get_rust_tool(self, name: str) -> T.List[str]:
532 if self.rustup_run_and_args:
533 rustup_exelist, args = self.rustup_run_and_args
534 # do not use extend so that exelist is copied
535 exelist = rustup_exelist + [name]
536 else:
537 exelist = [name]
538 args = self.get_exe_args()
539
540 from ..programs import find_external_program
541 for prog in find_external_program(self.environment, self.for_machine, exelist[0], exelist[0],
542 [exelist[0]], allow_default_for_cross=False):
543 exelist[0] = prog.path
544 break
545 else:
546 return []
547
548 return exelist + args
549
550 def has_multi_arguments(self, args: T.List[str]) -> T.Tuple[bool, bool]:
551 return self.compiles('fn main() { std::process::exit(0) }\n', extra_args=args, mode=CompileCheckMode.COMPILE)
552
553 def has_multi_link_arguments(self, args: T.List[str], to_host_args: bool = True) -> T.Tuple[bool, bool]:
554 if to_host_args:
555 args = rustc_link_args(args)
556 args = rustc_link_args(self.linker.fatal_warnings()) + args
557 return self.compiles('fn main() { std::process::exit(0) }\n', extra_args=args, mode=CompileCheckMode.LINK)
558
559 @functools.lru_cache(maxsize=None)
560 def get_rustdoc(self) -> T.Optional[RustdocTestCompiler]:
561 exelist = self.get_rust_tool('rustdoc')
562 if not exelist:
563 return None
564
565 return RustdocTestCompiler(exelist, self.version, self.for_machine,
566 self.environment,
567 full_version=self.full_version,
568 linker=self.linker, rustc=self)
569
570 class ClippyRustCompiler(RustCompiler):
571
572 """Clippy is a linter that wraps Rustc.
573
574 This just provides us a different id
575 """
576
577 id = 'clippy-driver rustc'
578
579
580 class RustdocTestCompiler(RustCompiler):
581
582 """We invoke Rustdoc to run doctests. Some of the flags
583 are different from rustc and some (e.g. --emit link) are
584 ignored."""
585
586 id = 'rustdoc --test'
587
588 def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
589 env: Environment, full_version: T.Optional[str],
590 linker: T.Optional['DynamicLinker'], rustc: RustCompiler):
591 super().__init__(exelist, version, for_machine,
592 env, full_version, linker)
593 self.rustc = rustc
594
595 @functools.lru_cache(maxsize=None)
596 def get_sysroot(self) -> str:
597 return self.rustc.get_sysroot()
598
599 @functools.lru_cache(maxsize=None)
600 def get_target_libdir(self) -> str:
601 return self.rustc.get_target_libdir()
602
603 @functools.lru_cache(maxsize=None)
604 def get_cfgs(self) -> T.List[str]:
605 return self.rustc.get_cfgs()
606
607 def get_debug_args(self, is_debug: bool) -> T.List[str]:
608 return []
609
610 def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]:
611 return []
612
613 def get_output_args(self, outputname: str) -> T.List[str]:
614 return []