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

Run rustup #577

Closed
andychu opened this issue Jan 15, 2020 · 7 comments
Closed

Run rustup #577

andychu opened this issue Jan 15, 2020 · 7 comments

Comments

@andychu
Copy link
Contributor

andychu commented Jan 15, 2020

https://rustup.rs/

It looks like everyone gets their Rust toolchain this way and it has a bunch of shell.

Might be interesting to trace what it's doing as well.


I'd be interested to know if any part of it runs and if not, what the error message is!

@jyn514
Copy link
Contributor

jyn514 commented Jan 19, 2020

Just tried this out with 0.7pre11, rustup works great :)

@andychu
Copy link
Contributor Author

andychu commented Jan 19, 2020

Thanks for trying it! After inspecting it, it does look like 435 lines of reasonable bash.

One thing I think would be cool is to run a lot of these curl | sh installers under a special OSH trace mode... and publish the results to see what they are doing.

You can sort of do it with curl | sh -x but it's not that friendly.

@jyn514
Copy link
Contributor

jyn514 commented Jan 19, 2020

What would you have instead of sh -x? At the end of the day shells run lot of code, I'm not sure there's a way to make that prettier...

@andychu
Copy link
Contributor Author

andychu commented Jan 20, 2020

I'd say I have two "levels of ambition"

  1. At the very least sh -x should print the commands in an unambiguous format that you can parse. It's related to QSN serialization format: parser, printer, builtin #582 which I can explain a bit more if interested.

A really simple query would be like: "what are all the external tools this runs" (as opposed to builtins). I feel like you should be able to postprocess the sh -x output to answer that. And it's mildly interesting from a security POV.

"What are all the files it opens" is a related question which is a bit harder to answer.

  1. It would be nice to provide some other scripts to make a big report from a trace. Maybe something like:

https://www.phoronix.com/scan.php?page=article&item=ubuntu_boot_perf&num=2

I'm not sure how interesting it would be for curl | sh installers. But I definitely have big shell scripts for builds and data pipelines that start hundreds of processes.

Oil already have some extra debugging features that I'd like to document and expose, like --debug-file and so forth.

@andychu
Copy link
Contributor Author

andychu commented Jan 20, 2020

I think a lot of people are doing this kind of stuff with kernel tracing and eBPF these days. The kernel is in a better position to trace processes, since it has to start thema ll. But that's Linux only... and maybe we can do some similar stuff in user space. It's mostly an idle thought...

I think the first step is to make a better interface than $PS4 for the trace prefix string.

That's analogous to #498, which is to do something better than $PS1 for the prompt.

@jyn514
Copy link
Contributor

jyn514 commented Jul 22, 2020

I think this can be closed in favor of #583.

@andychu
Copy link
Contributor Author

andychu commented Jul 22, 2020

Yup makes sense

@andychu andychu closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants