Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source root stripping to not strip requirements.txt files in plugins #11712

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

Eric-Arellano
Copy link
Contributor

The PythonRequirementsFileSources is like a files() target in that its source roots should not be stripped. However, in #9640, we "fixed" it to not subclass FilesSources because this was causing lots of issues with the file being unintentionally included in chroots. Yet, as a result, using await Get(StrippedSourceFiles) will try to strip the file, unless the plugin author uses for_sources_type and leaves off the type in the allowlist.

This PR allows us to properly handle both use cases by generifying the mechanism for "unrooted sources". Now, any Sources subclass can express whether it uses source roots, i.e. it's no longer hardcoded to FilesSources.

[ci skip-rust]
[ci skip-build-wheels]

…ugins

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Contributor

@benjyw benjyw left a comment

Choose a reason for hiding this comment

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

Neat solution!

@Eric-Arellano
Copy link
Contributor Author

Neat solution!

Right back at you, excellent modeling with StrippedSourceFiles to make this so pluggable! I love it when things like this Just Work.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano merged commit 305d62f into pantsbuild:master Mar 17, 2021
@Eric-Arellano Eric-Arellano deleted the files-ignore branch March 17, 2021 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants