-
Notifications
You must be signed in to change notification settings - Fork 5
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
criticalup run without proxies #71
Conversation
dffcda3
to
4e7e0ed
Compare
75907c1
to
fee32bc
Compare
I think this will be useful, especially to execute things like scripts and similar. My only worry about the feature is what would happen if you don't have a component installed through criticalup (like rustfmt) but that is installed globally on the system. In that case, this would execute an outside rustfmt. I personally lean towards consistency with other tools here though. |
That's basically my worry too. I was considering if a warning would improve the situation, but I'm unsure. I'll get this tidied up and green and we can make a final call. |
I am adding a |
With the It allows for |
That's pretty much the use case I intended. :) |
e728912
to
1ac297f
Compare
e3a4ab1
to
c271faa
Compare
Testing this First pass: Used manifest: manifest-version = 1
[products.ferrocene]
release = "stable-24.08.0"
packages = [
"rustc-${rustc-host}",
] Then ran the following:
|
Testing this Second pass (in a Docker container): Downloaded criticalup binary from the CI and created the following manifest. manifest-version = 1
[products.ferrocene]
release = "stable-24.08.0"
packages = [
"rustc-${rustc-host}",
]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hereby approve this message.
bors merge |
Build succeeded: |
Currently
criticalup run
can be used to invoke different binary proxies, which are themselvescriticalup
in disguise. Then, those disguisedcriticalup
instances go and replace-exec the correct binary from the project themselves.Along the way, it manipulates the user's
$PATH
(or equivalent on other OS):criticalup/crates/criticalup-cli/src/binary_proxies.rs
Lines 77 to 93 in 0624bcc
A consequence of this strategy means running
criticalup run $TOOL
where$TOOL
is not part of thecriticalup.toml
results in an error:This is in contrast to the behavor seen in, for example, in
uv
:Or
rustup
:This PR rethinks that strategy, mostly inspired by using these tools. With this PR,
criticalup run
skips the execution of the binary proxies, then manipulates the path as needed before doing an exec-replace on the target command. This means the command the user runs does not necessarily need to be part of theircriticalup.toml
.It means this is valid:
Performance
The current strategy doesn't take long:
This strategy is measurably faster, but the difference is minor:
Open questions
Question: Is this a feature we want? (Should
criticalup run
interact with non-managed binaries?)Consideration: Users can always clear their
PATH
(or equivalent) variable before running: