diff --git a/Libs/checksums.sha256 b/Libs/checksums.sha256 index f9dd53589..af32116db 100644 --- a/Libs/checksums.sha256 +++ b/Libs/checksums.sha256 @@ -50,10 +50,10 @@ b3861975896ebf35255d8c3efccdc59ad39874c9b70fdd710ebd15f0a58c4e10 Libs/libssl_ar 3ca208dedf57dbae4f5cb0a22bfbedeba80dc6740d626484d9d815811d64a2aa Libs/libssl_universal.a 34de647ccd0951095f987591562a5236348bac2d4b3e217877559a7b170cf4e4 Libs/libssl_x86_64.a 3ca208dedf57dbae4f5cb0a22bfbedeba80dc6740d626484d9d815811d64a2aa Libs/libssl.a -38a16ca8a041c1be3ca6d4884f7c5e196d14f60bee80004c8f54a41899c17e0f Libs/libsybdb_arm64.a -071e9853ec4bb1f6a19ed99eb91cfe823e83bad178e1e1997deee414cd0e4dfc Libs/libsybdb_universal.a -e437cf1fab3eaf675bdb5aab4443a891763e5325033ddfe369775bd64a22b57b Libs/libsybdb_x86_64.a -071e9853ec4bb1f6a19ed99eb91cfe823e83bad178e1e1997deee414cd0e4dfc Libs/libsybdb.a +59a2f12204975daf83aaf5a31153131df90eef04b08d9c4998db776def8f3587 Libs/libsybdb_arm64.a +ed77beaf3179508277aab56071a2a9936775b5547096059e9988f21a3530904c Libs/libsybdb_universal.a +86518ee2147417c1719c1921a897ee3688d4c8478576c70d7e47fc71380657f8 Libs/libsybdb_x86_64.a +ed77beaf3179508277aab56071a2a9936775b5547096059e9988f21a3530904c Libs/libsybdb.a beff08628396ffb7c2e23b9f1db08ce92be215fbfd50c6e62088e216d73a0897 Libs/libuv_arm64.a 8f8135b8214cfef035b49486a863f891979efc04d97d75e2bc14cb4e28aed233 Libs/libuv_universal.a 2592a74df696709dcc631e9ad48894763157e9c5a34f0cb6a23a4036bce0c472 Libs/libuv_x86_64.a diff --git a/TablePro.xcodeproj/project.pbxproj b/TablePro.xcodeproj/project.pbxproj index 4fa614a85..c0e5cade0 100644 --- a/TablePro.xcodeproj/project.pbxproj +++ b/TablePro.xcodeproj/project.pbxproj @@ -3591,6 +3591,7 @@ "-liconv", "-framework", "GSS", + "-lcom_err", ); PRODUCT_BUNDLE_IDENTIFIER = com.TablePro.MSSQLDriver; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3632,6 +3633,7 @@ "-liconv", "-framework", "GSS", + "-lcom_err", ); PRODUCT_BUNDLE_IDENTIFIER = com.TablePro.MSSQLDriver; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/scripts/build-freetds.sh b/scripts/build-freetds.sh index a6f4449f2..a760b8aaf 100755 --- a/scripts/build-freetds.sh +++ b/scripts/build-freetds.sh @@ -130,14 +130,34 @@ cp "$LIBS_DIR/libcrypto_x86_64.a" "$MACOS_OPENSSL_X86_64/lib/libcrypto.a" build_slice "macos-arm64" "macosx" "arm64" "aarch64-apple-darwin" "-mmacosx-version-min=${MACOS_DEPLOYMENT_TARGET}" "$MACOS_OPENSSL_ARM64" "--enable-krb5=gssapi_krb5" build_slice "macos-x86_64" "macosx" "x86_64" "x86_64-apple-darwin" "-mmacosx-version-min=${MACOS_DEPLOYMENT_TARGET}" "$MACOS_OPENSSL_X86_64" "--enable-krb5=gssapi_krb5" +# grep without -q so it drains nm's full output. Under `set -o pipefail`, -q would close the pipe +# on the first match, nm would die with SIGPIPE, and the pipeline would report failure for a valid +# library. gssapi.o must define tds_gss_get_auth; an empty stub means Kerberos was not compiled in. for slice in macos-arm64 macos-x86_64; do - if ! nm "$LIBS_DIR/libsybdb_${slice}.a" 2>/dev/null | grep -q 'T _tds_gss_get_auth'; then + if ! nm "$LIBS_DIR/libsybdb_${slice}.a" 2>/dev/null | grep 'T _tds_gss_get_auth' > /dev/null; then echo "ERROR: libsybdb_${slice}.a has no tds_gss_get_auth; Kerberos/GSS was not compiled in." >&2 echo " configure did not define ENABLE_KRB5. Check --enable-krb5=gssapi_krb5 and the SDK gssapi headers." >&2 exit 1 fi done +# Write the macOS committed archives now, before the iOS slices. The macOS plugin library and the +# iOS xcframework are independent products; an iOS build failure must not discard a good macOS build. +echo "==> Creating macOS universal slice..." +lipo -create \ + "$LIBS_DIR/libsybdb_macos-arm64.a" \ + "$LIBS_DIR/libsybdb_macos-x86_64.a" \ + -output "$LIBS_DIR/libsybdb_macos_universal.a" + +# The flat committed archives the macOS plugin links directly (TablePro.xcodeproj force_loads +# Libs/libsybdb.a). The universal slice is kept until the xcframework is assembled, then cleaned up. +# Publish with scripts/publish-libs.sh libsybdb_arm64.a libsybdb_x86_64.a libsybdb_universal.a libsybdb.a +echo "==> Writing committed macOS archives (libsybdb.a, libsybdb_arm64.a, libsybdb_x86_64.a, libsybdb_universal.a)..." +cp "$LIBS_DIR/libsybdb_macos-arm64.a" "$LIBS_DIR/libsybdb_arm64.a" +cp "$LIBS_DIR/libsybdb_macos-x86_64.a" "$LIBS_DIR/libsybdb_x86_64.a" +cp "$LIBS_DIR/libsybdb_macos_universal.a" "$LIBS_DIR/libsybdb_universal.a" +cp "$LIBS_DIR/libsybdb_macos_universal.a" "$LIBS_DIR/libsybdb.a" + # iOS slices link OpenSSL statically from the existing xcframeworks; reconstruct a unix-style prefix # for FreeTDS's --with-openssl which expects include/ and lib/ siblings. IOS_OPENSSL_DEVICE="$(mktemp -d)/openssl-ios-arm64" @@ -154,22 +174,6 @@ cp "$IOS_OPENSSL_CRYPTO_XCFW/ios-arm64-simulator/libcrypto.a" "$IOS_OPENSSL_SIM/ build_slice "ios-arm64" "iphoneos" "arm64" "aarch64-apple-darwin" "-mios-version-min=${IOS_DEPLOYMENT_TARGET}" "$IOS_OPENSSL_DEVICE" build_slice "ios-arm64-simulator" "iphonesimulator" "arm64" "aarch64-apple-darwin" "-mios-simulator-version-min=${IOS_DEPLOYMENT_TARGET}" "$IOS_OPENSSL_SIM" -echo "==> Creating macOS universal slice..." -lipo -create \ - "$LIBS_DIR/libsybdb_macos-arm64.a" \ - "$LIBS_DIR/libsybdb_macos-x86_64.a" \ - -output "$LIBS_DIR/libsybdb_macos_universal.a" - -# Write the flat committed archives the macOS plugin links directly (TablePro.xcodeproj -# force_loads Libs/libsybdb.a). The per-slice intermediates below are deleted after the -# xcframework is assembled, so produce these before that cleanup runs. Publish them with -# scripts/publish-libs.sh libsybdb_arm64.a libsybdb_x86_64.a libsybdb_universal.a libsybdb.a -echo "==> Writing committed macOS archives (libsybdb.a, libsybdb_arm64.a, libsybdb_x86_64.a, libsybdb_universal.a)..." -cp "$LIBS_DIR/libsybdb_macos-arm64.a" "$LIBS_DIR/libsybdb_arm64.a" -cp "$LIBS_DIR/libsybdb_macos-x86_64.a" "$LIBS_DIR/libsybdb_x86_64.a" -cp "$LIBS_DIR/libsybdb_macos_universal.a" "$LIBS_DIR/libsybdb_universal.a" -cp "$LIBS_DIR/libsybdb_macos_universal.a" "$LIBS_DIR/libsybdb.a" - HEADERS_STAGE="$BUILD_DIR/headers-stage" rm -rf "$HEADERS_STAGE" mkdir -p "$HEADERS_STAGE"