Muhammad Azeez
30b4a7d2d3
fix: use gh release download instead of downloading from github action artifacts in dotnet workflow ( #857 )
...
It seems like at some point we changed the `release.yml` workflow to
create multiple artifacts instead of one `release-artifacts` tarball. I
changed the .NET Nuget workflow to be more like Python
2025-05-29 22:09:52 +03:00
zach
36e05e8668
chore: add ToBytes/FromBytes implementations for bool ( #855 )
...
Fixes https://github.com/extism/extism/issues/838
2025-05-27 15:35:22 -07:00
zach
de65e22f68
Remove python from dependabot.yml ( #835 )
2025-02-20 11:07:52 -08:00
zach
59acffa8ac
chore: include wasmtime 30 in supported bounds ( #834 )
...
Also updates dependabot config to bundle wasmtime updates so this can be
done automatically in the future.
2025-02-20 10:54:42 -08:00
zach
b249f09b90
fix(ci): remove path parameter from download-artifact action in release workflow ( #831 )
2025-02-10 10:28:23 -08:00
zach
d7956ff08c
fix(ci): use new download-artifact api ( #827 )
2025-02-04 13:49:19 -08:00
dependabot[bot]
87c3384f1e
chore(deps): Update ureq requirement from 2.5 to 3.0 ( #825 )
...
Closes #824
Updates the requirements on [ureq](https://github.com/algesten/ureq ) to
permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/algesten/ureq/blob/main/CHANGELOG.md ">ureq's
changelog</a>.</em></p>
<blockquote>
<h1>3.0.3</h1>
<ul>
<li>Use the same data in CONNECT and Host header for proxied requests
(<a
href="https://redirect.github.com/algesten/ureq/issues/967 ">#967</a>)</li>
<li>Set default scheme in proxy uri (<a
href="https://redirect.github.com/algesten/ureq/issues/966 ">#966</a>)</li>
<li>Redact URI and Location header on debug level (<a
href="https://redirect.github.com/algesten/ureq/issues/964 ">#964</a>)</li>
<li>Downgrade all logging to debug and below (<a
href="https://redirect.github.com/algesten/ureq/issues/964 ">#964</a>)</li>
</ul>
<h1>3.0.2</h1>
<ul>
<li>Remove dependency on once_cell (<a
href="https://redirect.github.com/algesten/ureq/issues/959 ">#959</a>)</li>
<li>Fix bug parsing partial redirects (<a
href="https://redirect.github.com/algesten/ureq/issues/958 ">#958</a>)</li>
<li>Expose typestate variables (<a
href="https://redirect.github.com/algesten/ureq/issues/956 ">#956</a>)</li>
</ul>
<h1>3.0.1</h1>
<ul>
<li>Fix excessive stack sizes (<a
href="https://redirect.github.com/algesten/ureq/issues/950 ">#950</a>)</li>
<li>Do not enable <strong>json</strong> by default (breaking, but it was
a mistake) (<a
href="https://redirect.github.com/algesten/ureq/issues/948 ">#948</a>)</li>
</ul>
<h1>3.0.0</h1>
<ul>
<li>Replace RequestBuilder Deref with explicit wrappers (<a
href="https://redirect.github.com/algesten/ureq/issues/944 ">#944</a>)</li>
<li>Remove dependency on <code>url</code> crate (<a
href="https://redirect.github.com/algesten/ureq/issues/943 ">#943</a>)</li>
<li>Feature <code>Config::save_redirect_history</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/939 ">#939</a>)</li>
</ul>
<h1>3.0.0-rc5</h1>
<ul>
<li><code>TlsConfig::unversioned_rustls_crypto_provider()</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/931 ">#931</a>)</li>
<li>Feature <code>rustls-no-provider</code> to compile without ring (<a
href="https://redirect.github.com/algesten/ureq/issues/931 ">#931</a>)</li>
<li>Fix CONNECT proxy Host header (<a
href="https://redirect.github.com/algesten/ureq/issues/936 ">#936</a>)</li>
<li>Re-enable CONNECT proxy support (<a
href="https://redirect.github.com/algesten/ureq/issues/932 ">#932</a>)</li>
<li>Body::content_length (<a
href="https://redirect.github.com/algesten/ureq/issues/927 ">#927</a>)</li>
<li>Handle Authorization: Basic from URI (<a
href="https://redirect.github.com/algesten/ureq/issues/923 ">#923</a>)</li>
<li>Remove many uses of Box::new() from Connector chain (<a
href="https://redirect.github.com/algesten/ureq/issues/919 ">#919</a>)</li>
</ul>
<h1>3.0.0-rc4</h1>
<ul>
<li>Default to <code>TooManyRedirects</code> error (<a
href="https://redirect.github.com/algesten/ureq/issues/916 ">#916</a>)</li>
<li>Add <code>ConfigBuilder::max_redirects_will_error()</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/916 ">#916</a>)</li>
<li>Add new <code>SendBody::into_reader()</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/914 ">#914</a>)</li>
<li>Fix completely broken PEM parsing (<a
href="https://redirect.github.com/algesten/ureq/issues/912 ">#912</a>)</li>
<li>Improve ergonomics for <code>AutoHeaderValue</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/896 ">#896</a>)</li>
</ul>
<h1>3.0.0-rc3</h1>
<ul>
<li>Re-export ureq_proto::ArrayVec (<a
href="https://redirect.github.com/algesten/ureq/issues/891 ">#891</a>)</li>
<li>Expose typestate variables, but #[doc(hidden)] (<a
href="https://redirect.github.com/algesten/ureq/issues/889 ">#889</a>)</li>
<li>Clarify versioning and MSRV policy (<a
href="https://redirect.github.com/algesten/ureq/issues/887 ">#887</a>)</li>
<li>Get last used uri via <code>ResponseExt::get_uri()</code> (<a
href="https://redirect.github.com/algesten/ureq/issues/884 ">#884</a>)</li>
<li>Expose more things for 3rd party Transport impls (<a
href="https://redirect.github.com/algesten/ureq/issues/886 ">#886</a>)</li>
<li>Make accessor fn for <code>Config</code> and <code>TlsConfig</code>
(<a
href="https://redirect.github.com/algesten/ureq/issues/886 ">#886</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5cb17e8e1f "><code>5cb17e8</code></a>
Update doc</li>
<li><a
href="81127cfc38 "><code>81127cf</code></a>
3.0.3</li>
<li><a
href="89d593c31c "><code>89d593c</code></a>
proxy: use the same data for CONNECT and Host header</li>
<li><a
href="e2e27ea654 "><code>e2e27ea</code></a>
Set default proxy scheme in proxy uri</li>
<li><a
href="7533c1ad45 "><code>7533c1a</code></a>
Update changelog</li>
<li><a
href="0d274df41b "><code>0d274df</code></a>
Use more constants for headers</li>
<li><a
href="0a4f6d7d75 "><code>0a4f6d7</code></a>
Redact Location header</li>
<li><a
href="50347206a1 "><code>5034720</code></a>
Downgrade info! level to debug!</li>
<li><a
href="4173dd49d7 "><code>4173dd4</code></a>
ureq-proto 0.3.0</li>
<li><a
href="3d5f182fa3 "><code>3d5f182</code></a>
3.0.2</li>
<li>Additional commits viewable in <a
href="https://github.com/algesten/ureq/compare/2.5.0...3.0.3 ">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: zach <zach@dylibso.com >
2025-02-04 11:30:53 -08:00
dependabot[bot]
07047eaab0
chore(deps): Update rand requirement from 0.8.5 to 0.9.0 ( #826 )
...
Updates the requirements on [rand](https://github.com/rust-random/rand )
to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-random/rand/blob/master/CHANGELOG.md ">rand's
changelog</a>.</em></p>
<blockquote>
<h2>[0.9.0] - 2025-01-27</h2>
<h3>Security and unsafe</h3>
<ul>
<li>Policy: "rand is not a crypto library" (<a
href="https://redirect.github.com/rust-random/rand/issues/1514 ">#1514</a>)</li>
<li>Remove fork-protection from <code>ReseedingRng</code> and
<code>ThreadRng</code>. Instead, it is recommended to call
<code>ThreadRng::reseed</code> on fork. (<a
href="https://redirect.github.com/rust-random/rand/issues/1379 ">#1379</a>)</li>
<li>Use <code>zerocopy</code> to replace some <code>unsafe</code> code
(<a
href="https://redirect.github.com/rust-random/rand/issues/1349 ">#1349</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1393 ">#1393</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1446 ">#1446</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1502 ">#1502</a>)</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>Bump the MSRV to 1.63.0 (<a
href="https://redirect.github.com/rust-random/rand/issues/1207 ">#1207</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1246 ">#1246</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1269 ">#1269</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1341 ">#1341</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1416 ">#1416</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1536 ">#1536</a>);
note that 1.60.0 may work for dependents when using
<code>--ignore-rust-version</code></li>
<li>Update to <code>rand_core</code> v0.9.0 (<a
href="https://redirect.github.com/rust-random/rand/issues/1558 ">#1558</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Support <code>std</code> feature without <code>getrandom</code> or
<code>rand_chacha</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1354 ">#1354</a>)</li>
<li>Enable feature <code>small_rng</code> by default (<a
href="https://redirect.github.com/rust-random/rand/issues/1455 ">#1455</a>)</li>
<li>Remove implicit feature <code>rand_chacha</code>; use
<code>std_rng</code> instead. (<a
href="https://redirect.github.com/rust-random/rand/issues/1473 ">#1473</a>)</li>
<li>Rename feature <code>serde1</code> to <code>serde</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1477 ">#1477</a>)</li>
<li>Rename feature <code>getrandom</code> to <code>os_rng</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1537 ">#1537</a>)</li>
<li>Add feature <code>thread_rng</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1547 ">#1547</a>)</li>
</ul>
<h3>API changes: rand_core traits</h3>
<ul>
<li>Add fn <code>RngCore::read_adapter</code> implementing
<code>std::io::Read</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1267 ">#1267</a>)</li>
<li>Add trait <code>CryptoBlockRng: BlockRngCore</code>; make
<code>trait CryptoRng: RngCore</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1273 ">#1273</a>)</li>
<li>Add traits <code>TryRngCore</code>, <code>TryCryptoRng</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1424 ">#1424</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1499 ">#1499</a>)</li>
<li>Rename <code>fn SeedableRng::from_rng</code> ->
<code>try_from_rng</code> and add infallible variant <code>fn
from_rng</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1424 ">#1424</a>)</li>
<li>Rename <code>fn SeedableRng::from_entropy</code> ->
<code>from_os_rng</code> and add fallible variant <code>fn
try_from_os_rng</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1424 ">#1424</a>)</li>
<li>Add bounds <code>Clone</code> and <code>AsRef</code> to associated
type <code>SeedableRng::Seed</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1491 ">#1491</a>)</li>
</ul>
<h3>API changes: Rng trait and top-level fns</h3>
<ul>
<li>Rename fn <code>rand::thread_rng()</code> to
<code>rand::rng()</code> and remove from the prelude (<a
href="https://redirect.github.com/rust-random/rand/issues/1506 ">#1506</a>)</li>
<li>Remove fn <code>rand::random()</code> from the prelude (<a
href="https://redirect.github.com/rust-random/rand/issues/1506 ">#1506</a>)</li>
<li>Add top-level fns <code>random_iter</code>,
<code>random_range</code>, <code>random_bool</code>,
<code>random_ratio</code>, <code>fill</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1488 ">#1488</a>)</li>
<li>Re-introduce fn <code>Rng::gen_iter</code> as
<code>random_iter</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1305 ">#1305</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1500 ">#1500</a>)</li>
<li>Rename fn <code>Rng::gen</code> to <code>random</code> to avoid
conflict with the new <code>gen</code> keyword in Rust 2024 (<a
href="https://redirect.github.com/rust-random/rand/issues/1438 ">#1438</a>)</li>
<li>Rename fns <code>Rng::gen_range</code> to <code>random_range</code>,
<code>gen_bool</code> to <code>random_bool</code>,
<code>gen_ratio</code> to <code>random_ratio</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1505 ">#1505</a>)</li>
<li>Annotate panicking methods with <code>#[track_caller]</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1442 ">#1442</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1447 ">#1447</a>)</li>
</ul>
<h3>API changes: RNGs</h3>
<ul>
<li>Fix <code><SmallRng as SeedableRng>::Seed</code> size to 256
bits (<a
href="https://redirect.github.com/rust-random/rand/issues/1455 ">#1455</a>)</li>
<li>Remove first parameter (<code>rng</code>) of
<code>ReseedingRng::new</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1533 ">#1533</a>)</li>
</ul>
<h3>API changes: Sequences</h3>
<ul>
<li>Split trait <code>SliceRandom</code> into
<code>IndexedRandom</code>, <code>IndexedMutRandom</code>,
<code>SliceRandom</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1382 ">#1382</a>)</li>
<li>Add <code>IndexedRandom::choose_multiple_array</code>,
<code>index::sample_array</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1453 ">#1453</a>,
<a
href="https://redirect.github.com/rust-random/rand/issues/1469 ">#1469</a>)</li>
</ul>
<h3>API changes: Distributions: renames</h3>
<ul>
<li>Rename module <code>rand::distributions</code> to
<code>rand::distr</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1470 ">#1470</a>)</li>
<li>Rename distribution <code>Standard</code> to
<code>StandardUniform</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1526 ">#1526</a>)</li>
<li>Move <code>distr::Slice</code> ->
<code>distr::slice::Choose</code>, <code>distr::EmptySlice</code> ->
<code>distr::slice::Empty</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1548 ">#1548</a>)</li>
<li>Rename trait <code>distr::DistString</code> ->
<code>distr::SampleString</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1548 ">#1548</a>)</li>
<li>Rename <code>distr::DistIter</code> -> <code>distr::Iter</code>,
<code>distr::DistMap</code> -> <code>distr::Map</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1548 ">#1548</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="96f8df65ee "><code>96f8df6</code></a>
Prepare 0.9.0 release (<a
href="https://redirect.github.com/rust-random/rand/issues/1558 ">#1558</a>)</li>
<li><a
href="34da3214df "><code>34da321</code></a>
Enable <code>stdarch_x86_avx512</code> for cpu has <code>avx512bw</code>
(<a
href="https://redirect.github.com/rust-random/rand/issues/1551 ">#1551</a>)</li>
<li><a
href="b4b1eb7579 "><code>b4b1eb7</code></a>
Re-org with distr::slice, distr::weighted modules (<a
href="https://redirect.github.com/rust-random/rand/issues/1548 ">#1548</a>)</li>
<li><a
href="16eb7de94a "><code>16eb7de</code></a>
Add the <code>thread_rng</code> feature flag (<a
href="https://redirect.github.com/rust-random/rand/issues/1547 ">#1547</a>)</li>
<li><a
href="afa24e49b4 "><code>afa24e4</code></a>
Fix test status badges (<a
href="https://redirect.github.com/rust-random/rand/issues/1544 ">#1544</a>)</li>
<li><a
href="c681dfc345 "><code>c681dfc</code></a>
Create FUNDING.yml</li>
<li><a
href="9f05e22afb "><code>9f05e22</code></a>
Update: getrandom v0.3.0 rc.0 (<a
href="https://redirect.github.com/rust-random/rand/issues/1541 ">#1541</a>)</li>
<li><a
href="88c310b189 "><code>88c310b</code></a>
Fix docs.rs build options (<a
href="https://redirect.github.com/rust-random/rand/issues/1539 ">#1539</a>)</li>
<li><a
href="b879689a60 "><code>b879689</code></a>
Adjust GH Actions (<a
href="https://redirect.github.com/rust-random/rand/issues/1538 ">#1538</a>)</li>
<li><a
href="3fac49fe89 "><code>3fac49f</code></a>
Prepare 0.9.0-beta.0 (<a
href="https://redirect.github.com/rust-random/rand/issues/1535 ">#1535</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-random/rand/compare/0.8.5...0.9.0 ">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: zach <zach@dylibso.com >
2025-02-04 10:21:53 -08:00
zach
1e281e93cd
cleanup: remove android release ( #823 )
...
Also switches to actions-rust-lang/setup-rust-toolchain@v1 since
actions-rs/toolchain is deprecated
2025-01-28 15:53:13 -08:00
zach
f57d987d48
ci: fix android release, attempt #2 ( #818 )
2025-01-21 12:08:18 -08:00
zach
9da6d43f05
ci: install android libunwind before build step ( #817 )
...
Fixes #816
2025-01-21 11:41:10 -08:00
zach
d1a248e19e
cleanup: stop timer from using 100% cpu when no timeouts are set ( #814 )
...
Fixes an issue reported on discord
(https://discord.com/channels/1011124058408112148/1154513155209298041/1329622656235864156 )
where the timer thread is taking up an entire CPU
2025-01-20 14:01:37 -08:00
Benjamin Eckel
a367bc77a3
Add Android targets ( #812 )
...
Closes #811
Keep in mind that these targets seem to be tier 3 support and not quite
stable, but i think it's fine to open for experimenting:
https://docs.wasmtime.dev/stability-tiers.html
2025-01-14 10:23:59 -08:00
Muhammad Azeez
3cfde7966d
Trigger NuGet package publishing when a new release is published ( #805 )
...
This makes sure the latest releases are always available on NuGet too
2024-12-05 19:44:33 +03:00
dependabot[bot]
75428f26e2
chore(deps): Bump dawidd6/action-download-artifact from 2 to 6 in /.github/workflows ( #792 )
...
Bumps
[dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact )
from 2 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dawidd6/action-download-artifact/releases ">dawidd6/action-download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v6</h2>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v5...v6 ">https://github.com/dawidd6/action-download-artifact/compare/v5...v6 </a></p>
<h2>v5</h2>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v4...v5 ">https://github.com/dawidd6/action-download-artifact/compare/v4...v5 </a></p>
<h2>v4</h2>
<h2>What's Changed</h2>
<ul>
<li><strong>VERSIONING CHANGE</strong>: now there will only be major
releases of this action, e.g. v5, v6 and so on</li>
<li>build(deps): bump undici from 5.28.3 to 5.28.4 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/284 ">dawidd6/action-download-artifact#284</a></li>
<li>build(deps): bump <code>@actions/artifact</code> from 2.1.4 to
2.1.5 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/285 ">dawidd6/action-download-artifact#285</a></li>
<li>build(deps): bump <code>@actions/artifact</code> from 2.1.5 to
2.1.7 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/287 ">dawidd6/action-download-artifact#287</a></li>
<li>build(deps): bump adm-zip from 0.5.12 to 0.5.13 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/289 ">dawidd6/action-download-artifact#289</a></li>
<li>Set allow_forks to false by default by <a
href="https://github.com/timweri "><code>@timweri</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/290 ">dawidd6/action-download-artifact#290</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/timweri "><code>@timweri</code></a> made
their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/290 ">dawidd6/action-download-artifact#290</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v3...v4 ">https://github.com/dawidd6/action-download-artifact/compare/v3...v4 </a></p>
<h2>v3.1.4</h2>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump adm-zip from 0.5.10 to 0.5.12 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/282 ">dawidd6/action-download-artifact#282</a></li>
<li>build(deps): bump <code>@actions/artifact</code> from 2.1.2 to
2.1.4 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/280 ">dawidd6/action-download-artifact#280</a></li>
<li>fix: accept expired artifacts with documentation url by <a
href="https://github.com/wdconinc "><code>@wdconinc</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/283 ">dawidd6/action-download-artifact#283</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/wdconinc "><code>@wdconinc</code></a>
made their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/283 ">dawidd6/action-download-artifact#283</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v3...v3.1.4 ">https://github.com/dawidd6/action-download-artifact/compare/v3...v3.1.4 </a></p>
<h2>v3.1.3</h2>
<h2>What's Changed</h2>
<ul>
<li>node_modules: upgrade by <a
href="https://github.com/dawidd6 "><code>@dawidd6</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/276 ">dawidd6/action-download-artifact#276</a></li>
<li>build(deps): bump <code>@actions/artifact</code> from 2.1.1 to
2.1.2 by <a
href="https://github.com/dependabot "><code>@dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/277 ">dawidd6/action-download-artifact#277</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v3.1.2...v3.1.3 ">https://github.com/dawidd6/action-download-artifact/compare/v3.1.2...v3.1.3 </a></p>
<h2>v3.1.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Read workflow_search input as a boolean by <a
href="https://github.com/klutchell "><code>@klutchell</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/273 ">dawidd6/action-download-artifact#273</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/klutchell "><code>@klutchell</code></a>
made their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/273 ">dawidd6/action-download-artifact#273</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v3.1.1...v3.1.2 ">https://github.com/dawidd6/action-download-artifact/compare/v3.1.1...v3.1.2 </a></p>
<h2>v3.1.1</h2>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bf251b5aa9 "><code>bf251b5</code></a>
node_modules: upgrade</li>
<li><a
href="93c6296611 "><code>93c6296</code></a>
README: v5</li>
<li><a
href="deb3bb8325 "><code>deb3bb8</code></a>
node_modules: upgrade</li>
<li><a
href="1d93f37db2 "><code>1d93f37</code></a>
README: v4</li>
<li><a
href="854e2de939 "><code>854e2de</code></a>
Set allow_forks to false by default (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/290 ">#290</a>)</li>
<li><a
href="436c9d3774 "><code>436c9d3</code></a>
build(deps): bump adm-zip from 0.5.12 to 0.5.13 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/289 ">#289</a>)</li>
<li><a
href="14040524bb "><code>1404052</code></a>
build(deps): bump <code>@actions/artifact</code> from 2.1.5 to 2.1.7
(<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/287 ">#287</a>)</li>
<li><a
href="8a9be734dc "><code>8a9be73</code></a>
build(deps): bump <code>@actions/artifact</code> from 2.1.4 to 2.1.5
(<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/285 ">#285</a>)</li>
<li><a
href="df593bbd04 "><code>df593bb</code></a>
build(deps): bump undici from 5.28.3 to 5.28.4 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/284 ">#284</a>)</li>
<li><a
href="09f2f74827 "><code>09f2f74</code></a>
fix: accept expired artifacts with documentation url (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/283 ">#283</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/dawidd6/action-download-artifact/compare/v2...v6 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/extism/extism/network/alerts ).
</details>
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 07:50:29 -08:00
zach
14477ceb39
feat: add CompiledPlugin ( #784 )
2024-11-14 12:32:22 -08:00
Benjamin Eckel
f52969aadb
Add codeowners file ( #780 )
2024-10-22 09:35:04 -07:00
Gavin Hayes
00074fd56d
feat: add releasing x86_64-unknown-linux-musl dynamic library ( #753 )
...
Fixes https://github.com/extism/extism/issues/735
2024-08-19 14:46:08 -04:00
Chris Dickinson
5d9c8c5d05
feat: per call context ( #711 )
...
Add `plugin.call_with_host_context` and `current_plugin.host_context`
methods, enabling per-call context to be looped from the guest invocation
to any host functions it calls. In an HTTP server environment, this enables
re-using a plugin across multiple requests while switching out backing
connections and user information in host functions. (Imagine a host
function, `update_user` -- previously the plugin would have to have been
aware of the user to pass to the host function. Now that information is
ambient.)
This is a backwards-compatible change and requires no changes to
existing plugins.
Implement by adding a global, mutable externref to the extism kernel.
Since most programming languages, including Rust, don't let you define
these natively, we accomplish this by using `wasm-merge` to combine the
kernel Wasm with Wasm generated by a WAT file containing only the
global.
(This pattern might be useful for other Wasm constructs we can't use
directly from Rust, like `v128` in argument parameters.)
Wasmtime requires extern refs to be `Any + Send + Sync + 'static`; we
additionally add `Clone`. I haven't tried this with an `Arc` directly,
but it should work at least for container structs that hold `Arc`'s
themselves.
2024-05-21 11:53:43 -07:00
zach
62f0a231b0
ci: add release workflow for convert-macros crate ( #683 )
2024-02-14 09:18:28 -08:00
Marton Soos
0b4b732eb8
fix(kernel): Fix calculation of handle offset when splitting re-used memory, add kernel test ( #659 )
2024-01-17 15:15:51 -08:00
Steve Manuel
9aee9d8ca5
feat: update README ( #655 )
...
Gives the README a bit of a refresh.
---------
Co-authored-by: Benjamin Eckel <bhelx@simst.im >
2024-01-09 07:30:30 -07:00
Muhammad Azeez
49e28892bc
ci: release extism.dll.lib and extism.dll.a ( #633 )
...
Related to #141 and #584
Follow up of #632
2023-12-13 22:29:29 +03:00
Muhammad Azeez
c7a68ed757
ci: bring back nuget packages for Extism runtime ( #624 )
...
Seems like these accidentally got removed in #583
2023-12-05 22:32:53 +03:00
Chris Dickinson
528ae6f6a5
build: combine rust release workflows ( #611 )
...
Okay, phew.
The main bug from the [last
PR](https://github.com/extism/extism/pull/610 ) was that the rust
releases scramble to publish, but we have to publish them in a
particular order for the release to work since they depend on each
other.
There's a secondary bug: `cargo publish` is prone to 502'ing on publish.
I lean towards seeing how painful this is in practice; we should be able
to safely re-run the release flow on failure.
2023-12-01 11:51:18 -08:00
Chris Dickinson
06706f07be
build: drive cargo releases from git tag ( #610 )
...
Follow-up to f7d297f98f .
Update the release workflows for the dependent crates. The Cargo
workflows run on GitHub release publish to match the Python package
release workflow. This means all of our crates are versioned in lockstep
by the Git tag.
There are four changes:
1. Trigger the workflows on GitHub release publish
2. Add the `set version` step from `release.yml` to modify the version
tags in `Cargo.toml`.
3. Publish with `--allow-dirty` (to account for the edit in step 2)
4. In `extism-maturin`, do not inherit `authors` from the workspace
since [PyPI rejects the value we have
set](https://github.com/extism/extism/actions/runs/7012534645/job/19077216730#step:7:23 ).
2023-11-27 17:28:56 -08:00
Chris Dickinson
f7d297f98f
build: drive crate versions from workspace; drive workspace version from ci ( #604 )
...
This is an attempt to sand down [a sharp
edge](https://github.com/extism/extism/actions/runs/6949120346/job/18906546065#step:4:476 )
around releases – keeping the `Cargo.toml` versions in-sync with the
release tag, & the versions of the workspace crates aligned with one
another.
2023-11-27 16:14:56 -08:00
zach
a94a0a7a15
cleanup: remove old SDKs ( #583 )
...
Removes all SDKs but the Rust SDK/runtime and the C SDK, which is
automatically generated from the Rust crate.
---------
Co-authored-by: Ben <ben@dylibso.com >
Co-authored-by: Steve <steve@dylibso.com >
Co-authored-by: Rob <rob@dylibso.com >
Co-authored-by: Muhammad <muhammad@dylibso.com >
Co-authored-by: Gavin <gavin@dylibso.com >
Co-authored-by: Chris <chris@dylibso.com >
Co-authored-by: Dom <dom@dylibso.com >
Co-authored-by: Charles <charles@dylibso.com >
2023-11-27 11:19:17 -08:00
George Hopkins
14248f8e17
ci: check formatting of all crates ( #598 )
...
Check formatting of all crates to ensure the whole codebase stays
formatted.
2023-11-20 06:34:04 -08:00
Muhammad Azeez
0f3b485813
Update release-dotnet-native.yaml to be resilient against file name changes ( #589 )
...
Seems like the assets now include version numbers in their name
2023-11-19 13:50:51 +03:00
Muhammad Azeez
2fb29025c9
fix: nuget packing in release-dotnet-native.yaml ( #524 )
...
Seems like there are some weird subtle differences between Windows and
Linux
2023-11-09 10:00:35 +03:00
Gavin Hayes
9992d34510
feat: add x86_64-unknown-linux-musl target, specifying target to make ( #571 )
...
The `x86_64-unknown-linux-musl` target does not build dynamic libraries
for now:
```
warning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`
```
A target may now be optionally specified to the root `Makefile`,
example:
`make RUST_TARGET=x86_64-unknown-linux-musl && sudo make
RUST_TARGET=x86_64-unknown-linux-musl install`
The new musl targets may be used to create entirely static binaries with
libextism. See the new `musl-static` target in `libextism/Makefile`
2023-11-06 17:06:44 -05:00
Gavin Hayes
1aff1ce69c
feat: pkg-config ( #559 )
...
Adds `pkg-config` configs for dynamic and static builds of libextism.
Example usage is shown in `libextism/Makefile`.
Added the `.in` versions of the `.pc` files to non-MSVC releases.
2023-11-02 19:38:50 -04:00
zach
f3447a538c
refactor!: Use extism:host/env namespace for extism functions and extism:host/user for user-defined host functions ( #511 )
...
See #504
Removes CI for the in-repo SDKs, we can remove the actual code closer to
the 1.0 release.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zshipko <zshipko@users.noreply.github.com >
2023-10-30 11:43:40 -07:00
Gavin Hayes
fab44c5db8
feat: build static libextism ( #552 )
...
* libextism is now built to crate-type `staticlib` as recommend by
@zshipko
* updated `Makefile` to install and uninstall the static library.
* updated c example to have `static` target to link libextism statically
* Compiler is no longer hardcoded to `clang`. Set `CC` to use a compiler
other than the system compiler. Tested with `gcc` and `clang`.
* added `static-artifact` to actions release. Untested as it's only ran
on push with tag.
---------
Co-authored-by: zach <zach@dylibso.com >
2023-10-27 19:10:57 -04:00
Chris Dickinson
c2910bdc60
fix(release): bump maturin manylinux floor for ring 0.17 dep ( #548 )
...
An update to `ring` broke the maturin-extism builds. Tracked this down
to [1]; the maintainers of `ring` don't intend to support linux sysroots
that old. This PR updates the ARM Linux builds in particular to pull in
a newer manylinux target. Tested on a [private
fork](https://github.com/extism/dev-extism/actions/runs/6644247344 ) of
the extism repo.
[1]: https://github.com/briansmith/ring/issues/1728
2023-10-25 13:34:34 -07:00
Chance Snow
abb31ee7de
feat(dlang): Add a D host SDK ( #412 )
...
See [dlang.org](https://dlang.org ).
SDK Coverage: ~91.30% (21/23)
## Issues
- [x] These symbols are undefined in the latest release
([v0.5.2](https://github.com/extism/extism/releases/tag/v0.5.2 )):
> Undefined symbols for architecture x86_64:
> "_extism_plugin_id"
> "_extism_plugin_new_error_free"
Using `libextism` compiled from source does _not_ have this issue.
- [ ] `dub lint` reads many intermediate targets files:
https://github.com/dlang/dub/issues/2700
## Todo List
- [x] Flesh out initial binding
- [ ] Cover host API:
- [x] `ExtismFunctionType`
See `FunctionType` alias.
- [x] `extism_plugin_id`
- [x] `extism_plugin_new_error_free`
- [ ] `extism_plugin_error`
- [ ] Add unit tests
- [x] Add usage example
---------
Co-authored-by: zach <zachshipko@gmail.com >
2023-10-23 16:00:17 -05:00
Muhammad Azeez
2c82b928ab
ci(dotnet): publish nuget packages for all supported environments ( #523 )
...
NuGet supports the distribution of native binaries. We already provide a
win-x64 package, this PR adds packages for the other environments. We
will be publishing these NuGet packages:
- Extism.runtime.linux-arm64
- Extism.runtime.linux-musl-arm64
- Extism.runtime.linux-x64
- Extism.runtime.osx-arm64
- Extism.runtime.osx-x64
- Extism.runtime.win-x64 (msvc)
- Extism.runtime.all -> this is a meta package that referencs all other
packages. The idea is, in the getting started guides we instruct the
user to take a dependency on `Extism.Sdk` and `Extism.runtime.all`. This
will make sure their apps work on all supported operating systems
automatically. Otherwise, they can just take a dependency on what they
care about
This PR also adds a dependency on
[MinVer](https://github.com/adamralph/minver ) which make sure packages
are automatically versioned based on git tags.
Related to #486
2023-10-18 10:47:16 +03:00
Chris Dickinson
6e0fd3baa1
fix(build): release-python: disable unused poetry caching
...
This workflow only _uploads_ existing artifacts, so keeping a poetry
cache around just, uh, breaks the workflow since there's no `Poetry.lock`
to cache.
2023-10-16 11:01:32 -07:00
zach
6f4b43bedc
feat: add benchmarking, optimize bounds checking in the kernel ( #505 )
...
- Adds benchmarking, run with `cargo bench` or `cargo criterion`
- Adds `MemoryRoot::pointer_in_bounds_fast` to do less precise bounds
checking in loads/stores
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zshipko <zshipko@users.noreply.github.com >
2023-10-12 13:24:34 -07:00
Chris Dickinson
59e8335f17
feat(build): GHA release-python now releases extism_sys packages ( #498 )
...
This changes the workflow slightly: whenever we publish a draft release,
download our `*.whl` assets from that release and publish them to PyPI.
2023-10-05 16:32:34 -07:00
zach
e7ffc1dd6b
ci: fix name
2023-10-04 12:37:29 -07:00
zach
d994f081f9
chore: prepare extism-convert to be released ( #494 )
2023-10-04 12:35:43 -07:00
Chris Dickinson
be646480b9
fix(build): remove windows gnu wheel builds ( #481 )
...
Maturin on Windows struggles with GNU headers. Since we have windows
MSVC wheel builds, this commit disables windows GNU wheel builds.
Also: fix a bug where the produced wheels did not include any extism
functions.
2023-09-22 12:34:47 -07:00
Chris Dickinson
8426e1a0a6
feat(build): add extism-maturin wheel builds ( #480 )
...
Build the python native library along with libextism since they change
at roughly the same rate; we can pull the resulting wheels into
python-sdk as needed.
Reduce the release job into a single matrix of `OS x RUST TARGET` – this
unifies the macos, windows, and linux builds into a single job.
---
**BREAKING CHANGE**: This changes the trigger for the release workflow.
Instead of being triggered by the creation of a release, it is triggered
by pushing new git tags. It will catch `v*` – `v0.5.0`, `v200.0.1-dev`
for example. The workflow creates a draft release.
2023-09-21 13:18:49 -07:00
zach
6e8c28b0e9
fix(main): improve the way the kernel calculates how many pages to allocate ( #472 )
...
Same as #471 for `main` branch
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zshipko <zshipko@users.noreply.github.com >
2023-09-20 16:25:48 -07:00
zach
28074af2b9
ci: automate PRs to build canonical version of extism-runtime.wasm ( #473 )
...
Closes #469
This PR adds a github workflow that is triggered by updates to the
`kernel/` directory or `runtime/src/extism-kernel.wasm` - it builds the
kernel, including using `wasm-strip` and makes a PR against any PR that
has a kernel module that doesn't match the expected output.
I had considered making this run when the PR is merged into main, but
this approach gives us a chance to run CI with the generated wasm file.
I think automatically adding a commit would be simpler, but this way
seems more transparent.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zshipko <zshipko@users.noreply.github.com >
2023-09-20 15:21:42 -07:00
Chris Dickinson
ab458ebd44
feat(build): Add "latest" snapshot builds ( #457 )
...
Add a "latest" snapshot that other libraries can use to test against the
latest version of Extism.
Add caching for builds triggered by pushes to `main`.
2023-09-15 10:03:04 -07:00
zach
cb55e52506
feat: Add extism-convert crate and use it for input/output to plugin calls ( #443 )
...
- Adds `extism-convert` crate with `ToBytes`, `FromBytes` and
`FromBytesOwned` traits
- This serves as a single interface for reading/writing rich types from
WebAssembly linear memory.
- Supports `Json` and `Msgpack` and `Protobuf` encodings out-of-the-box
- Updates `Plugin::call` to take `ToBytes` as the input argument and
return a `FromBytes` value
- Adds `host_fn!` macro to simplify host function creation
- Cleans up generated documentation a little
- PR for the Rust PDK: https://github.com/extism/rust-pdk/pull/31
- Adds a `typed_plugin!` macro to implement type-safe wrappers around
`Plugin`
- After this we should focus on adding similar type-conversion helpers
to the SDKs and other PDKs to make it easier to use across languages.
For example, a Python host running a Rust plugin using Msgpack encoded
types.
## Examples
### Calling a function
Instead of the untyped, bytes-only `call` function:
```rust
let output = plugin.call("func_name", "my data").unwrap();
let output: MyType = serde_json::from_slice(&output).unwrap();
```
We can now use richer types to encode/decode our values directly when
using `call`:
```rust
let Json(output) = plugin.call::<_, Json<MyType>>("func_name", "my data").unwrap();
```
### Allocating inside of a host function
The same interface works for host functions, so instead of:
```rust
fn hello_world(
plugin: &mut CurrentPlugin,
inputs: &[Val],
outputs: &mut [Val],
_user_data: UserData,
) -> Result<(), Error> {
let handle = plugin.memory_handle_val(&inputs[0])?;
let input = plugin.memory_read_str(handle)?;
let output = plugin.memory_alloc_bytes(&input).unwrap();
outputs[0] = output.into();
Ok(())
}
```
Becomes:
```rust
fn hello_world(
plugin: &mut CurrentPlugin,
inputs: &[Val],
outputs: &mut [Val],
_user_data: UserData,
) -> Result<(), Error> {
let my_value: String = plugin.memory_get_val(&inputs[0])?;
let output = plugin.memory_new(&my_value)?;
outputs[0] = plugin.memory_to_val(output);
Ok(())
}
```
Although this isn't much of an improvement, using the `host_fn` macro,
we can really begin to see how the above function is really just an
identity function:
```rust
host_fn!(hello_world(a: String) -> String {
a
});
```
### typed_plugin!
`typed_plugin!` is used to make a typed wrapper around a Plugin:
```rust
/// Create the typed plugin
typed_plugin!(Testing {
count_vowels(&str) -> Json<Count>
});
/// Create the `Plugin` and convert it to `Testing` wrapper
let mut plugin: Testing = Plugin::new(WASM, [f], true).unwrap().into();
/// Call the `count_vowels` function:
let Json(output0): Json<Count> = plugin.count_vowels("abc123")?;
```
It could make sense to convert `host_fn` and/or `typed_plugin` to
proc-macros at some point, but for now they work and provide some
flexibility in experimenting with the interfaces. Another future update
could be to figure out a nice way to make it so input can be written in
multiple chunks, so the entire input doesn't have to get copied into
memory at once.
2023-09-14 12:32:38 -07:00
zach
ddcbeec3de
refactor!: Remove context, unify extism-runtime and extism crates ( #421 )
...
- Removes the `ExtismContext` type from runtime and all SDKs
- Removed SDK functions: `extism_context_new`, `extism_context_reset`,
`extism_context_free`
- All SDKs have been updated, but there are still some TODOs below
- Removes `extism_plugin_update`
- Plugins can no longer be updated - a new plugin should be created
instead
- Adds `extism_plugin_id` to uniquely identify plugins
- Merges the `extism-runtime` and `extism` crates (there is no longer an
`extism-runtime` crate)
- Makes `extism::Manifest` an alias for `extism_manifest::Manifest`
instead of a distinct type
- Adds `MemoryHandle` type to SDKs to refer to blocks of Extism memory
that can be accessed in host functions
- Improves thread-safety of Plugins, adds C++ test to call a single
plugin from multiple threads.
- Expands wasmtime bounds to include 12.0
2023-08-29 13:57:17 -07:00