Clear out Swift library-evolution warnings on non-Apple platforms#35
Clear out Swift library-evolution warnings on non-Apple platforms#35
Conversation
On Apple platforms, Swift library evolution is a thing, but not on Linux/Windows. The CI build logs are currently spammed by many hundreds of messages, e.g. from https://github.com/royalapplications/royalvnc/actions/runs/22570476612/job/65376761117#step:8:37 to https://github.com/royalapplications/royalvnc/actions/runs/22570476612/job/65376761117#step:8:2171 (some 2000+ lines) which drowns any other build output and makes build issues very hard to track, understand and troubleshoot. A few things change here: 1. in Package.swift, `-enable-library-evolution` is only enabled on Apple platforms 2. @_implementationOnly is replaced in source by `internal import` 3. in the C SDK, @_implementationOnly is kept for Apple platforms, but changed to `internal import` everywhere else, since library evolution is not a thing Hopefully reduces or eliminates the warning spew on non-Apple platforms; let's see if CI logs show a drop from 2000 lines to something more palatable.
|
@nil4 It's not that easy unfortunately. Regular import will make Swift API clients have to import the module that is now publicly imported in RoyalVNC. That's exactly what As for |
|
Fair enough, let's keep this as a draft until time is right to test this out. |
Test library-evolution opt-out on Android
ref. https://learn.microsoft.com/cpp/c-runtime-library/obsolete-functions#deprecated-as-obsolete-in-visual-studio-2015 Build is now warning-free on Windows
On Apple platforms, Swift library evolution is a thing, but not on Linux/Windows.
The CI build logs are currently spammed by many hundreds of messages, e.g. from https://github.com/royalapplications/royalvnc/actions/runs/22570476612/job/65376761117#step:8:37 to https://github.com/royalapplications/royalvnc/actions/runs/22570476612/job/65376761117#step:8:2171 (2000+ lines) which drowns any other output and makes build issues very hard to track, understand or troubleshoot.
A few things changed here:
-enable-library-evolutionis only enabled on Apple platforms@_implementationOnlyis replaced in source byinternal import@_implementationOnlyis kept for Apple platforms, but changed to plainimporteverywhere else, since library evolution is not a thing.This eliminates the warning spew on non-Apple platforms; see these recent CI logs going from 2000+ lines down to < 50.
I'm not entirely happy with the duplication when using the C SDK. I think we could further clean up by:
-enable-library-evolutionbuild flags@_implementationOnlywithinternal import(where possible) and regularimportelsewhere -- this is the root cause of all the warningsLet me know what you prefer.