Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build swift-inspect for Android as part of toolchain build #79050

Merged

Conversation

andrurogerz
Copy link
Contributor

@andrurogerz andrurogerz commented Jan 30, 2025

Purpose

Include swift-inspect for Android arm64-v8a and x86_64 as part of the Swift toolchain build on Windows.

Overview

  • Rework Build-Inspect to support building for targets other than the host
  • Update Build-Inspect to use the built sdk rather than the installed one
    • Required adding additional includes and link options to CMAKE_Swift_FLAGS
  • Maintain the output location of the swift-inspect binary for the host by special-casing it in Build-Inspect
  • Continue to build swift-inspect for the host using the host-built swift-argument-parser
  • For non-host builds, Build-Inspect lets CMake fetch swift-argument-parser instead of using the locally built version due to Android requiring v1.5.0 (see [swift-inspect] use CMake FetchContent to fetch ArgumentParser when not provided #78827)
  • Build swift-inspect for Android arm64-v8a and x86_64 when those targets are included in the build

Background

  • We can now build swift-inspect for Android 64-bit platforms and intend to include it as part of the Android SDK
  • Packaging changes to include the swift-inspect binary in the Android .msi files will come later
  • When the pinned version of swift-argument-parser moves to >= v1.5.0, the Build-ArgumentParser function should be reworked to build for non-host targets and used when building swift-inspect for non-host targets instead of letting CMake fetch it.

Validation

  • Clean + incremental local build using build.ps1 on Windows 11 x64.
rd /s /q S:\b
rd /s /q "S:\Program Files"
rd /s /q S:\Library
S:\SourceCache\swift\utils\build.cmd -Android -IncludeDS2 -DebugInfo -EnableCaching
  • Verified the Windows x64 swift-inspect.exe runs on the build machine
  • Verified the Android x86_64 swift-inspect runs on an Android emulator
  • Verified the Androied arm64-v8a swift-inspect runs on an Android device

@andrurogerz andrurogerz marked this pull request as draft January 30, 2025 16:52
@andrurogerz andrurogerz marked this pull request as ready for review February 3, 2025 15:50
utils/build.ps1 Show resolved Hide resolved
@compnerd
Copy link
Member

compnerd commented Feb 3, 2025

@swift-ci please smoke test

@compnerd compnerd merged commit 6f92302 into swiftlang:main Feb 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants