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

Tracking issue for rustbuild, the alternate build system for rustc #31590

Closed
42 of 48 tasks
alexcrichton opened this issue Feb 12, 2016 · 20 comments
Closed
42 of 48 tasks

Tracking issue for rustbuild, the alternate build system for rustc #31590

alexcrichton opened this issue Feb 12, 2016 · 20 comments
Labels
metabug Issues about issues themselves ("bugs about bugs") T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@alexcrichton
Copy link
Member

alexcrichton commented Feb 12, 2016

I'm opening this up as a tracking issue for all work that needs to happen to get rustbuild, our new build system, turned on by default. The end goal here is to completely jettison our thousands of lines of makefiles and configure scripts for tons and tons of Rust code! Initial support has landed in #31123, but we've still got quite aways to go!

Here's a list of items left that need to be implemented, and help is always appreciated when tackling these! If you want any clarifications or any help on any of these, feel free to reach out to me (acrichto) on IRC.

Documentation

work in progress

Testing

Porting

These should all be verified to work and then ideally we'd add a builder verifying they continue to work!

configure script

  • Migrate compiler version detection to Rust (maybe optional?)
  • Ensure all tool detection is moved into Rust

Misc

make install + make dist

These are pretty huge portions of the make files, they may take quite some time to migrate over, and it's probably fine to keep them around for now. @brson's plans with multirust-rs and reusable library components may become relevant here as well.

This may be subdivided into a bunch of smaller tasks over time!

Far future (not required)

@alexcrichton
Copy link
Member Author

Also as the most bike-sheddy thing, I'm not a huge fan of the term "rustbuild", so I'd also be fine calling this something cooler like "rust laser build"

@steveklabnik
Copy link
Member

This is a very simple thing, but I hit control-C while it was downloading stage0 and because the file wasn't valid, it just bailed out and I had to remove it manually. I'm not sure if deleting it and retrying is the right thing, or if this is just going to be a papercut generally.

@alexcrichton
Copy link
Member Author

Sounds like a bug! (added a checkbox)

@nodakai
Copy link
Contributor

nodakai commented Feb 12, 2016

By going from Makefile to build.rs, are we not throwing away the notion of dependency graph?

Please enable resuming on curl if possible, for people with narrowband.

@alexcrichton
Copy link
Member Author

No, I would expect any build system to take dependencies into account. It's an implicit assumption of mine that any sort of dependency tracking done by the current build system must be done by rustbuild as well.

@steveklabnik
Copy link
Member

Regarding the documentation features... maybe we should try to land rust-lang/cargo#2256 and then they could just be their own crates?

@alexcrichton
Copy link
Member Author

I suspect that may not end up helping too much unfortunately, most of our docs are rustbook-based rather than rustdoc-based.

@steveklabnik
Copy link
Member

Oh duh. I should, uh, know that 😅

The new book is going to use mdBook, and I think it should just be a drop-in replacement. Maybe it's time to kill rustbook for real?

@alexcrichton
Copy link
Member Author

It probably doesn't matter either way in terms of dependency management and instrumentation of the compiler building mdbook/rustbook, so I suspect switching over wouldn't change things too much really

@steveklabnik
Copy link
Member

@azerupi is okay with mdbook becoming a dependency https://github.com/azerupi/mdBook/issues/105#issuecomment-183518235

I will poke at that docs branch sometime next week.

@japaric
Copy link
Member

japaric commented Feb 12, 2016

I'm going to look into building compiler-rt as a crate using cargo instead of having the bootstrap binary build it. This should get us closer to being able to (cross) compile the std crate with cargo, i.e. just cd src/libstd && cargo build.

@alexcrichton
Copy link
Member Author

(added some bullet points to that effect)

@alexcrichton alexcrichton added metabug Issues about issues themselves ("bugs about bugs") T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 13, 2016
@shepmaster
Copy link
Member

While trying to help out the AVR-Rust fork, I started using rustbuild. I've been able to compile LLVM, but then realized that I had to change the configuration of LLVM. I edited src/bootstrap/build/native.rs to add a new value to the LLVM_TARGETS_TO_BUILD definition. When I ran make again, LLVM was not rebuilt.

@shepmaster
Copy link
Member

As a work-around, I've deleted all the llvm-config executables in my build directory. This seems to trigger a complete rebuild of LLVM. I have a feeling that this will make me a sad 🐼 when it comes time to make single bits of change to LLVM and incorporate them into Rust. Perhaps this is what the custom LLVM option is made for?

@alexcrichton
Copy link
Member Author

@shepmaster ah yeah right now the build system doesn't track changes to itself. I personally found that to be the most annoying part of the makefiles and I was glad to not reimplement that, but I suspect we'll have to add that eventually.

@alexcrichton
Copy link
Member Author

Also yeah, the handling of LLVM specifically may not be as great as it needs to be. Currently it unconditionally always configures via cmake before building with cmake. There's currently no entry point for "run a build in this directory but don't reconfigure". I'd probably recommend using an external LLVM for now, and that should be much easier through the config.toml configuration rather than ./configure itself

@Zoxc
Copy link
Contributor

Zoxc commented Feb 20, 2016

libc and alloc_system should be removed from liballoc's dependencies. With that change I can cross-compile a freestanding sysroot by depending on libcollections, https://github.com/AveryOS/avery/blob/master/sysroot/Cargo.toml

@bstrie
Copy link
Contributor

bstrie commented Mar 3, 2016

Does this imply that any of the zillion crates under src are going to be split out onto Crates.io?

@hanna-kruppe
Copy link
Contributor

@bstrie Not in the near future, since the old buikdsystem will still be around for a while. Once the Makefiles are gone, I expect that at least the crates that already have an official (owned by rust-lang or rust-lang-*) crates.io equivalent will be phased out in favor of of depending on the crates.io versions.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 12, 2016
This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc rust-lang#31590
bors added a commit that referenced this issue Apr 12, 2016
rustbuild: Migrate tidy checks to Rust

This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
alexcrichton added a commit to alexcrichton/rust that referenced this issue May 12, 2016
This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc rust-lang#31590
eddyb added a commit to eddyb/rust that referenced this issue May 12, 2016
… r=brson

rustbuild: Add support for crate tests + doctests

This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc rust-lang#31590
eddyb added a commit to eddyb/rust that referenced this issue May 12, 2016
… r=brson

rustbuild: Add support for crate tests + doctests

This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc rust-lang#31590
bors added a commit that referenced this issue May 12, 2016
rustbuild: Add support for crate tests + doctests

This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc #31590
@alexcrichton
Copy link
Member Author

Ok, almost all work is now done on this metabug, and I believe that rustbuild is now at feature parity with respect to the set of the makefiles that we run on all our automation (dist bots, auto bots, etc). As a result I'm going to close this out as it's all "basically done" (yay!).

There's a number of issues still tagged A-rustbuild, and we can use that label for tracking issues with rustbuild moving forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metabug Issues about issues themselves ("bugs about bugs") T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

8 participants