You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
j-luong
changed the title
chore: update install-snyk script to allow filename overrides
chore: update install-snyk script to allow os and arch overrides
May 11, 2026
Providing an unsupported string to --os or --arch (e.g., --arch powerpc) will bypass the detection safeguards but fail to match any condition in get_filename (see context). This results in filename being an empty string. The code then attempts to open this path for writing at with open(downloaded_file_path, "wb"), which will raise a FileNotFoundError or IsADirectoryError and crash the script.
The PR description and manual testing instructions explicitly state that a --filename flag was added to override the download target. However, the implementation adds --os and --arch flags instead. A user following the PR's own testing instructions will encounter an 'unrecognized arguments' error.
parser.add_argument(
"--arch", help="Explicitly specify the architecture to download", default=None
)
parser.add_argument(
"--os", help="Explicitly specify the OS to download", default=None
)
The get_filename function (visible in context) uses os.path.exists to check for the presence of musl-libc on the host filesystem to decide between 'linux' and 'alpine' binaries. Even with the new overrides, a user on a glibc-based host cannot force the download of an Alpine binary (or vice versa), which limits the script's utility for the cross-platform container image builds mentioned in the PR description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
This PR updates the
install-snyk.pyscript so that callers can provide an override the automatically detected OS and Architecture.This change is meant to support cross compilation or other scenarios where the host os and arch are not the target ones.
How should this be manually tested?
on a mac, run
python scripts/install-snyk.py 1.1304.2 --os linux --arch amr64What's the product update that needs to be communicated to CLI users?
None, this is an internal change
Risk assessment - Low?
Low, as these a pure overrides for special cases