fix(extension): disable symlinks on Windows during git clone to fix install failure#2286
fix(extension): disable symlinks on Windows during git clone to fix install failure#2286LaZzyMan wants to merge 1 commit intoQwenLM:mainfrom
Conversation
On Windows, non-administrator users do not have permission to create symlinks by default. Using core.symlinks=true during git clone causes checkout to fail with 'Permission denied' errors when the repository contains symlinks. This fix dynamically sets core.symlinks based on the current platform: - win32: core.symlinks=false (avoids permission errors) - other platforms: core.symlinks=true (preserves existing behavior) Fixes QwenLM#2243
📋 Review SummaryThis PR addresses a critical Windows-specific issue where extension installation fails due to symlink permission errors during git clone. The fix dynamically sets 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
TLDR
Fix extension installation failure on Windows caused by
Permission deniederrors when git tries to create symlinks during checkout. On Windows, non-administrator users cannot create symlinks by default. This PR dynamically setscore.symlinksbased on the current platform duringgit clone.Dive Deeper
When installing an extension via
/extensions install <url>, thecloneFromGitfunction was hardcoding-c core.symlinks=truein the git clone command. On Windows, creating symlinks requires theSeCreateSymbolicLinkPrivilegeprivilege, which is not granted to standard users by default.This caused the following error on Windows:
Fix: Detect the current platform using
os.platform()and setcore.symlinksaccordingly:win32→core.symlinks=false(avoids symlink permission errors)core.symlinks=true(preserves existing behavior)The tradeoff is that symlinks in the repository will be materialized as regular files/directories on Windows, which is acceptable since extension installation does not depend on symlinks for functionality.
Reviewer Test Plan
On Windows (as a standard non-admin user), run:
Verify the extension installs successfully without
Permission deniederrors.On macOS/Linux, run the same command and verify existing behavior is unchanged.
Run the unit tests:
All 30 tests should pass.
Testing Matrix
Linked issues / bugs
Fixes #2243