Skip to content

Split examples into binaries that are runnable independently #223

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

Closed
prasannavl opened this issue May 15, 2019 · 3 comments
Closed

Split examples into binaries that are runnable independently #223

prasannavl opened this issue May 15, 2019 · 3 comments

Comments

@prasannavl
Copy link
Contributor

Feature Request

  • We should make examples runnable individually easily.

Context

Possible Implementation

  • Have each example as separate bin (under examples/src/bin/), so that it can be easily run.
@prasannavl prasannavl added good first issue Good for newcomers and removed good first issue Good for newcomers labels May 15, 2019
@k-nasa
Copy link
Contributor

k-nasa commented May 19, 2019

@prasannavl How about dividing crate one by one? LIke actix/example
Then, I think that the dependency crates of the example becomes obvious.

@prasannavl
Copy link
Contributor Author

prasannavl commented May 20, 2019

@k-nasa - Personally, I like the convenience of switching between files quickly to be much nicer than having to go through a dir tree for simple examples.

@yoshuawuyts
Copy link
Member

yoshuawuyts commented May 20, 2019

A bit of a different take here, but I really wish cargo run --example <name> would work. I don't think the solution in #227 is quite good enough, as it still breaks the default way of running examples.

# expected
$ cargo run --example <example_name>

# proposed in GH-227
$ cargo run -p examples --bin <example_name>

I think this might require moving tide from a member of the workspace, to the top level under src/. Which is similar to how we do it in Runtime.


edit I've filed #247 as an alternative to #227, which brings back cargo run --example <example>.

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 a pull request may close this issue.

3 participants