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

draft: build parachain on missing local binaries #207

Closed

Conversation

bolajahmad
Copy link
Contributor

While trying to spin up a substrate node using pop up parachain, the command will fail if the node has not been built/compiled already using pop build parachain.

This PR will automatically check if there is a build/binary existing for the node and then allow pop up... to progress.

@bolajahmad bolajahmad marked this pull request as draft June 14, 2024 00:15
@bolajahmad bolajahmad force-pushed the build-parachain-before-up branch from 0e5f0a8 to 9687770 Compare June 14, 2024 00:25
@AlexD10S AlexD10S self-requested a review June 17, 2024 12:55
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

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

When I try to run it without building it i am getting an error:

┌   Pop CLI : Building your parachain
│
Error: No such file or directory (os error 2)

I think is because of the path you are sending to the build_parachain function is incorrect.
The steps to replicate the error are:
pop new parachain my-parachain
cd my-parachain
pop up parachain -f network.toml

Also the CI is failing here: https://github.com/r0gue-io/pop-cli/actions/runs/9517887250/job/26237462632?pr=207 , run cargo fmt --all to fix it

let local: Vec<_> = missing.iter().filter(|(_, _, local)| *local).collect();
if local.len() > 0 {

for (name, binary, _) in local.iter() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a warning binary is not used.

.black()
.on_magenta()
))?;
let _ = build_parachain(&Some(PathBuf::from(name.clone())))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for .clone() here

.black()
.on_magenta()
))?;
let _ = build_parachain(&Some(PathBuf::from(name.clone())))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for let _ if you use ? after build_parachain

if local.len() > 0 {

for (name, binary, _) in local.iter() {
intro(format!("{}: Building your parachain", style(" Pop CLI ")
Copy link
Collaborator

Choose a reason for hiding this comment

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

To keep consistency with the funcionality we have in Contracts, can you add a warning message too? like the one you added for contracts?
log::warning(format!("NOTE: contract has not yet been built."))?;

@AlexD10S
Copy link
Collaborator

Closing this PR as the issue #176 has been closed but this other PR: #199

@AlexD10S AlexD10S closed this Jun 21, 2024
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.

2 participants