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

Split fromfile support into its own submodule #20807

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented Apr 18, 2024

Background: Option @fromfile paths are intended to be relative
to the buildroot, not the cwd. This will require us to plumb
buildroot information through in several places.

This change is prep work for that change, and is straightforward
and technical, despite the diff stats: It just splits fromfile support
out into its own submodule. This will make the subsequent changes
easier to grok.

The new fromfile.rs and fromfile_tests.rs contain code moved
from parser.rs and parser_tests.rs, with no functionality changes.
The other diffs are just import changes.

@benjyw benjyw added the category:internal CI, fixes for not-yet-released features, etc. label Apr 18, 2024
@benjyw benjyw requested review from huonw and tgolsson April 18, 2024 04:30
@benjyw benjyw merged commit 5944b04 into pantsbuild:main Apr 18, 2024
24 checks passed
@benjyw benjyw deleted the refactor_fromfile_support branch April 18, 2024 15:11
benjyw added a commit that referenced this pull request Apr 18, 2024
As with #20807, this is another preliminary change to support
fromfile paths being relative to the buildroot. 

This change introduces a FromfileExpander struct, and moves
the expansion logic from free functions to struct methods. 
The free functions are then reimplemented as calls into 
these methods, to avoid perturbing calling code.

A followup change will plumb instances of this struct
wherever needed, and remove the free functions.

Another followup change will introduce the buildroot
context to this struct, to finally achieve the underlying
functionality change.

This change is just a refactoring, to make the subsequent
changes easier to grok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants