swiftlang / swift-sdk-generator

Generate Swift SDKs for cross-compilation
Apache License 2.0
182 stars 15 forks source link

warning: Could not read SDKSettings.json for SDK #110

Closed toffaletti closed 3 months ago

toffaletti commented 5 months ago

custom SDKs generated with swift-sdk-generator cause swift build to repeatedly output this warning:

warning: Could not read SDKSettings.json for SDK

This can be seen in logs from other issues: https://github.com/apple/swift-sdk-generator/issues/12 https://github.com/apple/swift-sdk-generator/issues/27

MaxDesiatov commented 5 months ago

Please let me know if these warnings cause any issues for you, otherwise they're harmless and can be ignored.

toffaletti commented 5 months ago

No issue other than making it harder to read the useful content in the build log output without filtering all these lines. Is there a simple work around like dropping an empty SDKSettings.json file somewhere?

xtremekforever commented 3 months ago

@MaxDesiatov @toffaletti I did a little research today about this issue and found that this SDKSettings.json file is used by the SwiftCrossCompilers project. Check out the reference file here: https://github.com/CSCIX65G/SwiftCrossCompilers/blob/master/SDKSettings.json

I tried a very minimal file to see what would work to just silence the warning. Including the following content in SDKSettings.json in the SDK directory (the ubuntu-jammy.sdk directory, for example) works:

{
  "SupportedTargets": {},
  "Version": "0.0.1",
  "CanonicalName": "linux"
}

Is it worth including this file by default in the generated SDKs to silence this warning and make the output cleaner? It seems like this is a feature of swiftpm now and unless it's removed, it's going to search for the file whenever cross-compiling is happening.

In my SDK I'm adding this empty file to make the compilation output cleaner. It doesn't hurt anything although it's annoying that it has to be there just to make the warning go away.

kateinoigakukun commented 3 months ago

The warning is now suppressed in the main branch toolchain https://github.com/swiftlang/swift-driver/pull/1619