Skip to content

standalone minimal tests fail to build on Apple platforms #76461

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

Conversation

ian-twilightcoder
Copy link
Contributor

@ian-twilightcoder ian-twilightcoder commented Sep 13, 2024

Apple platforms require reflection to be enabled in the standard library. Revert the commit that disabled reflection.

rdar://135878323

This reverts commit 8b189d9.

# Conflicts:
# stdlib/private/StdlibUnittest/CMakeLists.txt
# stdlib/private/StdlibUnittest/StdlibCoreExtras.swift
# stdlib/public/Platform/CMakeLists.txt
# utils/build-presets.ini

@ian-twilightcoder ian-twilightcoder requested review from a team and ktoso as code owners September 14, 2024 05:39
@ian-twilightcoder ian-twilightcoder changed the title swiftStdlibCollectionUnittest needed by check-swift-validation-only_executable-freestanding-x86_64 and no known rule to make it freestanding/embedded tests fail to build on Apple platforms Sep 18, 2024
@ian-twilightcoder ian-twilightcoder changed the title freestanding/embedded tests fail to build on Apple platforms freestanding tests fail to build on Apple platforms Sep 18, 2024
@ian-twilightcoder
Copy link
Contributor Author

@kubamracek I see this was originally turned off in #39030 but I don't understand why

@ian-twilightcoder ian-twilightcoder changed the title freestanding tests fail to build on Apple platforms standalone minimal tests fail to build on Apple platforms Sep 19, 2024
@ian-twilightcoder ian-twilightcoder marked this pull request as draft September 19, 2024 17:44
Apple platforms require reflection to be enabled in the standard library. Revert the commit that disabled reflection.

rdar://135878323

This reverts commit 8b189d9.

# Conflicts:
#	stdlib/private/StdlibUnittest/CMakeLists.txt
#	stdlib/private/StdlibUnittest/StdlibCoreExtras.swift
#	stdlib/public/Platform/CMakeLists.txt
#	utils/build-presets.ini
@ian-twilightcoder
Copy link
Contributor Author

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci test with toolchain and preset

@ian-twilightcoder
Copy link
Contributor Author

@swift-ci smoke test

@ian-twilightcoder
Copy link
Contributor Author

@swift-ci test

@ian-twilightcoder
Copy link
Contributor Author

Talked to Kuba a little bit, reflection was turned off "because it's a bit heavyweight". I'm not sure what the correct solution really is though. The OS/SDK owns the Darwin module, and the Darwin module requires reflection. Everything in stdlib/private (transitively) requires the Darwin module. So I don't see how it's possible to turn off reflection without doing something to migrate stdlib/private.

Currently stdlib/private is relying on all kinds of OS services like thread and process management, memory, etc., especially in the StdlibUnittest library which is used by ~300 tests. I don't know if the right thing is to turn all of those tests off in non-reflection mode, or if we need to make StdlibUnittest a host library rather than a platform library, or if we need some kind of PlatformMinimal overlay that doesn't try to use the host OS/SDK headers which don't match the target environment?

For now I'm trying to re-enable reflection to see if that clears up the immediate issue and then we can take more time to figure out what "minimal" means and how best to accomplish that.

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.

1 participant