Skip to content

feat: scan source distributions for compiled code#947

Open
tiran wants to merge 1 commit intopython-wheel-build:mainfrom
tiran:scan-compiled
Open

feat: scan source distributions for compiled code#947
tiran wants to merge 1 commit intopython-wheel-build:mainfrom
tiran:scan-compiled

Conversation

@tiran
Copy link
Collaborator

@tiran tiran commented Mar 3, 2026

The new helper function scan_compiled_extensions scans source distributions for compiled code. It detects common extensions like .so and .dylib as well as files with certain headers.

The function is designed to detect packaging issues like sdists with pre-compiled code. It is incapable of detecting supply chain attacks and malicious code.

@LalatenduMohanty
Copy link
Member

@tiran #963 has merged, we should rebase this PR.

@tiran tiran marked this pull request as ready for review March 19, 2026 05:39
@tiran tiran requested a review from a team as a code owner March 19, 2026 05:39
)
issues.append(filepath)
elif suffix not in ignore_suffixes:
with filepath.open("rb") as f:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should put open() in a try/except for OSError to be resilient

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help me out. Under what condition can this call fail?

The new helper function `scan_compiled_extensions` scans source
distributions for compiled code. It detects common extensions like `.so`
and `.dylib` as well as files with certain headers.

The function is designed to detect packaging issues like sdists with
pre-compiled code. It is incapable of detecting supply chain attacks and
malicious code.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants