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

Proposal: allow crates to depend on a binary crate #4316

Closed
jcranmer opened this issue Jul 22, 2017 · 3 comments
Closed

Proposal: allow crates to depend on a binary crate #4316

jcranmer opened this issue Jul 22, 2017 · 3 comments
Labels
A-crate-dependencies Area: [dependencies] of any kind C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@jcranmer
Copy link

Since I see this has been proposed a few times, but closed due to finding other solutions, let me explain a use case where I want this feature.

I have one crate (named asm-executor) that implements an execution oracle for assembly programs--you pass in an assembly-language program and a list of x86 machine states, and it outputs the results of running that assembly language on those x86 machine states (by running it on the CPU directly, no emulation). Since it's designed to handle memory accesses, I'd much rather execute the program in a separate address space to minimize "forbidden" address maps, and the easiest way of doing this is a binary.

This means I need some way of being able to say that I can depend on the crate in such a way that I can execute the binary contained within.

@carols10cents carols10cents added A-crate-dependencies Area: [dependencies] of any kind C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Aug 27, 2017
@Twey
Copy link

Twey commented Jan 30, 2018

‘Me too.’ I have a test harness crate that involves, as part of its setup, running some binaries, then running some code that talks to them. These binaries are generated by cargo from within the same workspace. As it stands, I can't just run cargo test on the crate under interrogation, because the binaries used by the test harness may not have been updated: instead, I must write cargo build; cargo test because cargo doesn't know about these dependencies. Forgetting this sometimes results in confusing test failures.

stepancheg added a commit to stepancheg/rust-protobuf that referenced this issue Dec 31, 2019
Because it depends on another crate binary, and Cargo does not
expose binaries from dependencies.

(rust-lang/cargo#4316)
stepancheg added a commit to stepancheg/rust-protobuf that referenced this issue Dec 31, 2019
Because it depends on another crate binary, and Cargo does not
expose binaries from dependencies.

(rust-lang/cargo#4316)
stepancheg added a commit to stepancheg/rust-protobuf that referenced this issue Dec 31, 2019
Because it depends on another crate binary, and Cargo does not
expose binaries from dependencies.

(rust-lang/cargo#4316)
npmccallum added a commit to npmccallum/cargo that referenced this issue Jan 17, 2020
This is useful in a variety of situations such as:
  * Embedding one binary into another (i.e. BIOS, kernel)
  * Testing using a third-party utility (i.e. nc)

Fixes rust-lang#4316.
npmccallum added a commit to npmccallum/cargo that referenced this issue Jan 24, 2020
This is useful in a variety of situations such as:
  * Embedding one binary into another (i.e. BIOS, kernel)
  * Testing using a third-party utility (i.e. nc)

Fixes rust-lang#4316.
@joshtriplett
Copy link
Member

I'd love to have this as well.

Ideally, it would support a mechanism similar to the metadata that FFI crates provide, where it's possible for the depending crate's build script to get the path to the binary for the dependency.

@ehuss
Copy link
Contributor

ehuss commented Jan 23, 2021

I think this issue should be covered by RFC 3028, so closing in favor of the tracking issue #9096.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crate-dependencies Area: [dependencies] of any kind C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants