Skip to content

Swift Static Build #2

@mredig

Description

@mredig

There doesn't appear to be compatibility with building with static linking on linux. I assume this might have something to do with the static linking sdk's use of musl.

Anyways, the project builds perfectly fine with swift build and swift build -c release. However, after installing the static linking sdk and running swift build -c release --swift-sdk aarch64-swift-linux-musl I get the following:

root@74397c1150f2:~/Lighter# swift build -c release --swift-sdk aarch64-swift-linux-musl
Building for production...
<module-includes>:1:10: note: in file included from <module-includes>:1:
1 | #include "shim.h"
  |          `- note: in file included from <module-includes>:1:
2 |

/root/Lighter/Sources/SQLite3-Linux/shim.h:1:10: error: 'sqlite3.h' file not found
1 | #include <sqlite3.h>
  |          `- error: 'sqlite3.h' file not found
2 |

/root/Lighter/Sources/SQLite3Schema/CatalogObject.swift:89:8: error: could not build C module 'SQLite3'
 87 | // MARK: - Fetching
 88 |
 89 | import SQLite3
    |        `- error: could not build C module 'SQLite3'
 90 |
 91 | public extension Schema.CatalogObject {
<module-includes>:1:10: note: in file included from <module-includes>:1:
1 | #include "shim.h"
  |          `- note: in file included from <module-includes>:1:
2 |

/root/Lighter/Sources/SQLite3-Linux/shim.h:1:10: error: 'sqlite3.h' file not found
1 | #include <sqlite3.h>
  |          `- error: 'sqlite3.h' file not found
2 |

I'd post a PR, but I really don't know much about the difference between musl and glibc and if my hunch is even in the right direction.

I'm just going to use another package. I wish I could use this one, but alas, it doesn't appear to be destined. Anyways, I just wanted to let you know in case that's something you'd want to address in the future. I'll understand if it's just not on the roadmap :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions