Skip to content

[android] conditionally build DS2 for the Android SDK #76113

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

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

andrurogerz
Copy link
Contributor

@andrurogerz andrurogerz commented Aug 27, 2024

Conditionally include the DS2debug server in the Android Swift SDK build. DS2 and its dependencies are only included when build.ps1 is invoked with the -IncludeDS2 flag.

This change is comprised of three primary parts:

  1. Fetch and unpack WinFlexBison tools; flex and bison equivalents are required to build DS2.
  2. Build the RegsGen2 host tool, specifying the previously unpacked win_flex.exe and win_bison.exe tools.
  3. Build ds2 binary for each each requested Android SDK architecture and install it to the proper location under the Android.platform directory.

NOTE: the Android SDK isn't currently included in the installer build, so the ds2 binary only ends up in the output directory and not in any .msi file.

Test Plan

Build with and without ds2 included

cd S:\SourceCache
.\swift\utils\build.cmd -AndroidSDKs aarch64,x86_64
.\swift\utils\build.cmd -AndroidSDKs aarch64,x86_64 -IncludeDS2

Confirm the ds2 binary appears in the expected location only when -IncludeDS2 is specified

cd S:\b
dir /s /b ds2
S:\b\aarch64\Android\ds2
S:\b\aarch64\Android\ds2\ds2
S:\b\arm64\Android.platform\Developer\Library\aarch64-unknown-linux-android\bin\ds2
S:\b\x64\Android.platform\Developer\Library\x86_64-unknown-linux-android\bin\ds2
S:\b\x86_64\Android\ds2
S:\b\x86_64\Android\ds2\ds2

@andrurogerz andrurogerz marked this pull request as ready for review August 28, 2024 02:50
@andrurogerz
Copy link
Contributor Author

@hjyamauchi would you mind having a look at this change?

@shahmishal I believe you have some stake in build.ps1 changes not breaking CI. This change is meant to have no effect unless the new argument is provided, so should be a noop for you.

@hjyamauchi
Copy link
Contributor

LGTM. Note the IncludeDS2 flag is an opt-in (off by default.)

@hjyamauchi
Copy link
Contributor

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Sep 3, 2024

@swift-ci please smoke test

@compnerd compnerd merged commit 2b817f3 into swiftlang:main Sep 4, 2024
3 checks passed
@andrurogerz andrurogerz deleted the android-sdk-ds2 branch November 7, 2024 01:13
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.

3 participants