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

[SR-15922] Conflicting messaging around @preconcurrency usage #58183

Closed
adam-fowler opened this issue Feb 28, 2022 · 3 comments · Fixed by #59892
Closed

[SR-15922] Conflicting messaging around @preconcurrency usage #58183

adam-fowler opened this issue Feb 28, 2022 · 3 comments · Fixed by #59892
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself

Comments

@adam-fowler
Copy link

Previous ID SR-15922
Radar rdar://problem/90348987
Original Reporter @adam-fowler
Type Bug
Environment

Using swift-5.6-DEVELOPMENT-SNAPSHOT-2022-02-11-a compiler

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 16b7aaa8b476165beb277ae4ddec6a8b

Issue Description:

Compiling the "sendable" branch of https://github.com/soto-project/soto-core produces this remark

Building for debugging...
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:18:17: remark: '@preconcurrency' attribute on module 'Logging' is unused
@preconcurrency import Logging
~~~~~~~~~~~~~~~~^
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:19:17: remark: '@preconcurrency' attribute on module 'NIOCore' is unused
@preconcurrency import NIOCore
~~~~~~~~~~~~~~~~^

But if I do as suggested I get warnings about non-sendable types

Building for debugging...
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:251:21: warning: capture of 'logger' with non-sendable type 'Logger' in a `@Sendable` closure
                    logger.trace("Request endpoint")
                    ^
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/.build/checkouts/swift-log/Sources/Logging/Logging.swift:38:15: note: struct 'Logger' does not conform to the 'Sendable' protocol
public struct Logger {
              ^
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:18:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Logging'
import Logging
^
@preconcurrency 
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:252:96: warning: capture of 'eventLoop' with non-sendable type 'EventLoop' in a `@Sendable` closure
                    let endpoint = try await endpointDiscovery.getEndpoint(logger: logger, on: eventLoop).get()
                                                                                               ^
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/.build/checkouts/swift-nio/Sources/NIOCore/EventLoop.swift:220:17: note: protocol 'EventLoop' does not conform to the 'Sendable' protocol
public protocol EventLoop: EventLoopGroup {
                ^
/Users/adamfowler/Developer/macOS/lib/soto-project/soto-core/Sources/SotoCore/AsyncAwaitSupport/AWSClient+EndpointDiscovery+async.swift:19:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'NIOCore'
import NIOCore
^
@preconcurrency 
@ktoso
Copy link
Contributor

ktoso commented Mar 2, 2022

@swift-ci create

1 similar comment
@ktoso
Copy link
Contributor

ktoso commented Mar 8, 2022

@swift-ci create

@ktoso
Copy link
Contributor

ktoso commented Mar 8, 2022

Synced manually rdar://89940926

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
DougGregor added a commit to DougGregor/swift that referenced this issue Jul 5, 2022
…ion bodies

This eliminates spurious warnings suggesting that folks remove
`@preconcurrency` from imports that occur during `-emit-module` phases,
because we're skipping function bodies and, therefore, the code that
would depend on the `@preconcurrency` import.

Fixes swiftlang#58183 / rdar://89940926.
DougGregor added a commit to DougGregor/swift that referenced this issue Jul 5, 2022
…ion bodies

This eliminates spurious warnings suggesting that folks remove
`@preconcurrency` from imports that occur during `-emit-module` phases,
because we're skipping function bodies and, therefore, the code that
would depend on the `@preconcurrency` import.

Fixes swiftlang#58183 / rdar://89940926.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants