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

Add upgrade subcommand #175

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

jeffparsons
Copy link
Contributor

@jeffparsons jeffparsons commented Oct 29, 2023

Installs the latest version of cargo-component and upgrade to the corresponding version of cargo-component-bindings.

Follow-up to #167 (comment).

Before merge this needs at least:

  • Review (duh)
  • Squash + meaningful commit message

In particular I would like to draw the reviewer's attention to:

  • Design decision to unconditionally cargo-install and then exec delegate to either the existing binary or newly installed binary (unknown to us) for the rest of the job, as originally mentioned here: Refactor bindings generation. #167 (comment).
  • cargo-install part is currently completely untested. (Though it Works For Me™.) For now I've gated it behind #[cfg(test)] so I can still at least have the tests delegate to a child process to exercise as much of that code path as practicable. Any better ideas?
  • I've added a boolean function parameter. Does that lead to a paddlin' around here? 😅 I'm happy to make it an enum with meaningful variant names if that's the preferred thing here.
  • I haven't added a test that it actually updates all crates in the workspace. (Though again it Works For Me™.) Should I do that?

@jeffparsons jeffparsons marked this pull request as ready for review October 29, 2023 21:18
@jeffparsons
Copy link
Contributor Author

@peterhuene I think this is basically what you suggested. PTAL? 🙏

@jeffparsons
Copy link
Contributor Author

Oh yeah, Windows. Forgot about that. 😅

I'll fix.

src/commands/upgrade.rs Outdated Show resolved Hide resolved
@jeffparsons jeffparsons marked this pull request as draft October 30, 2023 04:41
@jeffparsons jeffparsons marked this pull request as ready for review October 30, 2023 05:12
@peterhuene
Copy link
Member

@jeffparsons thanks for the PR! I'll review this shortly.

Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

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

This looks really fantastic, thanks for taking this on!

I just have one minor suggestion to the message that gets printed when projects are up-to-date.

src/commands/upgrade.rs Outdated Show resolved Hide resolved
src/commands/upgrade.rs Outdated Show resolved Hide resolved
tests/upgrade.rs Outdated Show resolved Hide resolved
tests/upgrade.rs Outdated Show resolved Hide resolved
Installs the latest version of cargo-component and upgrade
to the corresponding version of cargo-component-bindings.
@jeffparsons
Copy link
Contributor Author

Good call; I've applied that change and rebased.

Thanks for the review! 💖

Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR!

@peterhuene peterhuene merged commit 33b5246 into bytecodealliance:main Nov 1, 2023
6 checks passed
@jeffparsons jeffparsons deleted the upgrade_subcommand branch November 1, 2023 01:35
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