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

Various improvements to cargo-component. #240

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

peterhuene
Copy link
Member

@peterhuene peterhuene commented Feb 27, 2024

This PR includes the following improvements to cargo-component:

  • cargo-component now componentizes based off the presence of component type information custom sections rather than always requiring a [package.metadata.component] section be present in Cargo.toml.
  • Bindings generation will now occur if a wit directory is present and [package.metadata.component] is not present in Cargo.toml.
  • Fix a panic in cargo component add if it encounters expected items that are not tables in Cargo.toml.
  • Fix not setting implicit tables for intermediate tables for the cargo component add command.
  • Fix not displaying anything when --help is present for commands passed directly to cargo.
  • cargo-component now uses the command adapter for bin examples and test/bench artifacts.
  • cargo-component now displays the same "Running" message that cargo does when using the run, test, and bench commands.
  • Some paths displayed in status messages have been prefix-stripped based on the CWD.

This PR also contains a bit of refactoring to run_cargo_command, as it was getting long and unwieldy.

Fixes #236.

This commit includes the following improvements to `cargo-component`:

* `cargo-component` now componentizes based off the presence of component type
  information custom sections rather than always requiring a
  `[package.metadata.component]` section be present in `Cargo.toml`.
* Bindings generation will now occur if a `wit` directory is present and
  `[package.metadata.component]` is not present in `Cargo.toml`.
* Fix a panic in `cargo component add` if it encounters expected items that are
  not tables in `Cargo.toml`.
* Fix not setting implicit tables for intermediate tables for the `cargo
  component add` command.
* Fix not displaying anything when `--help` is present for commands passed
  directly to `cargo`.
* `cargo-component` now uses the command adapter for binary examples and
  test/bench artifacts.
* `cargo-component` now displays the same "Running" message that `cargo` does
  when using the `run`, `test`, and `bench` commands.
* Some paths displayed in status messages have been prefix-stripped based on
  the CWD.

This commit also contains a bit of refactoring to `run_cargo_command`, as it
was getting long and unwieldy.

Fixes bytecodealliance#236.
src/metadata.rs Outdated Show resolved Hide resolved
This makes using the section more ergonomic.
Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

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

Cool, that makes several things tidier.

@peterhuene peterhuene merged commit f98de99 into bytecodealliance:main Feb 28, 2024
6 checks passed
@peterhuene peterhuene deleted the bug-fixes branch February 28, 2024 02:06
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.

"hello world" example with the wasi crate doesn't work
2 participants