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

feat(kona-host): export HostCli, fix compilation #957

Closed

Conversation

ratankaliani
Copy link
Contributor

@ratankaliani ratankaliani commented Jan 27, 2025

The modules defined in main.rs are not accessible outside the crate because main.rs is the binary entry point, not a library file. By default, code in main.rs is only available within the binary itself.

To make the CLI types (e.g. HostCli) available externally (e.g. in https://github.com/succinctlabs/op-succinct), they need to be:

  • Defined in lib.rs (or a module exported by lib.rs).
  • Marked with pub visibility.

Once I included exposed the modules in lib.rs, modules within cli, single, etc., need to import types from kona-host with crate::.

@ratankaliani ratankaliani changed the title feat(kona-host): fix compilation feat(kona-host): export HostCli, fix compilation Jan 27, 2025
Comment on lines +23 to +26
pub mod cli;
pub mod eth;
pub mod interop;
pub mod single;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to restrict the accessible types from these crates, happy to apply the pub use pattern above.

@ratankaliani
Copy link
Contributor Author

@clabby Would it be possible to export SingleChainHostCli from kona-host? Or was this the intended behavior for it to only be used by binaries in kona-host?

@ratankaliani ratankaliani force-pushed the ratan/fix-kona-host-compilation branch from 103f06b to 589851c Compare January 31, 2025 19:31
@ratankaliani ratankaliani force-pushed the ratan/fix-kona-host-compilation branch from 589851c to 1e98abc Compare January 31, 2025 19:32
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 this pull request may close these issues.

1 participant