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

All tools should be libraries #3543

Closed
brson opened this issue Sep 20, 2012 · 4 comments
Closed

All tools should be libraries #3543

brson opened this issue Sep 20, 2012 · 4 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Sep 20, 2012

I want to be able to access cargo and rustdoc as libraries. We should just get in the habit of making everything a library.

Here is what I would like:

  • src/rustc becomes src/librustc - It's already a library, but is structured oddly.
  • src/cargo -> src/libcargo
  • src/rustdoc -> src/librustdoc
  • src/fuzzer -> src/libfuzzer
  • Add driver/driver.rs

driver.rs looks like this

#[cfg(rustc)]
extern mod self = rustc(vers = "0.4");

#[cfg(rustdoc)]
extern mod self = rustdoc(vers = "0.4");

...

fn main() { self::main() }

We may also want some way to include the appropriate per-application crate attributes.

@graydon
Copy link
Contributor

graydon commented Oct 3, 2012

Works for me.

@catamorphism
Copy link
Contributor

ff07e68 addresses all points except the first. Does the first point involve anything more than renaming the directory?

@brson
Copy link
Contributor Author

brson commented Nov 4, 2012

Yeah, there's a little more to do. the rustc executable is actually built from rustc/driver/rustc.rs. The contents of this file should be folded into librustc and rustc's driver built using driver.rs.

@brson
Copy link
Contributor Author

brson commented Nov 7, 2012

Fixed

@brson brson closed this as completed Nov 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

3 participants