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

Keep a changelog #5839

Closed
RazrFalcon opened this issue Jul 31, 2018 · 7 comments
Closed

Keep a changelog #5839

RazrFalcon opened this issue Jul 31, 2018 · 7 comments

Comments

@RazrFalcon
Copy link

As an author of a cargo plugin, it's extremely hard to update to a newer cargo version, since changes are undocumented.

The only "solution" is to look up in commits history and git blame.

@matklad
Copy link
Member

matklad commented Aug 7, 2018

@RazrFalcon we don't really officially support using Cargo as a library, it is 0.x and unstable. Would it be possible to use tools like cargo metadata or --message-format=json (docs) for your plugin? These are interfaces which are guaranteed to be stable.

@RazrFalcon
Copy link
Author

I see. I have to run the build process thought my plugin, so I need an access to the core::compiler::Compilation struct. And I'm not sure it's possible via cargo metadata.

@matklad
Copy link
Member

matklad commented Aug 7, 2018

@RazrFalcon yep, metadata won't help with Compliation. However cargo build --message-format=json or cargo +nightly build --build-plan -Z unstable-options (currently unstable, https://doc.rust-lang.org/beta/cargo/reference/unstable.html#build-plan) might help

@RazrFalcon
Copy link
Author

Will give it a try.

By the way, is this ok that json output is malformed?

@matklad
Copy link
Member

matklad commented Aug 7, 2018

No, it is not ok :) --message-format and --build-plan should have stdout as a series of newline separated JSON objects (we use that instead of a single array to allow streaming), and nothing else should be printed to stdout.

@RazrFalcon
Copy link
Author

Oh, I see. Than it's fine.

@RazrFalcon
Copy link
Author

Hi. I've tried to use the json output and looks like it will be enough for my needs. The current problem is that I don't know how to get Compilation::target_dylib_path, aka the dir that contains rust std libraries. Can I get it via cli?

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

No branches or pull requests

2 participants