Skip to content

fix: Arrow extraction on Windows without admin privileges#179

Merged
timosachsenberg merged 1 commit intomasterfrom
fix/arrow-windows-symlink-extraction
Mar 25, 2026
Merged

fix: Arrow extraction on Windows without admin privileges#179
timosachsenberg merged 1 commit intomasterfrom
fix/arrow-windows-symlink-extraction

Conversation

@timosachsenberg
Copy link
Contributor

@timosachsenberg timosachsenberg commented Mar 25, 2026

Summary

  • Arrow 23.0.0's archive contains symbolic links (e.g., python/cmake_modules -> ../cpp/cmake_modules) that 7-Zip cannot create on Windows without admin privileges, causing extraction to fail
  • Replaces 7-Zip with cmake -E tar for Arrow extraction on Windows, which handles symlinks gracefully by copying target content instead of creating actual symlinks
  • Linux/macOS extraction is unchanged

Test plan

  • Build contrib on Windows without elevated (admin) command prompt — Arrow extraction should succeed
  • Build contrib on Windows with elevated command prompt — should still work
  • Build contrib on Linux/macOS — no change in behavior

Fixes #177

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Streamlined the Arrow library extraction process during build configuration on Windows and other platforms. Improvements include enhanced error detection with detailed reporting, intelligent validation to skip redundant extraction when components already exist, and more robust build validation for increased reliability and transparency.

…rrors

Arrow 23.0.0's archive contains symbolic links (e.g., python/cmake_modules
-> ../cpp/cmake_modules). 7-Zip cannot create symlinks on Windows without
admin privileges, causing extraction to fail for non-elevated users.

Replace 7-Zip with cmake -E tar for Arrow extraction on Windows, which
handles symlinks gracefully by copying target content instead of creating
actual symlinks.

Fixes #177

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

The ARROW contrib extraction on Windows/MSVC is refactored from 7-Zip-based extraction with symlink-unsafe flags to CMake's tar extraction with explicit error handling and skip-if-exists logic. Non-MSVC platforms now use the original extraction method in an else branch.

Changes

Cohort / File(s) Summary
ARROW Extraction Platform-Specific Flow
libraries.cmake/arrow.cmake
Windows/MSVC now downloads and extracts ARROW using execute_process with CMake tar commands, includes extraction skip logic if CMakeLists.txt exists, and captures/reports errors. Non-MSVC extraction moved to else branch using OPENMS_SMARTEXTRACT. Resolves symlink privilege errors from 7-Zip's -snld20 flags.

Possibly related PRs

Poem

🐰 A rabbit hops 'cross Windows plains,
No symlinks breaking, no permission pains,
With CMake's tar, the archives align,
ARROW extracts now, oh sublime!
The build system cheers!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing 7-Zip extraction with cmake -E tar on Windows to handle symlinks without admin privileges.
Linked Issues check ✅ Passed The pull request directly addresses issue #177 by replacing 7-Zip extraction with cmake -E tar on Windows, enabling Arrow extraction without admin privileges as required.
Out of Scope Changes check ✅ Passed All changes are scoped to Arrow extraction logic on Windows; non-MSVC platforms use the existing OPENMS_SMARTEXTRACT unchanged. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/arrow-windows-symlink-extraction

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
libraries.cmake/arrow.cmake (2)

13-13: Minor: Checkfile differs between platforms.

The MSVC path checks for CMakeLists.txt while the non-MSVC path (line 35) uses README as the checkfile. This works since both files exist after extraction, but for consistency, you could use the same file on both paths.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libraries.cmake/arrow.cmake` at line 13, The check for extraction success
uses different marker files per platform: the MSVC branch checks for
${ARROW_DIR}/CMakeLists.txt while the non-MSVC branch checks for
${ARROW_DIR}/README; make them consistent by using the same checkfile in both
branches (e.g., use ${ARROW_DIR}/CMakeLists.txt or ${ARROW_DIR}/README) so the
existence test in arrow.cmake is identical for both paths and references the
same symbol ARROW_DIR.

16-29: Missing log file output for extraction.

The rest of the Arrow build process writes output to ${LOGFILE} (e.g., lines 81-82, 98-99), and the OPENMS_SMARTEXTRACT macro also logs extraction output. The new MSVC extraction path doesn't log ZIP_OUT/ZIP_ERR to the logfile, which could make debugging extraction issues harder.

♻️ Proposed fix to add logging
     if(NOT EXTRACT_SUCCESS EQUAL 0)
       message(STATUS "Extracting ARROW .. failed")
       message(STATUS "${ZIP_ERR}")
       message(FATAL_ERROR "${ZIP_OUT}")
     else()
+      # output to logfile
+      file(APPEND ${LOGFILE} ${ZIP_OUT})
+      file(APPEND ${LOGFILE} ${ZIP_ERR})
       message(STATUS "Extracting ARROW .. done")
     endif()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libraries.cmake/arrow.cmake` around lines 16 - 29, The ARROW extraction block
using execute_process (variables ZIP_OUT, ZIP_ERR, RESULT_VARIABLE
EXTRACT_SUCCESS) doesn't write its output to ${LOGFILE}; update the block so
extraction stdout/stderr are recorded to the same logfile used elsewhere
(matching OPENMS_SMARTEXTRACT behavior). For example, either set execute_process
to use OUTPUT_FILE and ERROR_FILE pointing at ${LOGFILE} (or append
ZIP_OUT/ZIP_ERR into ${LOGFILE} with file(APPEND ${LOGFILE} "...\\n")) and
ensure both success and failure branches write ZIP_OUT and ZIP_ERR into
${LOGFILE} alongside the current message() calls so MSVC and non-MSVC extraction
paths produce consistent logs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@libraries.cmake/arrow.cmake`:
- Line 13: The check for extraction success uses different marker files per
platform: the MSVC branch checks for ${ARROW_DIR}/CMakeLists.txt while the
non-MSVC branch checks for ${ARROW_DIR}/README; make them consistent by using
the same checkfile in both branches (e.g., use ${ARROW_DIR}/CMakeLists.txt or
${ARROW_DIR}/README) so the existence test in arrow.cmake is identical for both
paths and references the same symbol ARROW_DIR.
- Around line 16-29: The ARROW extraction block using execute_process (variables
ZIP_OUT, ZIP_ERR, RESULT_VARIABLE EXTRACT_SUCCESS) doesn't write its output to
${LOGFILE}; update the block so extraction stdout/stderr are recorded to the
same logfile used elsewhere (matching OPENMS_SMARTEXTRACT behavior). For
example, either set execute_process to use OUTPUT_FILE and ERROR_FILE pointing
at ${LOGFILE} (or append ZIP_OUT/ZIP_ERR into ${LOGFILE} with file(APPEND
${LOGFILE} "...\\n")) and ensure both success and failure branches write ZIP_OUT
and ZIP_ERR into ${LOGFILE} alongside the current message() calls so MSVC and
non-MSVC extraction paths produce consistent logs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e54388ba-d4ab-44f7-99b2-8124b3757c92

📥 Commits

Reviewing files that changed from the base of the PR and between 186aacf and 4329b47.

📒 Files selected for processing (1)
  • libraries.cmake/arrow.cmake

@timosachsenberg timosachsenberg merged commit 88e058a into master Mar 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARROW cannot be extracted on Windows

1 participant