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

Stop using AddressWithOrigin for precise file arguments #10551

Merged
merged 4 commits into from Aug 4, 2020

Conversation

Eric-Arellano
Copy link
Contributor

We used to achieve precise file arguments—where you only run on the file you specified—via AddressWithOrigin et al., including the SpecifiedSourceFiles type.

Now that we always use a generated subtarget when a user gives us file args, we know that the target will always have exactly one source file, so we can simply run on the entire target's sources without needing to consider taking a subset of its sources.

This allows us to remove SpecifiedSourceFiles, along with storing which files were actually resolved on the FilesystemSpec. We also simplify test, lint, and fmt to stop using WithOrigin, as none of the downstream rules need that information anymore.

We still keep around WithOrigin for the sake of errors, such as allowing us to error if a user specifies a literal file arg and it does not meet an invariant, but to no-op if they specified a looser glob.

# 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]
There may be some cases where downstream rules actually want this. We decided to leave a TODO to allow you to back from `Address -> AddressWithOrigin`. For now, it's not possible.

# 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]
# 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]
# 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]
@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 1ed7df3 on Eric-Arellano:with-origin into 0e1c8de on pantsbuild:master.

Copy link
Sponsor 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.

Yay! Loved the changes in determine_source_files.py.

@Eric-Arellano Eric-Arellano merged commit 1a00c52 into pantsbuild:master Aug 4, 2020
@Eric-Arellano Eric-Arellano deleted the with-origin branch August 4, 2020 23:29
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.

None yet

3 participants