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

[internal] refactor Python ASDF support into a non-tool-specific rule #16202

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Jul 17, 2022

Refactor Python ASDF into a non-tool-specific rule in anticipation of adding golang support.

[ci skip-rust]

[ci skip-build-wheels]

@tdyas tdyas added the category:internal CI, fixes for not-yet-released features, etc. label Jul 17, 2022
@tdyas tdyas requested review from stuhood and Eric-Arellano July 17, 2022 04:34
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

Comment on lines 166 to 172
@rule
async def resolve_asdf_tool_paths(
request: AsdfToolPathsRequest, build_root: BuildRoot
) -> AsdfToolPathsResult:
Copy link
Member

Choose a reason for hiding this comment

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

Given the direct HOME and path access in the @rule_helper, can you mark this @_uncacheable_rule? I think that it's been a longstanding issue that ASDF edits won't invalidate correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there those path checks could use PathGlobs or an equivalent? I tried using PathGlobs in an earlier iteration of this PR to read .tool-versions, but the default --pants-ignore option ignores dot files in the build root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Any fix to be able to use PathGlobs would be for the future, not this PR.)

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it would be possible to use PathGlobs for this, because some of these file paths are absolute (in $HOME). But labeling with a TODO that mentions #10842 would be good probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I had only tried it for the $BUILD_ROOT/.tool-versions path. Will do on TODO.

Tom Dyas added 2 commits July 19, 2022 22:00
[ci skip-rust]

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

[ci skip-build-wheels]
@tdyas tdyas force-pushed the asdf_refactor_into_nonspecific_rule branch from d5988d3 to e87c9b8 Compare July 20, 2022 02:04
@tdyas tdyas merged commit 1ecca3e into pantsbuild:main Jul 20, 2022
@tdyas tdyas deleted the asdf_refactor_into_nonspecific_rule branch July 20, 2022 13:58
@stuhood stuhood mentioned this pull request Jul 22, 2022
jyggen pushed a commit to jyggen/pants that referenced this pull request Jul 27, 2022
…pantsbuild#16202)

Refactor Python ASDF into a non-tool-specific rule in anticipation of adding golang support.

[ci skip-rust]

[ci skip-build-wheels]
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