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: venv should require exec toolchain #194

Closed
wants to merge 1 commit into from
Closed

fix: venv should require exec toolchain #194

wants to merge 1 commit into from

Conversation

thesayyn
Copy link
Member

Type of change

  • Bug fix (change which fixes an issue)

Test plan

  • New test cases added

  • TODO: add test

@thesayyn
Copy link
Member Author

I'll talk about this with @alexeagle tmr

@thesayyn thesayyn force-pushed the venv_exec branch 2 times, most recently from 061e828 to 556e4a2 Compare September 27, 2023 19:57
@thesayyn thesayyn requested a review from alexeagle September 27, 2023 19:58
@thesayyn thesayyn marked this pull request as ready for review September 27, 2023 19:58
Copy link
Member

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

I think there's some useful feedback on the slack thread, let's see if someone like @fmeum can provide a more thorough and correct review than I can

@fmeum
Copy link

fmeum commented Sep 28, 2023

This is very interesting. I will need to think this through a bit more before I can provide meaningful comments.

Copy link

@fmeum fmeum left a comment

Choose a reason for hiding this comment

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

This appears to be a pretty complicated workaround for an underlying issue with toolchain registration and I am not sure it will work properly in cross-platform setups.

I noticed that your primary toolchain definition at

name = "py_toolchain",
lacks a target_compatible_with attribute. With that added, you could presumably just define a py_binary target that serves as the venv tool and add that as an exec dep of the venv rule.

It's possible that I'm missing something and this requires a more complex solution, but a toolchain without constraints is almost never correct.

@thesayyn
Copy link
Member Author

eh this bit me again, didn't know this was already here...

@thesayyn
Copy link
Member Author

It's possible that I'm missing something and this requires a more complex solution, but a toolchain without constraints is almost never correct.

good point.

you could presumably just define a py_binary target that serves as the venv tool and add that as an exec dep of the venv rule.

wouldn't this almost be same as what I do right now with getting the python toolchain for the exec but a level more indirection?

Also, i presume auto exec groups ought to fix this, maybe correct solution is to wait for that?

@fmeum
Copy link

fmeum commented Dec 2, 2023

It's similar, but avoids having to introduce a current_runtime rule, which ends up hiding the actual source of a toolchain requirement and thus makes it harder to debug toolchain resolution issues.

I don't know auto exec groups well enough to assess whether they could help here.

@mattem mattem closed this Feb 7, 2024
@mattem mattem deleted the venv_exec branch February 7, 2024 14:47
@alexeagle
Copy link
Member

We'll solve for this by introducing a new toolchain pair, since we actually need to run a different command in the exec cfg than we do in the target cfg. See pycrust branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants