Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,6 @@ If you get a build error along the lines of _failed to encode a component from m
* `dotnet new console -o MyApp`
* `cd MyApp`

Create a `nuget.config` file and add the `dotnet-experimental` package source for the `NativeAOT-LLVM` dependency:

* `dotnet new nugetconfig`
* Add these keys to `nuget.config` after `<clear />`:

```xml
<add key="dotnet-experimental" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
```
Edit the `.csproj` file:

1. Add the following line under `<Project>`:
Expand All @@ -276,7 +267,6 @@ Edit the `.csproj` file:

```xml
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
<UseAppHost>false</UseAppHost>
<PublishTrimmed>true</PublishTrimmed>
<InvariantGlobalization>true</InvariantGlobalization>
<SelfContained>true</SelfContained>
Expand Down Expand Up @@ -304,6 +294,18 @@ Caused by:

Some imports automatically imported since they are so common. In this case you should tell the runtime to implement those imports. For instance for the error above, in wasmtime you might add `-S cli` to the `wasmtime serve` command like `wasmtime serve -S cli` to include the `wasi:cli/environment@0.2.0` in wasmtime runtime host implementation.

## SDK configuration
You can configure the SDK by setting properties in your project file. The following are supported:

| Property Name | Description | Default |
|---------------|-------------|---------|
| `WasiSdkVersion` | Version of the WASI SDK to use.<br />Beware that not all versions of the WASI SDK are compatible with NativeAOT-LLVM. You'll see an warning if you pick an incompatible version from NativeAOT-LLVM.<br /><br />⚠️ When changing this value, or the NativeAOT-LLVM version, check the build output for any warnings! | `24.0` |
| `NativeAotLlvmVersion` | Version of the NativeAOT-LLVM package to use.<br />Find latest versions in the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet/Microsoft.DotNet.ILCompiler.LLVM/versions). | `10.0.0-alpha.1.25162.1` |
| `WitBindgenVersion` | Version of the `BytecodeAlliance.Componentize.DotNet.WitBindgen` package to use. | Current SDK version |
| `RegisterExperimentalNuGetSource` | Whether to register the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet) to find the NativeAOT-LLVM package. Set this to `false` if you have a NuGet.config that already includes this feed. | `true` |
| `WitBindgenAddtionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple args with spaces. | (empty) |
| `WitGeneratedFilesRoot` | Folder to place generated WIT files. Relative to the project root. | (empty) |

## Credits

This project was original developed and forked from https://github.com/SteveSandersonMS/wasm-component-sdk under the Apache 2.0 License with a LLVM exception.
Expand Down
10 changes: 0 additions & 10 deletions nuget.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@

<!-- find latest versions at https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental by name of package -->
<NativeAotLlvmVersion Condition="'$(NativeAotLlvmVersion)' == ''">10.0.0-alpha.1.25162.1</NativeAotLlvmVersion>
<RegisterExperimentalNuGetSource Condition="'$(RegisterExperimentalNuGetSource)' == ''">true</RegisterExperimentalNuGetSource>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).microsoft.dotnet.ilcompiler.llvm" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<Project>
<PropertyGroup Condition="'$(RegisterExperimentalNuGetSource)' == 'true'">
<RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json;</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).microsoft.dotnet.ilcompiler.llvm" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
</ItemGroup>

<!--
This links the publish step with the build so that when a user runs `dotnet build` they get a wasm file.
-->
Expand Down
9 changes: 0 additions & 9 deletions templates/content/wasi-cli/nuget.config

This file was deleted.

Loading