You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alinaliBQ (via GitHub)" <gi...@apache.org> on 2026/10/05 19:07:45 UTC

[PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

alinaliBQ opened a new pull request, #51765:
URL: https://github.com/apache/arrow/pull/51765

   ### Rationale for this change
   
   https://github.com/apache/arrow/issues/51614 
   
   ### What changes are included in this PR?
   
   - Output universal .pkg installer that work on both ARM and AMD. 
   - Add CI step to verify installation by the universal pkg installer.
   
   ### Are these changes tested?
   
   Tested in CI. I tested the universal .pkg installer on my Intel Mac machine. 
   
   ### Are there any user-facing changes?
   No. 
   
   Developers can use the universal macOS .pkg installer titled `flight-sql-odbc-pkg-installer-universal` from the CI.
   
   ### Was AI used for this PR?
   
   In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR.
   
   **PR code and description written by:**
   
   - [x] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4263632838


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer

Review Comment:
   fixed



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "xborder (via GitHub)" <gi...@apache.org>.
xborder commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4229160117


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,101 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          dylib_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"

Review Comment:
   codex pointed me to an issue here:
   >  lipo replaces the unversioned symlink, leaving the versioned dylib ARM-only. Intel clients linking against its versioned install name then fail with “incompatible architecture.” The verification should check the versioned target too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6180062733

   Yup, I have worked on the `lipo` comment and reverted back to checking 1 arch at a time


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4273733465


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   Based on https://github.com/flutter/flutter/pull/188625#issuecomment-4810015666, looks like a regression in the v27 XCode/CLT based. Since we don't want this job to break when we upgrade runners to macos-27, I think it's safer just to use what you had before (testing one arch at a time) and add a comment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba merged PR #51765:
URL: https://github.com/apache/arrow/pull/51765


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6043794620

   Thanks @alinaliBQ, I'll review this week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6173638155

   Thanks @alinaliBQ. I had just one more comment about the lipo thing, otherwise this looks good. @raulcd would you like to review too?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4234815379


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,101 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          dylib_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"

Review Comment:
   @xborder I tested the new installer on my M5 and the ODBC works locally. Now the installed directory looks like:
   ```
   -rw-r--r--  1 admin  staff   101M Oct  9 14:38:50 2026 libarrow_flight_sql_odbc.2600.0.0.dylib
   lrwxr-xr-x  1 admin  staff    39B Oct  9 14:43:22 2026 libarrow_flight_sql_odbc.2600.dylib -> libarrow_flight_sql_odbc.2600.0.0.dylib
   lrwxr-xr-x  1 admin  staff    35B Oct  9 14:43:22 2026 libarrow_flight_sql_odbc.dylib -> libarrow_flight_sql_odbc.2600.dylib
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4235545253


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14

Review Comment:
   Do we have a reason to use such an old macOS runner?



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer

Review Comment:
   ```suggestion
       name: Create ODBC universal macOS installer
   ```



##########
.github/workflows/cpp_extra.yml:
##########
@@ -672,6 +672,13 @@ jobs:
           name: flight-sql-odbc-pkg-installer-${{ matrix.architecture }}
           path: build/cpp/ArrowFlightSQLODBC-*.pkg
           if-no-files-found: error
+      - name: Upload Intel ODBC dylib to the job

Review Comment:
   Just for consistency
   
   ```suggestion
         - name: Upload AMD64 ODBC dylib to the job
   ```



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   Can this be simplified? A comment wouldn't be a bad call either.
   
   ```suggestion
             for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
               echo "Checking ${lib}"
               lipo -verify_arch arm64 x86_64 "${lib}"
             done
   ```



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'

Review Comment:
   Can we remove this? My agent review caught it. Apparently GitHub documents the `needs` context is only including outputs from jobs in the `needs` directive but apparently what you've done here works even if it's not documented. I worry maybe it would change at some point.
   
   Can both these jobs just depend on `odbc-macos` and get us the same effect?



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"

Review Comment:
   Why this version not newer?



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"
+          - architecture: ARM64
+            macos-version: "14"

Review Comment:
   Why this version not newer?



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"
+          - architecture: ARM64
+            macos-version: "14"
+    steps:
+      - name: Download universal PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+      - name: Install ODBC PKG
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls ArrowFlightSQLODBC-*.pkg)"
+          sudo installer -pkg "${pkg_path}" -target / -verbose
+      - name: Check ODBC dylib installation
+        run: |
+          set -euo pipefail
+
+          dylib="/Library/ODBC/arrow-odbc/lib/libarrow_flight_sql_odbc.dylib"
+
+          if [ ! -f "${dylib}" ]; then
+            echo "ODBC dylib not found at ${dylib}"
+            exit 1
+          fi
+          echo "Found ODBC dylib: ${dylib}"
+
+          local_arch="$(uname -m)"
+          echo "Local architecture: ${local_arch}"
+          for lib in /Library/ODBC/arrow-odbc/lib/libarrow_flight_sql_odbc*.dylib; do
+            archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${archs}"
+            if ! grep -qw "${local_arch}" <<< "${archs}"; then
+              echo "${lib} does not support local architecture '${local_arch}' (got: ${archs})"
+              exit 1
+            fi
+          done

Review Comment:
   Testing that the .pkg installs on both platforms is good, the remainder of the check is basically re-asserting what we already asserted in the previous step. At the least we could simplify this similar to my comment above (just check that the dylib supports both arches).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6002249410

   Hi @kou @lidavidm @amoeba this PR is ready for review. The ODBC CIs [passed](https://github.com/Bit-Quill/arrow/actions/runs/36493089505) in the fork repo so I think a re-run will likely fix the issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4273494827


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   I made a mistake here, I guess that's not how you call `lipo`. This fails,
   
   ```
   $ lipo $LIB -verify_arch arm64 x86_86
   lipo: -verify_arch requires exactly one input file
   ```
   
   so I think what you had is fine.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6205629758

   Thanks @alinaliBQ


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4234526379


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,101 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          dylib_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"

Review Comment:
   Yes good find. The realpath should be changed instead of symlink. I have pushed the changes for your comment and will comment once I test the produced artifact locally. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4263634747


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer

Review Comment:
   fixed



##########
.github/workflows/cpp_extra.yml:
##########
@@ -672,6 +672,13 @@ jobs:
           name: flight-sql-odbc-pkg-installer-${{ matrix.architecture }}
           path: build/cpp/ArrowFlightSQLODBC-*.pkg
           if-no-files-found: error
+      - name: Upload Intel ODBC dylib to the job

Review Comment:
   done



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14

Review Comment:
   Originally the workflows used older runners so I reused the pattern. I bumped to use `macos-26` mirroring the changes at https://github.com/apache/arrow/issues/51402. 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"
+          - architecture: ARM64
+            macos-version: "14"

Review Comment:
   set to ver 26



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'

Review Comment:
   yes they can. Removed the `if: needs` check



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"
+          - architecture: ARM64
+            macos-version: "14"
+    steps:
+      - name: Download universal PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+      - name: Install ODBC PKG
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls ArrowFlightSQLODBC-*.pkg)"
+          sudo installer -pkg "${pkg_path}" -target / -verbose
+      - name: Check ODBC dylib installation
+        run: |
+          set -euo pipefail
+
+          dylib="/Library/ODBC/arrow-odbc/lib/libarrow_flight_sql_odbc.dylib"
+
+          if [ ! -f "${dylib}" ]; then
+            echo "ODBC dylib not found at ${dylib}"
+            exit 1
+          fi
+          echo "Found ODBC dylib: ${dylib}"
+
+          local_arch="$(uname -m)"
+          echo "Local architecture: ${local_arch}"
+          for lib in /Library/ODBC/arrow-odbc/lib/libarrow_flight_sql_odbc*.dylib; do
+            archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${archs}"
+            if ! grep -qw "${local_arch}" <<< "${archs}"; then
+              echo "${lib} does not support local architecture '${local_arch}' (got: ${archs})"
+              exit 1
+            fi
+          done

Review Comment:
   simplified the step for verifying archs. 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   added suggestion and a comment 🙂 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done
+
+          pkgutil --flatten-full expanded "${pkg_name}.pkg"
+      - name: Upload universal ODBC PKG
+        uses: actions/upload-artifact@v7
+        with:
+          name: flight-sql-odbc-pkg-installer-universal
+          path: ArrowFlightSQLODBC-*.pkg
+          if-no-files-found: error
+
+  odbc-macos-universal-verify:
+    needs: odbc-macos-universal
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal installer verify ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
+    runs-on: macos-${{ matrix.macos-version }}
+    timeout-minutes: 30
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - architecture: AMD64
+            macos-version: "15-intel"

Review Comment:
   set to ver 26



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4277025169


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   Reverted back to check one arch at a time. 
   I tried the `lipo` command with more than 1 arch on local machine and also failed on mac 27. 
   Added comments:
   ```
             # Verify every dylib (including the symlinks) is universal before re-packaging.
             # Check one architecture at a time with `lipo -archs`, 
             # as macOS 27 support only one architecture search at a time.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #51765:
URL: https://github.com/apache/arrow/pull/51765#discussion_r4273643815


##########
.github/workflows/cpp_extra.yml:
##########
@@ -686,6 +693,112 @@ jobs:
           sudo chown -R $USER /Library/ODBC
           ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
 
+  odbc-macos-universal:
+    needs: odbc-macos
+    if: needs.check-enabled.outputs.is_enabled == 'true'
+    name: ODBC universal macOS installer
+    runs-on: macos-14
+    timeout-minutes: 30
+    steps:
+      - name: Download ARM64 PKG
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-pkg-installer-ARM64
+          path: arm64-pkg
+      - name: Download AMD64 dylib
+        uses: actions/download-artifact@v8
+        with:
+          name: flight-sql-odbc-dylib-AMD64
+          path: amd64-dylib
+      - name: Build universal macOS installer
+        run: |
+          set -euo pipefail
+
+          pkg_path="$(ls arm64-pkg/ArrowFlightSQLODBC-*.pkg)"
+          pkg_name="$(basename "${pkg_path}" .pkg)"
+
+          # Use the ARM64 .pkg and swap in a universal ODBC dylib
+          # that works on ARM64 and AMD64.
+          pkgutil --expand-full "${pkg_path}" expanded
+
+          # The unversioned name libarrow_flight_sql_odbc.dylib is a symlink 
+          # to the versioned dylib that the
+          # install name (@rpath/libarrow_flight_sql_odbc.<SOVERSION>.dylib)
+          # resolves to. Run lipo on the real file so the symlinks stay intact.
+          symlink_path="$(find expanded -name libarrow_flight_sql_odbc.dylib)"
+          lib_dir="$(dirname "${symlink_path}")"
+          dylib_path="$(realpath "${symlink_path}")"
+          echo "Merging into ${dylib_path} (via ${symlink_path})"
+          lipo -create "${dylib_path}" amd64-dylib/libarrow_flight_sql_odbc.dylib \
+            -output "${dylib_path}"
+          
+          for lib in "${lib_dir}"/libarrow_flight_sql_odbc*.dylib; do
+            dylib_archs="$(lipo -archs "${lib}")"
+            echo "${lib}: ${dylib_archs}"
+            for arch in arm64 x86_64; do
+              if ! grep -qw "${arch}" <<< "${dylib_archs}"; then
+                echo "${lib} is missing '${arch}' (got: ${dylib_archs})"
+                exit 1
+              fi
+            done
+          done

Review Comment:
   Hrm... But this works fine on CI (older CLT). Let me see if I can figure out what's up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-51614: [C++][FlightRPC] Universal macOS PKG Installer [arrow]

Posted by "alinaliBQ (via GitHub)" <gi...@apache.org>.
alinaliBQ commented on PR #51765:
URL: https://github.com/apache/arrow/pull/51765#issuecomment-6087794676

   > A recent mailing list [discussion](https://lists.apache.org/thread/l3vmknbjhwf60crrfp3hwb7p5m4qjw7z) proposed dropping macos intel support. Does it make sense to create an installer for Intel?
   
   Thanks for raising this @xborder, I think if we could make the release for Intel installer before the Intel support is officially dropped, users could at least have 1 version that they can use. 
   And when Intel support is officially dropped, the workflow that creates Intel installer can be removed. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org