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

Respect build target from cargo config #319

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

iawia002
Copy link
Contributor

@iawia002 iawia002 commented Jul 4, 2024

This patch reads the project's Cargo configuration and uses the build target specified in it. This ensures that cargo component build will respect the target configuration in the .cargo/config.toml file and the value of the CARGO_BUILD_TARGET environment variable.

close #106
close #290

cc @calvinrp

@calvinrp calvinrp self-requested a review July 9, 2024 19:44
@calvinrp calvinrp merged commit 87d9021 into bytecodealliance:main Jul 9, 2024
6 checks passed
@calvinrp
Copy link
Collaborator

calvinrp commented Jul 9, 2024

Sorry, it took a few days to get to this one. Thank you for the PR.

mergify bot referenced this pull request in andrzejressel/pulumi-wasm Jul 9, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cargo-component](https://togithub.com/bytecodealliance/cargo-component) | minor | `0.13.0` -> `0.14.0` |

---

### Release Notes

<details>
<summary>bytecodealliance/cargo-component (cargo-component)</summary>

### [`v0.14.0`](https://togithub.com/bytecodealliance/cargo-component/releases/tag/v0.14.0)

[Compare Source](https://togithub.com/bytecodealliance/cargo-component/compare/v0.13.2...v0.14.0)

#### What's Changed

-   Document additional `cargo-component` requirements by [@&#8203;yoshuawuyts](https://togithub.com/yoshuawuyts) in [https://github.com/bytecodealliance/cargo-component/pull/309](https://togithub.com/bytecodealliance/cargo-component/pull/309)
-   Update adapter builds by [@&#8203;alexcrichton](https://togithub.com/alexcrichton) in [https://github.com/bytecodealliance/cargo-component/pull/312](https://togithub.com/bytecodealliance/cargo-component/pull/312)
-   Rename `wasm32-wasi` to `wasm32-wasip1` by [@&#8203;alexcrichton](https://togithub.com/alexcrichton) in [https://github.com/bytecodealliance/cargo-component/pull/313](https://togithub.com/bytecodealliance/cargo-component/pull/313)
-   Update to -S cli instead of -S common for wasmtime commands by [@&#8203;iawia002](https://togithub.com/iawia002) in [https://github.com/bytecodealliance/cargo-component/pull/317](https://togithub.com/bytecodealliance/cargo-component/pull/317)
-   Respect build target from cargo config by [@&#8203;iawia002](https://togithub.com/iawia002) in [https://github.com/bytecodealliance/cargo-component/pull/319](https://togithub.com/bytecodealliance/cargo-component/pull/319)

#### New Contributors

-   [@&#8203;yoshuawuyts](https://togithub.com/yoshuawuyts) made their first contribution in [https://github.com/bytecodealliance/cargo-component/pull/309](https://togithub.com/bytecodealliance/cargo-component/pull/309)
-   [@&#8203;iawia002](https://togithub.com/iawia002) made their first contribution in [https://github.com/bytecodealliance/cargo-component/pull/317](https://togithub.com/bytecodealliance/cargo-component/pull/317)

**Full Changelog**: bytecodealliance/cargo-component@v0.13.2...v0.14.0

### [`v0.13.2`](https://togithub.com/bytecodealliance/cargo-component/releases/tag/v0.13.2)

[Compare Source](https://togithub.com/bytecodealliance/cargo-component/compare/v0.13.1...v0.13.2)

#### What's Changed

-   Add `cargo component serve` subcommand by [@&#8203;primoly](https://togithub.com/primoly) in [https://github.com/bytecodealliance/cargo-component/pull/305](https://togithub.com/bytecodealliance/cargo-component/pull/305)
-   added wasmtime wasi args for `cargo component serve` by [@&#8203;calvinrp](https://togithub.com/calvinrp) in [https://github.com/bytecodealliance/cargo-component/pull/308](https://togithub.com/bytecodealliance/cargo-component/pull/308)

#### New Contributors

-   [@&#8203;primoly](https://togithub.com/primoly) made their first contribution in [https://github.com/bytecodealliance/cargo-component/pull/305](https://togithub.com/bytecodealliance/cargo-component/pull/305)

**Full Changelog**: bytecodealliance/cargo-component@v0.13.1...v0.13.2

### [`v0.13.1`](https://togithub.com/bytecodealliance/cargo-component/releases/tag/v0.13.1)

[Compare Source](https://togithub.com/bytecodealliance/cargo-component/compare/v0.13.0...v0.13.1)

#### What's Changed

-   More `cargo component new` generator fixes by [@&#8203;calvinrp](https://togithub.com/calvinrp) in [https://github.com/bytecodealliance/cargo-component/pull/304](https://togithub.com/bytecodealliance/cargo-component/pull/304)

**Full Changelog**: bytecodealliance/cargo-component@v0.13.0...v0.13.1

</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 becomes conflicted, 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 has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/andrzejressel/pulumi-wasm).
@iawia002 iawia002 deleted the target-config branch July 10, 2024 01:06
@MatthiasGrandl
Copy link

Am I missing something? In my components cargo.toml I specified:

[build]
target = "wasm32-unknown-unknown"

but it still defauts to wasm32-wasip1. I am on cargo component v15.

@iawia002
Copy link
Contributor Author

iawia002 commented Aug 5, 2024

The path to cargo configuration should be .cargo/config.toml instead of cargo.toml, see https://doc.rust-lang.org/cargo/reference/config.html

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.

Some wasi imports added per default into wit Support CARGO_BUILD_TARGET
3 participants