Skip to content

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented May 15, 2025

Also add a couple modules to use Swift calling conventions and set the correct C++ standard.

Do not enable this yet, as this would relies on a few find modules that
are not available at the moment.

Addresses rdar://151389005

@edymtt edymtt force-pushed the edymtt/add-distributed-to-new-build-system-inert branch from daaa868 to 440ff7b Compare May 15, 2025 16:50
@edymtt
Copy link
Contributor Author

edymtt commented May 15, 2025

@swift-ci please smoke test

@edymtt edymtt marked this pull request as ready for review May 15, 2025 18:05
CACHE FILEPATH "Location for private build system extension")

include(CxxStandard)
include(SwiftCallingConventions)
Copy link
Member

Choose a reason for hiding this comment

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

Why is distributed special and the only one to perform these checks? I think that we should replicate them across all the builds if we want to perform these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of the Supplemental libraries we are converting, only Distributed and Observation use Swift calling conventions -- since in this rewrite we are trying to apply flags/features only to the libraries that only strictly need those, I thought it was sound not require to apply those to Synchronization and Differentiation.

Copy link
Member

Choose a reason for hiding this comment

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

Core definitely uses the swift calling conventions as does the Concurrency runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, my analysis was focused on the Supplemental libraries alone -- Core and Concurrency are running these checks already with CompilerSettings.cmake


configure_file("CMakeConfig.h.in"
"${PROJECT_BINARY_DIR}/include/swift/Runtime/CMakeConfig.h"
ESCAPE_QUOTES @ONLY)
Copy link
Member

Choose a reason for hiding this comment

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

This seems sketchy. We shouldn't be re-generating the configuration for the runtime build, but should distribute it or pull it from the build tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me see what I can do -- possibly a find module may help here, need to think about the distribution scenario.

Copy link
Member

Choose a reason for hiding this comment

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

If we install/export this from Core, find_package(SwiftCore) should be able to wire this up.

Copy link
Member

Choose a reason for hiding this comment

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

Once the Core and supplemental libraries are built, the CMakeConfig.h file aren't used by anything so it shouldn't be necessary so installing it isn't great.

You're right that it's sketchy if the projects get out of sync. I do think that the SwiftCoreConfig.cmake should export the appropriate settings and that the supplemental libraries should import them to ensure that the values are kept in sync.

Copy link
Member

Choose a reason for hiding this comment

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

I think that for the time being we can control that from the outside then; I don't think that we should regenerate it (point into the build tree with CMAKE_CXX_FLAGS).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I adopted this latter approach -- to better highlight this in code, I have introduced a variable named ${PROJECT_NAME}_PATH_TO_SWIFT_RUNTIME_HEADERS to point at the path containing swift/Runtime and use that as part of target_include_directories, let me know if you think that's appropriate

swiftCore
swift_Concurrency)
# swiftDarwin/Libc/Platform
# builtin_float
Copy link
Member

Choose a reason for hiding this comment

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

_Builtin_float is part of the overlays, we should introduce a find_project(SwiftOverlay) for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for suggesting this should be more generic -- I was thinking of focusing specifically on _Builtin_float, but that may be too granular.

@edymtt edymtt force-pushed the edymtt/add-distributed-to-new-build-system-inert branch from 440ff7b to fa2add6 Compare May 19, 2025 20:42
@edymtt
Copy link
Contributor Author

edymtt commented May 19, 2025

(This is a rebase to account for merge conflicts and changes in #81558, no review feedback has been incorporated yet)

@edymtt edymtt force-pushed the edymtt/add-distributed-to-new-build-system-inert branch from fa2add6 to 256e788 Compare July 11, 2025 22:06
@edymtt edymtt force-pushed the edymtt/add-distributed-to-new-build-system-inert branch from 256e788 to addcebb Compare July 14, 2025 21:41
@edymtt
Copy link
Contributor Author

edymtt commented Jul 14, 2025

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Jul 15, 2025

macOS test failure is unrelated to this change

Unresolved Tests (1):
    lldb-api :: lang/swift/array_bridged_enum/TestArrayBridgedEnum.py

@edymtt
Copy link
Contributor Author

edymtt commented Jul 15, 2025

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Jul 15, 2025

@swift-ci please smoke test macOS

edymtt added 2 commits July 15, 2025 14:44
Do not enable this yet, as this would relies on a few find modules that
are not available at the moment.

Addresses rdar://151389005
@edymtt edymtt force-pushed the edymtt/add-distributed-to-new-build-system-inert branch from addcebb to 7348469 Compare July 15, 2025 21:47
@edymtt
Copy link
Contributor Author

edymtt commented Jul 15, 2025

@swift-ci please smoke test

@edymtt edymtt merged commit 4923ce8 into swiftlang:main Jul 17, 2025
3 checks passed
@edymtt edymtt deleted the edymtt/add-distributed-to-new-build-system-inert branch July 17, 2025 15:51
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