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

Added info on the build system to contributing guide #31186

Merged
merged 3 commits into from
Jan 28, 2016

Conversation

gchp
Copy link
Contributor

@gchp gchp commented Jan 25, 2016

I recently wrote a blog post on contributing to the Rust compiler which
gained some interest. It was mentioned in a comment on Reddit that it
would be useful to integrate some of the information from that post to
the official contributing guide.

This is the start of my efforts to integrate what I wrote with the
official guide.

This commit adds information on the build system. It is not a complete
guide on the build system, but it should be enough to provide a good
starting place for those wishing to contribute.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@gchp
Copy link
Contributor Author

gchp commented Jan 25, 2016

As mentioned in the commit message, this is by no means a full guide to the build system. If there are any pieces you feel should be added to this, please let me know. Hopefully you find it useful!

[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/

### Configuration
Before you can start building the compiler you need to configure the build for
Copy link
Member

Choose a reason for hiding this comment

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

could you put a newline above here, like with the other headings?

@steveklabnik
Copy link
Member

One small nit, this looks good to me, but I'm terrible with the build system, so would like someone else to review too.

@gchp
Copy link
Contributor Author

gchp commented Jan 25, 2016

@steveklabnik updated!

I recently wrote a blog post on contributing to the Rust compiler which
gained some interest. It was mentioned in a comment on Reddit that it
would be useful to integrate some of the information from that post to
the official contributing guide.

This is the start of my efforts to integrate what I wrote with the
official guide.

This commit adds information on the build system. It is not a complete
guide on the build system, but it should be enough to provide a good
starting place for those wishing to contribute.

The build system for Rust is complex. It covers bootstrapping the compiler,
running tests, building documentation and more. Unless you are familiar with
Makefiles, I wouldn't suggest trying to understand everything going on in
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "I" rubs me the wrong way, and above (line 45) "we" is used.
  • I wouldn't suggest anyone to try and understand everything about the build system, unless they specifically want to improve it (and if so, in the hopefully-near future that means improving on Add a Cargo-based build system to eventually replace make #31123 rather than fiddling with the Makefiles). Perhaps just give a non-prescriptive warning that it's massive and easy to get lost in and uses lots of advanced Make features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rkruppe what about:

The build system for Rust is complex. It covers bootstrapping the compiler,
running tests, building documentation and more. It uses some advanced Make
features which can make it difficult to understand, and one can easily get
lost in it.

If Makefiles are your thing, though, all the configuration lives in
[the mk directory][mkdir] in the project root.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO "can easily get lost in it" is more a function of size than advancedness, but otherwise 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would you suggest as an alternative? Do you think it would be OK to cut that bit off, and leave it as

...advanced Make features which can make it difficult to understand.

?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like:

[...] building documentation and more.

If Makefiles are your thing, all the configuration [...] project root. It is easy to get lost though, as the build system is quite large and complex.

sounds more coherent to me.

@gchp
Copy link
Contributor Author

gchp commented Jan 26, 2016

@rkruppe I've updated to reflect your comments. I tweaked the intro paragraph a little more, let me know what you think.

Thank you for your feedback.

If Makefiles are your thing, all the configuration lives in
[the `mk` directory][mkdir] in the project root. Is can be hard to follow
in places, as it uses some advanced Make features which make for some
challenging reading. Running `make help` and `make tips` might be useful when
Copy link
Contributor

Choose a reason for hiding this comment

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

This document already contains some of the information of make help and what's not in here is not very helpful for build system hacking. I would point towards make nitty-gritty but I have no idea if it's even remotely up to date. Perhaps cut the false reassurance of documentation and just point people towards #rust-internals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. Will update now.

- Tweaked the build system intro paragraph
- Added some more configure options & explanations
- Added additional make target
## The Build System

The build system for Rust is complex. It covers bootstrapping the compiler,
running tests, building documentation and more.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have occurred to me sooner, but since this section spends most of its text on how scary the build system is, perhaps the opening paragraph should not mention the complexity at all and instead include some re-assuring words. Something like

Rust's build system allows you to bootstrap the compiler, run tests and benchmarks, generate documentation, install your freshly-built rust, and more. It's your best friend when working on Rust, allowing you to try out your contributions before submitting them.

(edit: significantly reworded that text)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, right. Probably a good thing to not just spend time scaring people :)

@hanna-kruppe
Copy link
Contributor

Awesome 👍 Thanks for doing this, the build system was by far the part I fought with the most when getting started. I'm still no expert but as far as I am concerned this is good to go.

@gchp
Copy link
Contributor Author

gchp commented Jan 26, 2016

@rkruppe thanks!

Not sure why the build is failing all of a sudden...seems very unlikely that this would cause it to fail?

@hanna-kruppe
Copy link
Contributor

I really doubt that this has anything to do with your changes. Travis logs indicate it fails to add a PPA and subsequently can't install some package. Four hours ago, in #31212, the same build commands succeeded so this may be outside of our control.

@alexcrichton
Copy link
Member

@bors: r+ 05f7b59 rollup

Thanks @gchp!

@gchp
Copy link
Contributor Author

gchp commented Jan 27, 2016

@alexcrichton 👍

Manishearth added a commit to Manishearth/rust that referenced this pull request Jan 27, 2016
I recently wrote a blog post on contributing to the Rust compiler which
gained some interest. It was mentioned in a comment on Reddit that it
would be useful to integrate some of the information from that post to
the official contributing guide.

This is the start of my efforts to integrate what I wrote with the
official guide.

This commit adds information on the build system. It is not a complete
guide on the build system, but it should be enough to provide a good
starting place for those wishing to contribute.
@bors
Copy link
Contributor

bors commented Jan 27, 2016

⌛ Testing commit 05f7b59 with merge 6d0fbfd...

@bors
Copy link
Contributor

bors commented Jan 27, 2016

💔 Test failed - auto-linux-64-x-android-t

bors added a commit that referenced this pull request Jan 27, 2016
@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jan 27, 2016 at 12:16 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-linux-64-x-android-t
http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/7812


Reply to this email directly or view it on GitHub
#31186 (comment).

@bors bors merged commit 05f7b59 into rust-lang:master Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants