-
Notifications
You must be signed in to change notification settings - Fork 14
Disable the shorten-64-to-32
warning in Package.swift
#14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Without this flag, we get about 40 warnings when building `swift-lmdb` in Xcode. I don’t think there is an immediate plan to address them in upstream lmdb, so let’s disable them.
@@ -26,6 +26,7 @@ let package = Package( | |||
// Windows does not use POSIX mutex | |||
.when(platforms: [.linux, .macOS])), | |||
.define("MDB_USE_ROBUST", to: "0"), | |||
.unsafeFlags(["-Wno-shorten-64-to-32"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the unsafeFlags(_:_:)
documentation correctly, this change would prevent other packages from using the CLMDB library product:
As some build flags can be exploited for unsupported or malicious behavior, the use of unsafe flags makes the products containing this target ineligible for use by other packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this will prevent other packages from using the only product in this package.
Please verify that other packages can still use the CLMDB library product with this change.
People won’t be able to depend on swift-lmdb with a version-based dependency but swift-lmdb doesn’t have any versioned releases, so this should be fine. Toolchain builds passed in swiftlang/swift#37710 and I am able to have a branch-based dependency on swift-lmdb with this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for verifying that other packages can continue to use the CLMDB library product with this change. That addresses my concerns.
This is actually very confusing actually. LMDB does have versioning, but Github copy is only a a mirror and those tags are lagging behind the self hosted Gitlab where development is being done: https://git.openldap.org/openldap/openldap/-/tags?sort=updated_desc&search=lmdb_ , which also has CHANGES. The Swift package doesn't have versioning which follows LMDB, but only follows Swift toolchain versioning. |
Without this flag, we get about 40 warnings when building
swift-lmdb
in Xcode. I don’t think there is an immediate plan to address them in upstream lmdb, so let’s disable them.