-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMAKE] Fix layering issue between Concurrency and Darwin overlay #82973
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please smoke test |
@@ -14,15 +14,19 @@ | |||
|
|||
import Swift | |||
|
|||
internal import Darwin | |||
@_silgen_name("swift_concurrency_dlopen_noload") | |||
private func dlopen(_ path: String) -> OpaquePointer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this symbol is mapping in the RTLD_NOLOAD
, we should likely not name this dlopen
to avoid confusion.
Also, swift_concurrency_dlopen_noload
is taking a const char *
, not a Swift string. We're not using the automatic bridging here so I don't think you get the automatic conversion thunks. I believe this type should be an UnsafePointer<CChar>?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed it to dlopen_noload
@@ -15,7 +15,6 @@ import Swift | |||
#if !SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY | |||
#if ASYNC_STREAM_STANDALONE | |||
@_exported import _Concurrency | |||
import Darwin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What API is this import Darwin
pulling in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's pulling in the Darwin.os
functionality it looks like, you're right I was too zealous in removing this. I'm going to restore this and handle it in a separate PR
@swift-ci please smoke test |
#if !defined(_WIN32) && !defined(__wasi__) && __has_include(<dlfcn.h>) | ||
#include <dlfcn.h> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if !defined(_WIN32) && !defined(__wasi__) && __has_include(<dlfcn.h>) | |
#include <dlfcn.h> | |
#endif | |
#include <dlfcn.h> |
This seems like we shouldn't bother with the guards as this is now Darwin specific.
@swift-ci please smoke test |
Concurrency from the Core project is importing the Darwin platform overlay, which in turn depends on SwiftCore from the Core project, breaking the project layering.
Concurrency only needs the Clang module, but Swift does not have a mechanism to only import a clang module. For now import the functionality needed from Darwin by importing and wrapping the associated functions from
<dlfcn.h>
withinCFExecutor.cpp
Also remove Darwin import from
AsyncStreamBuffer.swift
because it is not used