Skip to content

Add support for loading plugins via command line (fixes #15446) #20032

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

Merged
merged 8 commits into from
Jan 8, 2015

Conversation

Manishearth
Copy link
Member

rustc something.rs -L folder_with_plugin_dylib/ -Z extra-plugins=foo works via this

My way of testing this is by cloning https://github.com/Manishearth/rust-clippy, cargo building it, and then running rustc examples/box_vec.rs -L target/ -Z extra-plugins=rust_clippy after editing out the exern crate rust_clippy from box_vec.rs

r? @huonw

fixes #15446

@tomjakubowski
Copy link
Contributor

🙌

@kmcallister
Copy link
Contributor

Needs tests. You can use // compile-flags:.

@Manishearth
Copy link
Member Author

@kmcallister example of a test that makes a plugin and tests it?

@kmcallister
Copy link
Contributor

Look at src/test/run-pass-fulldeps/lint-plugin.rs. Note the line

// aux-build:lint_plugin_test.rs

which refers to a file in src/test/auxiliary.

@Manishearth
Copy link
Member Author

@kmcallister Done

@tomjakubowski
Copy link
Contributor

Can these plugins be loaded from the command line through rustdoc as well? For lints it's not such a big deal, but a library that need syntax extensions loaded at the command line to build would also need to pass those to rustdoc.

@seanmonstar
Copy link
Contributor

needs rebase.

i. want.

@Manishearth
Copy link
Member Author

@seanmonstar Yeah, I'm rebasing this every few days. :)

@Manishearth
Copy link
Member Author

@tomjakubowski Such libraries should load it via the usual method IMO. While this can be used for syntax extensions, it's mainly aimed at lints.

@tomjakubowski
Copy link
Contributor

Well any code with #![deny(unknown-lints)] will fail under rustdoc unless it can also load the necessary plugins. Rustdoc support could wait for future work for sure though.

@Manishearth Manishearth force-pushed the plugin-loader branch 3 times, most recently from b624706 to 7c46180 Compare December 25, 2014 18:57
@Manishearth Manishearth force-pushed the plugin-loader branch 5 times, most recently from 067fdb3 to 4664db4 Compare January 7, 2015 15:35
@Manishearth Manishearth force-pushed the plugin-loader branch 2 times, most recently from 44b7b0f to f4a2672 Compare January 8, 2015 09:17
bors added a commit that referenced this pull request Jan 8, 2015
`rustc something.rs -L folder_with_plugin_dylib/ -Z extra-plugins=foo` works via this

My way of testing this is by cloning https://github.com/Manishearth/rust-clippy, `cargo build`ing it, and then running `rustc examples/box_vec.rs -L target/ -Z extra-plugins=rust_clippy` after editing out the `exern crate rust_clippy` from `box_vec.rs`

r? @huonw

fixes #15446
@bors bors merged commit 6342aa6 into rust-lang:master Jan 8, 2015
@Manishearth Manishearth deleted the plugin-loader branch January 10, 2015 21:27
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.

Allow compiler plugins to be loaded from the command line
7 participants