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

more forge docs for mentoring are needed #40902

Closed
3 tasks
nikomatsakis opened this issue Mar 29, 2017 · 17 comments
Closed
3 tasks

more forge docs for mentoring are needed #40902

nikomatsakis opened this issue Mar 29, 2017 · 17 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-help-wanted Call for participation: Help is requested to fix this issue. P-medium Medium priority

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Mar 29, 2017

I've been finding that there are a lot of undocumented things you have to learn if you want to get started hacking on rustc. If we want to encourage people to get involved -- and we do! -- we should try to ensure that things are as well-documented as possible. I think that these docs should all be on The Rust Forge.

This issue is intended as a clearing house to track things that it would be useful to document. Here are some suggestions. I will try to move items from comments up here into the top issue (or feel free to do so yourself, if you have write permissions). Also feel free to open a separate issue on a particular topic (and link to it from here).

  • How to build the compiler and how to run the compiler you built
    • First off, explaining about --stage 1 and --incremental arguments
    • Then, once you run ./x.py build --incremental, it's not obvious where to find compiled executable or how to run it
    • For bonus points, we could publish some kind of rustup toolchain instructions, so that you can just type rustc and have it work (that's how my setup works, at least, I should document it publicly)
  • Advice on effective use of RUST_LOG
    • Common modules you may want to log
    • Direct the output into a file
    • -Z verbose for more details
  • A list of the various debugging outputs the compiler supports (--unpretty, MIR dump, CGU partitions, dep-graph etc) (from this comment)
    • which commandline arguments or environment variables are needed to generate them
    • the kind of filtering they support (e.g. just dump MIR for one function)
@nikomatsakis nikomatsakis added E-help-wanted Call for participation: Help is requested to fix this issue. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Mar 29, 2017
@nikomatsakis
Copy link
Contributor Author

cc @rust-lang/docs

@steveklabnik
Copy link
Member

This would be wonderful and amazing and I really, really want it.

@michaelwoerister
Copy link
Member

michaelwoerister commented Mar 29, 2017

A list of the various debugging outputs the compiler supports (--unpretty, MIR dump, CGU partitions, dep-graph etc):

  • which commandline arguments or environment variables are needed to generate them
  • the kind of filtering they support (e.g. just dump MIR for one function)

UPDATE(nikomatsakis): promoted to main comment

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Mar 29, 2017

I think we talked about this a while ago but didn't consider it as a priority back then. Might be worth (a lot!!) to give it another try.

@steveklabnik
Copy link
Member

@nikomatsakis i'm assuming you filed this here and not against https://github.com/rust-lang-nursery/rust-forge for visibility reasons? technically it should be over there

@est31
Copy link
Member

est31 commented Mar 29, 2017

How to run rustc in gdb (inside the rustbuild environment) has been a question that commonly came up. Its non trivial because of all the env var setting. See also #39888

@cramertj
Copy link
Member

cramertj commented Mar 30, 2017

Another useful inclusion would be the "nuke the tools directories" command. I use alias nuketools="rm -rf $RUSTDIR/build/*/*-tools" to remove affected files when there are version conflicts.

@pmatos
Copy link
Contributor

pmatos commented Mar 31, 2017

@nikomatsakis , @steveklabnik as a followup to https://internals.rust-lang.org/t/understanding-the-compiler/5012 I would like to help with this. If I were to start writing some docs for this, which tools/markup should I use and where should it be hosted?

A side note, I am not familiar with rustc however I find that sometimes learning through documentation writing is a very useful thing to do both for the writer and for the reader.

@steveklabnik
Copy link
Member

@est31
Copy link
Member

est31 commented Mar 31, 2017

+1 to @cramertj 's idea, you are very likely to run into #39751 or #39396 sooner or later, so pointing out the workarounds is a good idea.

@mgattozzi
Copy link
Contributor

mgattozzi commented May 4, 2017

I talked with @nikomatsakis about this at the Boston Rust meetup and he told me to write up a list for this. Here are a few things I think should also be covered:

  • Documentation for rustc types should be added. Currently we have to go to @Manishearth's site to get access to the internal docs. New comers might not know what a Ty or Ctx is.
  • In the same vein the internal types should be documented. There's next to nothing on them and if you don't know what they are you're left fumbling trying to figure them out. Now if you hack on rustc all the time this isn't a problem, but newcomers don't understand them (Like what's a Span? A Ty?). I think there's a good amount of expert bias here and documenting would reduce the mentoring burden for rustc's core team and could increase contribution.
  • Documenting the design of the compiler for new rustc hackers rather than more advanced ones (but having docs for the advanced users would be great too)
  • Compiler tricks like how to make compilation faster (using a stage1 rather than stage2 build for testing) or other small things would go a long way to ergonomics
  • Documenting how x.py works and the most common use cases for it to make fast builds or how it works if people want to work on it.

I'm sure there's more but I feel this would be a good starting point if we want to revitalize rust-forge as a one stop shop for all things rustc. I never had heard about it and it would really help expand helping on the compiler. The Rust community is smart, they just need some documentation to help them along and to contribute. I know I'll be helping out with this, so please let me know how I can help advance the above goals and others.

@Manishearth
Copy link
Member

I can help answer qs about internal types for documentation, but probably will never get around to doing it myself. I did do a preliminary pass a few years ago adding basic docs to the most common types.

@nikomatsakis
Copy link
Contributor Author

Some thoughts I had:

  • We should be publishing the crate docs somewhere "official" (many thanks to @Manishearth for filling the gap)
  • We should generate a list of all types in the compiler, sorted by how often they are used, and make sure that the top N have doc comments and useful explanations

@Manishearth
Copy link
Member

Please please please official internals docs 😄

@gaurikholkar-zz
Copy link

A write-up on building from source on a Mac particularly the dependencies installation would be great!

@mgattozzi
Copy link
Contributor

I'm still working on trying to get forge to self host docs but haven't had enough time to work through the CI stuff yet to get it to build them.

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@steveklabnik steveklabnik added the P-medium Medium priority label Aug 30, 2017
@steveklabnik
Copy link
Member

We now have the rustc guide, and the compiler docs are hosted. I'm going to close this bug, as it's not clear to me that it's usefully tracking anything anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-help-wanted Call for participation: Help is requested to fix this issue. P-medium Medium priority
Projects
None yet
Development

No branches or pull requests