Skip to content

Commit 4dc5629

Browse files
fix: set executable permission on CLI binary in Python wheel (#419)
* fix: set executable permission on CLI binary in Python wheel The repack step in build-wheels.mjs was producing wheels where copilot/bin/copilot had 0o644 (-rw-r--r--) permissions because setuptools strips the executable bit when building package data. After extracting the wheel for repack, restore chmod 0o755 on the CLI binary so that zf.write() captures the correct permissions. This ensures pip/uv install the binary as executable on Unix. * Update python/scripts/build-wheels.mjs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b904431 commit 4dc5629

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/scripts/build-wheels.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ with tempfile.TemporaryDirectory() as tmpdir:
253253
with zipfile.ZipFile(src_wheel, 'r') as zf:
254254
zf.extractall(tmpdir)
255255
256+
# Restore executable bit on the CLI binary (setuptools strips it)
257+
for bin_path in (tmpdir / 'copilot' / 'bin').iterdir():
258+
if bin_path.name in ('copilot', 'copilot.exe'):
259+
bin_path.chmod(0o755)
260+
256261
# Find and update WHEEL file
257262
wheel_info_dirs = list(tmpdir.glob('*.dist-info'))
258263
if not wheel_info_dirs:

0 commit comments

Comments
 (0)