Clients unable to build project due to unsafe flags. - #6
Conversation
…able by a user. Swift package manager blocks the compilation.
vkuttyp
left a comment
There was a problem hiding this comment.
Good find — the unsafeFlags problem is real. SPM blocks packages with unsafe flags from being used as dependencies, so this needs a proper fix. However, removing the flags without an alternative breaks the build because the compiler can no longer find the FreeTDS headers.
The correct solution is to replace the CSybdb regular target with a systemLibrary target, which uses pkg-config to locate FreeTDS at build time — no hardcoded paths and no unsafeFlags needed. I'll implement this directly on main. Please close this PR and I'll tag a 1.1.0 once the fix is in.
…w's prefix method to search for the headers. Check if this works on linux?
|
That is a good plan, my next commit here is on the right path. But I missed that swift PM does not resolve bash variables. Ill close and await a 1.1 |
|
The fix is now live. Have look. |
|
Hey @FoxClock 👋
Just wanted to follow up on PR #6 — you were absolutely right that the
`unsafeFlags` approach would block anyone trying to use this as an SPM
dependency. That was a real and important issue you caught.
The fix ended up being a combination of your direction and some CI
detective work:
- Switched to a `systemLibrary` + `pkg-config` target (as you suggested)
- Committed a `freetds.pc` file to the repo under `ci/` (since Homebrew
doesn't ship one on macOS)
- Pointed `PKG_CONFIG_PATH` to that folder in the CI workflow
CI is green and the library now works cleanly as an SPM dependency — which
is exactly what you were trying to achieve.
Sorry for asking you to close the PR before we had a proper fix in place.
Your instinct was right from the start. Really appreciate all the
contributions — the casting safety fix, the Intel Mac build fix, the
reachability check, and flagging the `unsafeFlags` problem. The library is
significantly better because of your work. 🙏
…On Sun, Feb 22, 2026 at 2:49 PM ClockFox ***@***.***> wrote:
*FoxClock* left a comment (vkuttyp/SQLClient-Swift#6)
<#6 (comment)>
That is a good plan, my next commit here is on the right path. But I
missed that swift PM does not resolve bash variables.
Ill close and await a 1.1
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDWPRBIYRPXLIC4LWK6RT4NGJV5AVCNFSM6AAAAACV3Z2K62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNBQG43TSNZWGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The inclusion of unsafe flags causes swift's package manager to fail compilation.
It complains of the use of unsafe flags in the build process. The target for building the release version
I have stripped out the unsafe flags in the product.
The Readme should also be amended so that the requirement for
pkg-configis made explicitly known.As it is not shipped on all MacOS versions, at least not the machine this was tested on (macos 26 x86_64)
This does compile with swift build.
I have not stripped the test out. As i could not get that target to compile without the unsafe flags. This should not break the CI pipeline this time.