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

Consider renaming the bin crates for consistency #4915

Closed
nxsaken opened this issue Jul 30, 2024 · 3 comments · Fixed by #4970
Closed

Consider renaming the bin crates for consistency #4915

nxsaken opened this issue Jul 30, 2024 · 3 comments · Fixed by #4970
Assignees

Comments

@nxsaken
Copy link
Contributor

nxsaken commented Jul 30, 2024

To install binaries via cargo install, crate names are used. This is confusing because the iroha binary belongs to the iroha_client_cli crate, while the iroha crate contains the client SDK. The WASM builder suffers from the same awkwardness. I propose we rename the crates once more:

  • iroha -> iroha_sdk
  • iroha_client_cli -> iroha (or merge into a lib+bin crate)
  • Merge iroha_wasm_builder_cli and iroha_wasm_builder into a lib+bin crate similarly to iroha_swarm

If we want to eventually publish Iroha (#2933), we should also take into account that iroha and some related names like iroha_derive have been taken on crates.io already. We should ask the author of the crate to consider giving up the name, or come up with something else.

@nxsaken
Copy link
Contributor Author

nxsaken commented Jul 30, 2024

cc: @a-zorina

@nxsaken nxsaken changed the title Consider renaming the crates for consistency Consider renaming the bin crates for consistency Jul 30, 2024
@mversic
Copy link
Contributor

mversic commented Aug 5, 2024

Love the suggestion. I think both should be merged into lib + bin

@nxsaken nxsaken self-assigned this Aug 5, 2024
@nxsaken
Copy link
Contributor Author

nxsaken commented Aug 9, 2024

I did some research and found some issues with lib+bin consolidation.

There is no way to specify dependencies separately for the binary and the library: rust-lang/cargo#1982. There is a workaround involving marking the binary-only dependencies as optional, and bundling them into a required feature for the [[bin]] spec.

This means that to build a binary, one would have to always pass --features cli or something like that, or else the build will fail (or in the case of a project-wide cargo build, the binary will be skipped silently).

Not marking the dependencies as optional would cause unneeded dependencies for those who just want the SDK.

This seems like too much hassle just to be able to cargo install iroha, but we could at least rename iroha_client_cli to iroha_cli so that it's cargo install iroha_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

Successfully merging a pull request may close this issue.

2 participants