Hi again everyone,
I've made some good progress, but I think I've hit a road block, the navigation of which may require some more guidance. Any input anyone could give would be much appreciated.
Following Saleem's advice above, in pursuit of building SwiftGodotKit on Windows, I constructed a library structure like so:
libgodot/
├── bin/
│ └── libgodot.dll
├── lib/
│ └── libgodot.lib
├── pdb/
│ └── libgodot.pdb
└── include/
└── libgot/
├── gdextension_interface.h
└── libgodot.h
└── module.modulemap
... with modulemap:
module libgodot {
header "libgodot/libgodot.h"
export *
}
I provided the libgodot library to SwiftGodotKit package.swift as a .systemLibrary target:
.systemLibrary(
name: "libgodot",
path: "libgodot/include
)
And then invoked swift with arguments:
swift build -Xlinker -I"libgodot/include" -Xlinker -L"libgodot/lib"
Compilation proceeded as follows:
Building for debugging...
Build complete! (0.76s)
warning: unable to create symbolic link at C:\Users\Hugh\Desktop\SwiftGodotKit-main\.build\plugins\debug: Error Domain=NSCocoaErrorDomain Code=256 "(null)"
Building for debugging...
error: compile command failed due to exception 3 (use -v to see invocation)
With the following error output, the "output" body of which I've snipped due to its verbosity:
error: failed parsing the Swift compiler output: unexpected JSON message: {
"exception" : 3,
"kind" : "abnormal-exit",
"name" : "compile",
"output" : "\u001b[1m<unknown>:0: \u001b[0m\u001b[0;1;31merror: \u001b[0m\u001b[1merror opening 'C:\\Users\\Users\\Hugh\\Desktop\\SwiftGodotKit-main\\.build\\plugins\\outputs\\swiftgodot\\SwiftGodot\\CodeGeneratorPlugin\\GeneratedSources\\generated.swiftdeps' for output: no such file or directory\r\n\u001b[0mAssertion failed: loadedGraph.has_value() && \"Should be able to read the exported graph.\", file C:\\Users\\swift-ci\\jenkins\\workspace\\oss-swift-windows-toolchain\\swift\\lib\\AST\\FineGrainedDependencies.cpp, line 237\r\nPlease submit a bug report (https:\/\/swift.org\/contributing\/#reporting-bugs) and include the crash backtrace [ **snip** ],
"pid" : 32024,
"process" : {
"real_pid" : 32024
}
}: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "kind", intValue: nil)], debugDescription: "invalid kind", underlyingError: nil))
My initial impression is that the warning regarding symbolic link creation failure is the proximate cause of the compilation failure, and I intend to investigate that. However, the manner in which swift is crashing here has lead me to post here, as I've found that the swift compiler generally crashes gracefully.
Does anyone have any thoughts about what's happening here, and how I could investigate further?