Skip to content

Comments

Add first version of targets command#132

Merged
rylev merged 3 commits intobytecodealliance:mainfrom
rylev:targets-cmd
Aug 12, 2024
Merged

Add first version of targets command#132
rylev merged 3 commits intobytecodealliance:mainfrom
rylev:targets-cmd

Conversation

@rylev
Copy link
Collaborator

@rylev rylev commented Jul 11, 2024

Implements #115

This adds a wac targets subcommand for determining whether a given component targets a given world. See the README changes for how this command is supposed to be used.

The implementation is fairly naive, and I'm unsure if it's the best way to go about it. Because type checking relies on all types by populating in a Types collection, we load everything into Package which handles populating the Types collection. A Package requires a valid component, so we first convert the wit package into a component with wit-component. This does mean we have to dig into package to get the actual world id we care about though.

@peterhuene let me know if I'm missing something here, but I think this is probably the best way to do this for now.

In the future, we want to expose a programatic API so if we can figure out a way to populate a Types collection directly from a wit_parser::Resolve that might be the way to go.

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.

Looks great, just some minor comments.

rylev added 2 commits August 1, 2024 13:59
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Copy link
Collaborator

@fibonacci1729 fibonacci1729 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 great! Just need to resolve the one remaining comment about the positional arguments.

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev merged commit 47633c6 into bytecodealliance:main Aug 12, 2024
@rylev rylev deleted the targets-cmd branch August 12, 2024 09:49
mergify bot referenced this pull request in andrzejressel/pulumi-gestalt Sep 5, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [wac-graph](https://redirect.github.com/bytecodealliance/wac) | workspace.dependencies | minor | `0.5.0` -> `0.6.0` |

---

### Release Notes

<details>
<summary>bytecodealliance/wac (wac-graph)</summary>

### [`v0.6.0`](https://redirect.github.com/bytecodealliance/wac/releases/tag/v0.6.0)

[Compare Source](https://redirect.github.com/bytecodealliance/wac/compare/v0.5.0...v0.6.0)

#### What's Changed

-   set version 0.6.0-dev by [@&#8203;calvinrp](https://redirect.github.com/calvinrp) in [https://github.com/bytecodealliance/wac/pull/135](https://redirect.github.com/bytecodealliance/wac/pull/135)
-   Fix inferred dep path losing patch version by [@&#8203;itowlson](https://redirect.github.com/itowlson) in [https://github.com/bytecodealliance/wac/pull/138](https://redirect.github.com/bytecodealliance/wac/pull/138)
-   Add first version of targets command by [@&#8203;rylev](https://redirect.github.com/rylev) in [https://github.com/bytecodealliance/wac/pull/132](https://redirect.github.com/bytecodealliance/wac/pull/132)
-   Update warg 0.9 by [@&#8203;calvinrp](https://redirect.github.com/calvinrp) in [https://github.com/bytecodealliance/wac/pull/140](https://redirect.github.com/bytecodealliance/wac/pull/140)

**Full Changelog**: bytecodealliance/wac@v0.5.0...v0.6.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/andrzejressel/pulumi-wasm).
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