vibe/scripts/ci/clear-linux-execstack.sh
Guillaume LE GOFF cafb6d4147
v2.15.0 (#773)
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Val <102326092+vdeva@users.noreply.github.com>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-06-12 13:16:04 +02:00

22 lines
596 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <pyinstaller-bundle-dir> [<pyinstaller-bundle-dir> ...]" >&2
exit 2
fi
for bundle_dir in "$@"; do
internal_dir="${bundle_dir}/_internal"
binary_name="$(basename "${bundle_dir}")"
binary_name="${binary_name%-dir}"
binary_path="${bundle_dir}/${binary_name}"
find "${internal_dir}" -name '*.so*' -type f -print0 | while IFS= read -r -d '' library; do
patchelf --clear-execstack "${library}"
done
if [ -f "${binary_path}" ]; then
patchelf --clear-execstack "${binary_path}" || true
fi
done