Skip to content

Adds just recipe for modifying cdk commit hash#46

Merged
vnprc merged 1 commit intovnprc:masterfrom
machuPikacchuBTC:mp.just-cdk
May 23, 2025
Merged

Adds just recipe for modifying cdk commit hash#46
vnprc merged 1 commit intovnprc:masterfrom
machuPikacchuBTC:mp.just-cdk

Conversation

@machuPikacchuBTC
Copy link
Collaborator

@machuPikacchuBTC machuPikacchuBTC commented May 23, 2025

This PR addresses a comment made in #45

When you have committed your changes to the cdk fork and have a commit hash you can run just restore-deps to restore the cargo dependencies to the remote repo. Then do a search and replace across the hashpool repo to update the old commit hash to the new one. Come to think of it, that would make a great just recipe!

It's a simple "search and replace" recipe for modifying the CDK commit hash from its current value to an arbitrary rev.

Example output:

$ just update-cdk 773af52b f057cc8
Updating CDK revision from 773af52b to f057cc8...
✅ Updating ./roles/mint/Cargo.toml
✅ Updating ./roles/translator/Cargo.toml
✅ Updating ./roles/pool/Cargo.toml
✅ Updating ./protocols/v2/subprotocols/mining/Cargo.toml
Done! CDK updated from 773af52b to f057cc8

@vnprc
Copy link
Owner

vnprc commented May 23, 2025

Looks great! I tested this recipe in isolation and checked the diff. It is properly limited to only Cargo.toml files.

I used just update-cdk to back up one commit in the cdk repo and built it. It didn't build 😢. Then I used it again to switch back to the most recent commit. It built! \o/

When I run it while just local-cdk is active there is no conflict because it doesn't find the commit hash and is a noop.

Nice work. 🤝

@vnprc vnprc merged commit 49f6f42 into vnprc:master May 23, 2025
@machuPikacchuBTC machuPikacchuBTC deleted the mp.just-cdk branch May 23, 2025 15:02
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