Skip to content

Conversation

@moliholy
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor Author

@patriciobcs thanks a lot! 🙏

@moliholy
Copy link
Contributor Author

moliholy commented Nov 4, 2025

@patriciobcs any progress on this? We're waiting for this to become a library to be able to actively use it as part of pop-cli's features.

@patriciobcs patriciobcs merged commit f0f7e51 into paritytech:main Nov 4, 2025
1 of 2 checks passed
@moliholy moliholy deleted the feat/convert-to-library branch November 4, 2025 12:06
@patriciobcs
Copy link
Collaborator

Merged! Will publish new crate release after merging tests fix PR #35

@moliholy
Copy link
Contributor Author

moliholy commented Nov 4, 2025

Awesome, thanks! 🙏

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