Skip to content

Conversation

@moliholy
Copy link

@moliholy moliholy commented Oct 9, 2025

This PR essentially transforms the current repository into a mixture of binary/library. The main idea is that other projects can import psvm as a library and utilize its public API.

Tests are failing, but also in the main branch. It should be automatically fixed once they are fixed in the main branch.

EDIT: On a second thought, perhaps it's just in my local machine. Let's see what the CI says.

@moliholy
Copy link
Author

moliholy commented Oct 9, 2025

@ggwpez pingging for visibility.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

Looks good, thanks. Is it a library crate now? I dont see a [lib] entry, i think that is needed.

@moliholy
Copy link
Author

@ggwpez it is, yes. Simply create a new project with cargo init and add this line to the dependencies:

[dependencies]
psvm = { git = "https://github.com/moliholy/psvm", branch = "feat/convert-to-library" }

Then in the main.rs or lib.rs file you'll be able to import psvm.

I dont see a [lib] entry, i think that is needed.

AFAIK you don’t need a [lib] section to make a crate importable as a library. If the project has a src/lib.rs, Cargo automatically creates a library target.

Copy link
Collaborator

@patriciobcs patriciobcs left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for the contribution. Will fix compilation warning and failing test in another PR, it is also failing in main branch, might be cause target branch (of the test) on Polkadot SDK changed. Will publish to crates.io after this.

@moliholy
Copy link
Author

@patriciobcs thanks a lot! 🙏

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.

3 participants