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

Feature Request: Ability to use dependencies as cargo extensions #1208

Closed
octplane opened this issue Jan 23, 2015 · 6 comments
Closed

Feature Request: Ability to use dependencies as cargo extensions #1208

octplane opened this issue Jan 23, 2015 · 6 comments

Comments

@octplane
Copy link

Hello,

Because I think Rust should be also used for websites, I'm trying to build a tool inspired by another build-tool, sbt, the Scala build tool. This tool offers a readline console in which you can issue most commands it supports.

One of the commands allows the user to ask sbt to rebuild the project every time there is a file change in the project. A similar command can also be used to restart the project after it's been rebuilt.

In order to emulate this behavior, I have successfully released the fsevent library for rust. This is my second released piece of rust (and I'm happy I have managed to handle FFI and Rust together), my first one being a FFI binding to a readline like library...

Now I would like to be able to:

  • add a special dependency to my project that will add a subcommand to cargo (for example shell)
  • that when this command is invoked, some of my code is called with the cargo environment available,
  • so that I would use my FSEvent library to instruct cargo to build the project, or clean it, or whatever...

How do you think this should be addressed ? Do you think this is a reasonable idea ? Do you see any other way to achieve the same result without having to modify cargo ?

Thank you for your time...

@octplane
Copy link
Author

Note that part of the behavior could be implemented using a custom build.rs file...

@alexcrichton
Copy link
Member

This sounds like a pretty great idea to me! I've often wanted a better way to install cargo subcommands. In general we don't deal much currently with the installation of crates, but this would certainly be a nice to have!

@alexcrichton
Copy link
Member

As in, today we don't deal much with installation, but I'd certainly love to :)

@octplane
Copy link
Author

octplane commented Feb 3, 2015

How do you think I could help, or I should proceed ? Adding a new Cargo directive ? What's your vision for that ?

@alexcrichton
Copy link
Member

I haven't really given much thought to the story of cargo install and what it might look like. There's been a bunch of issues on the topic, but there's lots of design work to do in order to figure out precisely what it means, what the scope of the command is, etc.

@alexcrichton
Copy link
Member

I'm going to close this in favor of #37 as it's likely how one would install such packages.

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