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

utils: support building android SDKs on Windows #72014

Merged
merged 12 commits into from
Jun 7, 2024
Merged

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Mar 1, 2024

This adds the ability to build the Android SDKs as part of the Windows build.

This adds the ability to build the Android SDKs as part of the Windows
build.
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated
@@ -629,12 +724,30 @@ function Build-CMakeProject {
# Add additional defines (unless already present)
$Defines = $Defines.Clone()

# TODO(compnerd) clean up these and formalise this selection
if ($Platform -eq "Android") {
$env:Path = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env:Path}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the trick I suggested with Isolate-EnvVars and Invoke-VsDevShell not work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to try to implement them. Diff welcome of course :)

utils/build.ps1 Show resolved Hide resolved
utils/build.ps1 Show resolved Hide resolved
ICU_DATA_LIBRARY_RELEASE = "$LibraryRoot\icu-69.1\usr\lib\$Platform\$ShortArch\sicudt69.lib";
ICU_I18N_LIBRARY_RELEASE = "$LibraryRoot\icu-69.1\usr\lib\$Platform\$ShortArch\sicuin69.lib";
ICU_DATA_LIBRARY_RELEASE = if ($Platform -eq "Windows") {
"$LibraryRoot\icu-69.1\usr\lib\$Platform\$ShortArch\sicudt69.lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $LibraryRoot\icu-69.1\usr\lib\$Platform\$ShortArch prefix is worth extracting before this block to keep it looking line just a set of assignments

utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Show resolved Hide resolved
@compnerd compnerd force-pushed the android branch 2 times, most recently from c22f85f to 41533ef Compare March 1, 2024 23:33
@hyp hyp force-pushed the android branch 2 times, most recently from e0c89db to bb92d76 Compare April 29, 2024 22:45
@hyp
Copy link
Contributor

hyp commented Apr 29, 2024

adding latest changes today

@hyp
Copy link
Contributor

hyp commented Apr 30, 2024

@compnerd @tristanlabelle made some updates. could you take another look please? also updated foundation - swiftlang/swift-corelibs-foundation#4889

utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Outdated Show resolved Hide resolved
@hyp
Copy link
Contributor

hyp commented May 14, 2024

@compnerd addressed your review comments

@hyp
Copy link
Contributor

hyp commented May 30, 2024

@swift-ci please tst

@hyp
Copy link
Contributor

hyp commented May 30, 2024

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented May 30, 2024

@swift-ci please build toolchain

@hyp hyp marked this pull request as ready for review May 30, 2024 19:18
@hyp hyp requested review from ktoso and a team as code owners May 30, 2024 19:18
@hyp hyp requested a review from hjyamauchi May 30, 2024 19:18
@hyp
Copy link
Contributor

hyp commented May 31, 2024

@swift-ci please test windows platform

1 similar comment
@hyp
Copy link
Contributor

hyp commented Jun 3, 2024

@swift-ci please test windows platform

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test windows platform

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test windows platform

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please build windows toolchain

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please build toolchain

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test source compatibility

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

This is ready!

utils/build.ps1 Show resolved Hide resolved
utils/build.ps1 Show resolved Hide resolved
@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please build toolchain

utils/build.ps1 Outdated
@@ -334,7 +334,7 @@ function Get-InstallDir($Arch) {
return "$ImageRoot\$ProgramFilesName\Swift"
}

function Get-HostSwiftSDK() {
function Get-BuildSwiftSDK() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this is the host ... I was wrong. I'm confused, why are we not passing in the Arch for the host arch sdk? Could we not cross-compile to more than one arch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because there's only one host arch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, this is the host SDK for the toolchain, not an arbitrary host SDK. I think that generalising this to Get-SwiftSDK($Arch) might be nice as it currently makes me think that it is getting the Swift SDK for a particular host (which is true, it's just that the particular host happens to be the host that we are building the toolchain for). But, lets leave that for a follow up, I'd like to get this in.

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please test

@hyp
Copy link
Contributor

hyp commented Jun 6, 2024

@swift-ci please build toolchain

@compnerd
Copy link
Member Author

compnerd commented Jun 7, 2024

@swift-ci please test source compatibility

@hyp hyp merged commit c8b5344 into swiftlang:main Jun 7, 2024
10 checks passed
@compnerd compnerd deleted the android branch June 7, 2024 19:52
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
utils: support building android SDKs on Windows
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
utils: support building android SDKs on Windows
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
utils: support building android SDKs on Windows
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.

4 participants