Skip to content

Commit 89db099

Browse files
committed
Update readme to support Linux
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent ed64868 commit 89db099

File tree

20 files changed

+59
-41
lines changed

20 files changed

+59
-41
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Build on ${{ matrix.os }} with Dotnet ${{ matrix.dotnet }}
1717
strategy:
1818
matrix:
19-
dotnet: [ '8.x', '9.0.100-rc.1.24452.12']
19+
dotnet: [ '9.x']
2020
os: [ubuntu-latest, windows-latest]
2121
steps:
2222
- uses: actions/checkout@v4
@@ -42,5 +42,5 @@ jobs:
4242
name: nuget-packages
4343
path: artifacts/*.nupkg
4444
if-no-files-found: error
45-
if: ${{ matrix.dotnet == '8.x' && matrix.os == 'windows-latest' }}
45+
if: ${{ matrix.dotnet == '9.x' && matrix.os == 'windows-latest' }}
4646

Directory.Packages.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
</PropertyGroup>
55
<ItemGroup>
66
<!-- find latest versions at https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental by name of package -->
7-
<PackageVersion Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-alpha.1.24525.6" />
8-
<PackageVersion Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-alpha.1.24525.6" />
7+
<PackageVersion Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-alpha.1.24573.1" />
8+
<PackageVersion Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-alpha.1.24573.1" />
99

1010
<!-- Tests -->
11-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
12-
<PackageVersion Include="xunit" Version="2.4.2" />
13-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
12+
<PackageVersion Include="xunit" Version="2.9.2" />
13+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
1414
</ItemGroup>
1515
</Project>

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ With this package, you can add one NuGet reference. The build output is fully AO
2424

2525
### 1. Set up SDKs
2626

27-
If you don't already have it, install [.NET 8+ SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
27+
If you don't already have it, install [.NET 9+ SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
2828

2929
### 2. Create a project and add BytecodeAlliance.Componentize.DotNet.Wasm.SDK package
3030

@@ -43,21 +43,21 @@ Create a `nuget.config` file and add the `dotnet-experimental` package source fo
4343

4444
Add the `componentize-dotnet` package:
4545

46-
* `dotnet add package BytecodeAlliance.Componentize.DotNet.Wasm.SDK --prerelease`
46+
`dotnet add package BytecodeAlliance.Componentize.DotNet.Wasm.SDK --prerelease`
4747

48-
### 3. Configure the compilation output
48+
Add the platform specific LLVM package:
4949

50-
Edit the `.csproj` file, adding the following inside the `<PropertyGroup>`:
50+
```
51+
## On Linux
52+
dotnet add package runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm --version 10.0.0-alpha.1.24573.1 --prerelease
5153
52-
```xml
53-
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
54-
<UseAppHost>false</UseAppHost>
55-
<PublishTrimmed>true</PublishTrimmed>
56-
<InvariantGlobalization>true</InvariantGlobalization>
57-
<SelfContained>true</SelfContained>
54+
## or
55+
56+
## On Windows
57+
dotnet add package runtime.windows-x64.microsoft.dotnet.ilcompiler.llvm --version 10.0.0-alpha.1.24573.1 --prerelease
5858
```
5959

60-
Now you can `dotnet build` to produce a `.wasm` file using NativeAOT compilation.
60+
Now you can `dotnet publish` to produce a `.wasm` file using NativeAOT compilation.
6161

6262
### 4. Run the WebAssembly binary
6363

samples/calculator/Adder/Adder.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55

66
<PropertyGroup>
77
<OutputType>Library</OutputType>
8-
<TargetFramework>net8.0</TargetFramework>
8+
<TargetFramework>net9.0</TargetFramework>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<Nullable>enable</Nullable>
1111

12-
<InvariantGlobalization>true</InvariantGlobalization>
1312
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
1413

1514
<!-- Need kebab case -->
@@ -18,6 +17,7 @@
1817

1918
<ItemGroup>
2019
<ProjectReference Include="..\..\..\src\WasmComponent.Sdk\WasmComponent.Sdk.csproj" />
20+
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM"/>
2121
</ItemGroup>
2222

2323
<ItemGroup>

samples/calculator/CalculatorComposed/CalculatorComposed.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
<!-- and express a dependency on the two implementation components. -->
88

99
<PropertyGroup>
10-
<TargetFramework>net8.0</TargetFramework>
10+
<TargetFramework>net9.0</TargetFramework>
1111
</PropertyGroup>
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\Adder\Adder.csproj" ReferenceOutputAssembly="false" />
1515
<ProjectReference Include="..\CalculatorHost\CalculatorHost.csproj" ReferenceOutputAssembly="false" />
16+
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM"/>
1617
</ItemGroup>
1718

1819
<Target Name="ComposeWasmComponent" AfterTargets="AfterBuild">

samples/calculator/CalculatorHost/CalculatorHost.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55

66
<PropertyGroup>
77
<OutputType>Exe</OutputType>
8-
<TargetFramework>net8.0</TargetFramework>
8+
<TargetFramework>net9.0</TargetFramework>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<Nullable>enable</Nullable>
1111

12-
<InvariantGlobalization>true</InvariantGlobalization>
13-
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
1412
<IlcExportUnmanagedEntrypoints>true</IlcExportUnmanagedEntrypoints>
1513
</PropertyGroup>
1614

1715
<ItemGroup>
1816
<ProjectReference Include="..\..\..\src\WasmComponent.Sdk\WasmComponent.Sdk.csproj" />
17+
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM"/>
1918
</ItemGroup>
2019

2120
<ItemGroup>

src/WasmComponent.Sdk/WasmComponent.Sdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageTags>webassembly, .net, wasm</PackageTags>
1212
<PackageReleaseNotes>https://github.com/bytecodealliance/componentize-dotnet/releases/tag/$(PackageVersion)</PackageReleaseNotes>
1313

14-
<TargetFramework>net8.0</TargetFramework>
14+
<TargetFramework>net9.0</TargetFramework>
1515
<ImplicitUsings>enable</ImplicitUsings>
1616
<Nullable>enable</Nullable>
1717
<IsPackable>true</IsPackable>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<Project>
22
<PropertyGroup>
3-
<PublishTrimmed>true</PublishTrimmed>
4-
<UseAppHost>false</UseAppHost>
53
<MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver>
64

5+
<!-- Set these by default -->
6+
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
7+
<UseAppHost>false</UseAppHost>
8+
<PublishTrimmed>true</PublishTrimmed>
9+
<InvariantGlobalization>true</InvariantGlobalization>
10+
<SelfContained>true</SelfContained>
11+
712
<WasmToolsTarget Condition="$([MSBuild]::IsOSPlatform('Windows'))">win</WasmToolsTarget>
813
<WasmToolsTarget Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux</WasmToolsTarget>
914
<WasmToolsTarget Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx</WasmToolsTarget>
@@ -14,6 +19,5 @@
1419

1520
<ItemGroup>
1621
<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" PrivateAssets="None" />
17-
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM" PrivateAssets="None" />
1822
</ItemGroup>
1923
</Project>

src/WitBindgen/WitBindgen.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageTags>webassembly, .net, wasm</PackageTags>
1212
<PackageReleaseNotes>https://github.com/bytecodealliance/componentize-dotnet/releases/tag/$(PackageVersion)</PackageReleaseNotes>
1313

14-
<TargetFramework>net8.0</TargetFramework>
14+
<TargetFramework>net9.0</TargetFramework>
1515
<ImplicitUsings>enable</ImplicitUsings>
1616
<Nullable>enable</Nullable>
1717
<IsPackable>true</IsPackable>

test/E2ETest/PackageTest/PackageTest.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\WasmtimeCliFetcher\FetchWasmtime.targets" />
33

44
<PropertyGroup>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88

@@ -28,6 +28,7 @@
2828

2929
<!-- To ensure we don't build this until we've built the underlying packages -->
3030
<ProjectReference Include="..\..\..\src\WasmComponent.Sdk\WasmComponent.Sdk.csproj" ReferenceOutputAssembly="false" />
31+
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM"/>
3132
</ItemGroup>
3233

3334
<!-- The next targets (+ nuget.config in folder above) ensures we have the latest nuget packages for the e2e test since there is no great way to force a project to use a particular nuget pacakage -->

0 commit comments

Comments
 (0)