Add warnings for problematic entry point configurations#2197
Open
Add warnings for problematic entry point configurations#2197
Conversation
- Warn when a noarch:python package contains scripts in bin/ or Scripts/ that are not registered as entry_points. These files get remapped to python-scripts/ instead, but using entry_points in the recipe is the preferred approach for Python executables. - Warn when a prefix path contains spaces, since Linux shebang lines do not support quoted paths and generated entry point scripts may fail to execute at runtime. https://claude.ai/code/session_016bzsHmePT17vDZDkYLtF5M
Instead of warning at the point of file remapping / entry point creation, emit these warnings in print_enhanced_file_listing where all other packaging warnings (symlinks, file size, path issues) are already shown: - noarch:python files placed in python-scripts/ now get an inline per-file annotation in the file listing, consistent with how other path warnings are shown - prefix-with-spaces warning is now emitted (and recorded in the build summary) during the file listing phase rather than during entry point generation https://claude.ai/code/session_016bzsHmePT17vDZDkYLtF5M
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds two warning messages to help users identify potential issues with entry point generation and Python script placement in noarch packages.
Key Changes
create_entry_points()when the prefix path contains spaces, since shebang lines on Linux don't support quoted paths and generated entry point scripts may fail to execute at runtime.file_mapper.rswhen a noarch Python package contains executable scripts that aren't registered as entry points, suggesting users add them to thebuild.python.entry_pointssection of their recipe.Implementation Details
tracing::warn!macro for consistent logginghttps://claude.ai/code/session_016bzsHmePT17vDZDkYLtF5M