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

error: no such module 'OSLog' when building from Dockerfile on Mac using fly.io CLI fly deploy command #79

Closed
djryanash opened this issue Dec 28, 2023 · 1 comment
Labels
component:swift sdk Issue/PR related to Swift SDK type:bug Something isn't working

Comments

@djryanash
Copy link

djryanash commented Dec 28, 2023

Description of the bug:

I build a Swift Vapor app for the backend of my iOS app, the idea being to use the Google Gemini API for some very basic services on the backend for my iOS app.

In Xcode, I added the required dependency and target to the Package.swift file:

.package(url: "https://github.com/google/generative-ai-swift.git", from: "0.4.4")

.product(name: "GoogleGenerativeAI", package: "generative-ai-swift"),

As part of the Vapor template, the project already includes a Dockerfile and using flyctl from Homebrew with a few simple comment I should be able to theoretically deploy my app to fly.io.

fly launch works fine but then when I use fly deploy I get an error and it is unable to build:

/build/.build/checkouts/generative-ai-swift/Sources/GoogleAI/Logging.swift:16:8: error: no such module 'OSLog'
import OSLog
       ^

Clearly the error is related to the Logging.swift file inside generative-ai-swift dependency of the project.

If I use import OSLog anywhere inside my Vapor app, I don't get any build errors because, of course it's part of the Swift Standard Library. It just seems to not work from Logging.swift

Thanks.

Actual vs expected behavior:

Expected behavior: The project should be able to compile and deploy without errors from the command line using the command fly deploy command.

Actual behavior: The project doesn't compiled exists with the error:

/build/.build/checkouts/generative-ai-swift/Sources/GoogleAI/Logging.swift:16:8: error: no such module 'OSLog'

Any other information you'd like to share?

macOS 14.0, MacBook Pro 2020 1.4GHz quad-core Intel processor.
Xcode 15.1
Fly version 0.1.135 (latest)
Vapor (latest version)
Swift 5.9.2

@djryanash djryanash added component:swift sdk Issue/PR related to Swift SDK type:bug Something isn't working labels Dec 28, 2023
@andrewheard
Copy link
Collaborator

Hi @djryanash, unfortunately we don't support Linux or Vapor in the SDK at this time. I created a feature request for this in #90 to get a sense of the demand for the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:swift sdk Issue/PR related to Swift SDK type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants