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

Cannot compile on Linux target - "no such module 'os.log'" #262

Open
joemccall86 opened this issue May 16, 2024 · 3 comments
Open

Cannot compile on Linux target - "no such module 'os.log'" #262

joemccall86 opened this issue May 16, 2024 · 3 comments
Assignees

Comments

@joemccall86
Copy link

I have my generated Swift clients and the project builds in macOS. When I build on Linux I get the following issue:

[112/150] Compiling Connect ResponseCallbacks.swift
/root/project/clients/swift/proto-common/.build/checkouts/connect-swift/Libraries/Connect/Public/Implementation/Clients/ProtocolClient.swift:16:8: error: no such module 'os.log'
import os.log

I believe this is because os.log is only defined for macOS and not Linux. As far as I can tell the gRPC generators do not have this limitation.

@perezd perezd assigned perezd and rebello95 and unassigned perezd May 16, 2024
@perezd
Copy link
Member

perezd commented May 16, 2024

@rebello95 any thoughts about this?

@rebello95
Copy link
Contributor

👋🏽 at the moment Connect is not set up to compile for Linux. I have not done a thorough exploration into this, but adding Linux support seems like it would be nontrivial given Alamofire still has some missing features on Linux due to incomplete Swift behavior there: https://github.com/Alamofire/Alamofire?tab=readme-ov-file#known-issues-on-linux-and-windows

I also opened a test PR with some changes, but you can see from the CI failures that there are deeper issues, particularly around streaming: #263

@rebello95
Copy link
Contributor

Also, gRPC-Swift does not have this issue because it is backed fully by SwiftNIO. Connect is primarily backed by URLSession but has a separate module with SwiftNIO support. If we wanted to go down the Linux route, we could explore only making the NIO version support Linux

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 a pull request may close this issue.

3 participants