From 3cfbbbc938eada5c69d67c84fadbb6b044662258 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 10 Feb 2026 12:14:22 +0000 Subject: [PATCH 1/2] 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. --- python/scripts/build-wheels.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/scripts/build-wheels.mjs b/python/scripts/build-wheels.mjs index 5dac70254..b380c54b7 100644 --- a/python/scripts/build-wheels.mjs +++ b/python/scripts/build-wheels.mjs @@ -240,6 +240,7 @@ async function repackWheelWithPlatform(srcWheel, destWheel, platformTag) { import sys import zipfile import tempfile +import os from pathlib import Path src_wheel = Path(sys.argv[1]) @@ -253,6 +254,11 @@ with tempfile.TemporaryDirectory() as tmpdir: with zipfile.ZipFile(src_wheel, 'r') as zf: zf.extractall(tmpdir) + # Restore executable bit on the CLI binary (setuptools strips it) + for bin_path in (tmpdir / 'copilot' / 'bin').iterdir(): + if bin_path.name in ('copilot', 'copilot.exe'): + bin_path.chmod(0o755) + # Find and update WHEEL file wheel_info_dirs = list(tmpdir.glob('*.dist-info')) if not wheel_info_dirs: From 6ccd9ac7c3ca7c5018e1c5b191f986367a16987b Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 10 Feb 2026 12:29:40 +0000 Subject: [PATCH 2/2] Update python/scripts/build-wheels.mjs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- python/scripts/build-wheels.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/python/scripts/build-wheels.mjs b/python/scripts/build-wheels.mjs index b380c54b7..7d8104083 100644 --- a/python/scripts/build-wheels.mjs +++ b/python/scripts/build-wheels.mjs @@ -240,7 +240,6 @@ async function repackWheelWithPlatform(srcWheel, destWheel, platformTag) { import sys import zipfile import tempfile -import os from pathlib import Path src_wheel = Path(sys.argv[1])