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

CMP0157 coming up again when cross-compiling for Android on Windows #79219

Open
weliveindetail opened this issue Feb 7, 2025 · 1 comment
Open

Comments

@weliveindetail
Copy link
Member

The NEW setting for CMake policy CMP0157 issn't compatible with the way swift-collections was built for Android on Windows. Apparently, this was fixed because https://ci-external.swift.org/job/swift-PR-windows/36088/ didn't fail (at this point). In a later CI run, however, it came up again: https://ci-external.swift.org/job/swift-PR-windows/36135/ It's not clear to me why this happens, but here are a few more details.

MSVC version was upgraded from 19.39.33523.0 to 19.42.34436.0, but this didn't change CMake (still at 3.29.2). A new config parameter was added as well, but this shouldn't impact anything other than the naming of the libraries:

@@ -1,4 +1,4 @@
-[2025-02-06 16:07:27] Building 'C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift-corelibs-foundation' to 'T:\703' for arch 'x86_64'...
+[2025-02-07 13:24:36] Building 'C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift-corelibs-foundation' to 'T:\703' for arch 'x86_64'...
 cmake.exe -B T:\703 -S C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift-corelibs-foundation -G Ninja
 -D _SwiftCollections_SourceDIR=C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift-collections
 -D _SwiftFoundation_SourceDIR=C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift-foundation
@@ -23,6 +23,7 @@
 -D CMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe
 -D CMAKE_NINJA_FORCE_RESPONSE_FILE=YES
 -D CMAKE_SHARED_LINKER_FLAGS=--ld-path=T:/5/bin/ld.lld
+-D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib
 -D CMAKE_Swift_COMPILER=T:/5/bin/swiftc.exe
 -D CMAKE_Swift_COMPILER_TARGET=x86_64-unknown-linux-android
 -D CMAKE_Swift_COMPILER_WORKS==

Attaching the full build logs as well: swift-PR-windows-36088-android.log and swift-PR-windows-36135-android.log

@weliveindetail
Copy link
Member Author

I have a temporary workaround, but I guess this is still worth reporting.

CC @etcwilde, @shahmishal, @compnerd any ideas?

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

No branches or pull requests

1 participant