-
Notifications
You must be signed in to change notification settings - Fork 9
Various problems with building Swift packages #14
Comments
Problem 1: SolvedNo longer present on the May 11, 2022 toolchain. Thus, it probably has the same source as (5). I added a partial patch for older toolchains where the text colorization bug was still present: append Problem 2: SolvedThe Patch: split the output of Problem 3: Temporary WorkaroundReported in swiftlang/swift-package-manager#5565. Workaround: rename the modulemap in S4TF's Problem 4: Temporary WorkaroundProposed patch: scan the SwiftPM flags beginning with This solution is too complex to implement right now. Workaround: never include headers into SwiftPM via %system cp -r "/content/Library/tensorflow-2.4.0/usr/include/tensorflow" "/usr/include/tensorflow" Problem 5: SolvedSeems to be resolved on recent Swift toolchains. Check swiftlang/swift#58916 for the latest information. |
I am going to declare problem 4 a permanent workaround. Scanning headers could become theoretically impossible if someone uses C macros to generate the include statements. Problem 3 is not Swift-Colab's fault; it's a SwiftPM bug. |
Actually, there is a potential solution for problem 4 - I'm going to try overhauling the build system and how LLDB loads modules. I could store metadata with each Clang module that asks LLDB to look in those search paths before initializing. There's a one-Jupyter session delay between when the Clang module is generated and when it can be used. This provides time to ensure every Clang module gets its proper search paths stored. How will I resolve those search paths? The new If problem 4 is solved, change the S4TF template notebook to stop copying
|
When building Swift packages, there are multiple problems:
build.db missing
when compiling a Swift package with the--verbose
flag, at least with S4TF.module.modulemap
files that declare the same Clang module can overwrite each other, even if one is part of the documentation of a Swift package and never actually involved in the build process. This happened with the modulemap currently in theUtilities
directory of s4tf/s4tf.-Xcc -I/...
flags from when you built the package helped SwiftPM locate headers. Now that LLDB is loading the module with no knowledge of those manual includes, it doesn't know where the headers are.\u{1b}[2K
sequence in build output swiftlang/swift#58916 is still an issue and I don't have a workaround for it.For some of these problems, a workaround may not be possible or feasible. Thus, I might have to make documentation warning the user to copy certain header files to the system include path. Or, I might have to warn against adding duplicate modulemap files to a GitHub repo and anything it recursively depends on.
The text was updated successfully, but these errors were encountered: