Meta: Resolve pyright warnings in ladybird.py and helpers

This commit is contained in:
Timothy Flynn 2025-08-06 20:22:32 -04:00 committed by Tim Flynn
commit 11f4b9c6ae
Notes: github-actions[bot] 2025-08-07 10:58:33 +00:00
2 changed files with 7 additions and 2 deletions

View file

@ -180,9 +180,11 @@ def pick_swift_compilers(platform: Platform, project_root: Path) -> tuple[Path,
swiftly_toolchain_path = run_command(["swiftly", "use", "--print-location"], return_output=True, cwd=project_root) swiftly_toolchain_path = run_command(["swiftly", "use", "--print-location"], return_output=True, cwd=project_root)
if not swiftly_toolchain_path: if not swiftly_toolchain_path:
run_command(["swiftly", "install"], exit_on_failure=True, cwd=project_root) run_command(["swiftly", "install"], exit_on_failure=True, cwd=project_root)
swiftly_toolchain_path = run_command( swiftly_toolchain_path = run_command(
["swiftly", "use", "--print-location"], return_output=True, exit_on_failure=True, cwd=project_root ["swiftly", "use", "--print-location"], return_output=True, exit_on_failure=True, cwd=project_root
) )
assert swiftly_toolchain_path
swiftly_toolchain_path = Path(swiftly_toolchain_path.strip()) swiftly_toolchain_path = Path(swiftly_toolchain_path.strip())
swiftly_bin_dir = swiftly_toolchain_path.joinpath("usr", "bin") swiftly_bin_dir = swiftly_toolchain_path.joinpath("usr", "bin")

View file

@ -183,9 +183,12 @@ def configure_main(platform: Platform, preset: str, cc: str, cxx: str) -> Path:
if build_preset_dir.joinpath("build.ninja").exists() or build_preset_dir.joinpath("ladybird.sln").exists(): if build_preset_dir.joinpath("build.ninja").exists() or build_preset_dir.joinpath("ladybird.sln").exists():
return build_preset_dir return build_preset_dir
switfc: Optional[str] = None
validate_cmake_version() validate_cmake_version()
if "Swift" in preset: if "Swift" in preset:
(cc, cxx, swiftc) = pick_swift_compilers(platform, ladybird_source_dir) compilers = pick_swift_compilers(platform, ladybird_source_dir)
(cc, cxx, swiftc) = tuple(map(str, compilers))
else: else:
(cc, cxx) = pick_host_compiler(platform, cc, cxx) (cc, cxx) = pick_host_compiler(platform, cc, cxx)
@ -201,7 +204,7 @@ def configure_main(platform: Platform, preset: str, cc: str, cxx: str) -> Path:
f"-DCMAKE_CXX_COMPILER={cxx}", f"-DCMAKE_CXX_COMPILER={cxx}",
] ]
if "Swift" in preset: if switfc:
config_args.append(f"-DCMAKE_Swift_COMPILER={swiftc}") config_args.append(f"-DCMAKE_Swift_COMPILER={swiftc}")
if platform.host_system == HostSystem.Linux and platform.host_architecture == HostArchitecture.AArch64: if platform.host_system == HostSystem.Linux and platform.host_architecture == HostArchitecture.AArch64: