diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd91def..af89225 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,11 +12,12 @@ on: jobs: build: - runs-on: windows-latest - name: Build with Dotnet ${{ matrix.dotnet }} + runs-on: ${{ matrix.os }} + name: Build on ${{ matrix.os }} with Dotnet ${{ matrix.dotnet }} strategy: matrix: dotnet: [ '8.x', '9.0.100-preview.4.24267.66'] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v4 - name: Setup .NET @@ -36,7 +37,8 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: nuget-packages + name: nuget-packages-${{ matrix.os }} path: artifacts/*.nupkg if-no-files-found: error if: ${{ matrix.dotnet == '8.x' }} # only need one package published https://github.com/actions/upload-artifact?tab=readme-ov-file#not-uploading-to-the-same-artifact + diff --git a/.gitignore b/.gitignore index 60bcf98..1934a26 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ obj/ .vs/ artifacts/ test/WasmComponentSdkTest/testapps/OciWit/wit +*.binlog .DS_Store diff --git a/Directory.Packages.props b/Directory.Packages.props index d946bd8..fc21d41 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,8 +4,8 @@ - - + + diff --git a/samples/calculator/Adder/Adder.csproj b/samples/calculator/Adder/Adder.csproj index 4bdb818..f33449c 100644 --- a/samples/calculator/Adder/Adder.csproj +++ b/samples/calculator/Adder/Adder.csproj @@ -11,6 +11,9 @@ true wasi-wasm + + + adder diff --git a/samples/calculator/CalculatorComposed/CalculatorComposed.csproj b/samples/calculator/CalculatorComposed/CalculatorComposed.csproj index c1d528f..4cfa6db 100644 --- a/samples/calculator/CalculatorComposed/CalculatorComposed.csproj +++ b/samples/calculator/CalculatorComposed/CalculatorComposed.csproj @@ -17,7 +17,7 @@ - ../CalculatorHost/bin/$(Configuration)/$(TargetFramework)/wasi-wasm/native/calculatorhost.wasm + ../CalculatorHost/bin/$(Configuration)/$(TargetFramework)/wasi-wasm/native/CalculatorHost.wasm ../Adder/bin/$(Configuration)/$(TargetFramework)/wasi-wasm/native/adder.wasm diff --git a/src/WasmComponent.Sdk/ImportInDev.proj b/src/WasmComponent.Sdk/ImportInDev.proj index 86e906a..51dc543 100644 --- a/src/WasmComponent.Sdk/ImportInDev.proj +++ b/src/WasmComponent.Sdk/ImportInDev.proj @@ -7,6 +7,6 @@ - + diff --git a/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj b/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj index 519b79d..d09c663 100644 --- a/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj +++ b/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj @@ -32,7 +32,7 @@ - + @@ -67,7 +67,9 @@ - + + diff --git a/src/WasmComponent.Sdk/build/ByteCodeAlliance.Componentize.DotNet.Wasm.SDK.props b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props similarity index 100% rename from src/WasmComponent.Sdk/build/ByteCodeAlliance.Componentize.DotNet.Wasm.SDK.props rename to src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props diff --git a/src/WasmComponent.Sdk/build/ByteCodeAlliance.Componentize.DotNet.Wasm.SDK.targets b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets similarity index 100% rename from src/WasmComponent.Sdk/build/ByteCodeAlliance.Componentize.DotNet.Wasm.SDK.targets rename to src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets diff --git a/src/WitBindgen/WitBindgen.csproj b/src/WitBindgen/WitBindgen.csproj index a92eceb..7858156 100644 --- a/src/WitBindgen/WitBindgen.csproj +++ b/src/WitBindgen/WitBindgen.csproj @@ -62,7 +62,8 @@ - + + @@ -79,6 +80,7 @@ + diff --git a/src/WitBindgen/build/ByteCodeAlliance.Componentize.DotNet.WitBindgen.props b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.props similarity index 100% rename from src/WitBindgen/build/ByteCodeAlliance.Componentize.DotNet.WitBindgen.props rename to src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.props diff --git a/src/WitBindgen/build/ByteCodeAlliance.Componentize.DotNet.WitBindgen.targets b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets similarity index 100% rename from src/WitBindgen/build/ByteCodeAlliance.Componentize.DotNet.WitBindgen.targets rename to src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets diff --git a/test/E2ETest/PackageTest/PackageTest.csproj b/test/E2ETest/PackageTest/PackageTest.csproj index 8509b2b..a94f4f9 100644 --- a/test/E2ETest/PackageTest/PackageTest.csproj +++ b/test/E2ETest/PackageTest/PackageTest.csproj @@ -38,7 +38,7 @@ - + diff --git a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj index 676b5c4..806e33b 100644 --- a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj +++ b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj @@ -13,6 +13,7 @@ wasi-wasm false true + e2econsumer diff --git a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj index a29197f..141022c 100644 --- a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj +++ b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj @@ -11,6 +11,7 @@ true wasi-wasm true + e2eproducer diff --git a/test/E2ETest/testapps/nuget.config b/test/E2ETest/testapps/nuget.config index 3fb15a2..40f6b38 100644 --- a/test/E2ETest/testapps/nuget.config +++ b/test/E2ETest/testapps/nuget.config @@ -1,7 +1,7 @@ - + diff --git a/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs b/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs index cb73d77..ba08a91 100644 --- a/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs +++ b/test/WasmComponentSdkTest/WasmComponentSdkTest/SimpleProducerConsumerTest.cs @@ -89,6 +89,11 @@ private static string FindModulePath(string searchDir, string filename) } var matches = Directory.GetFiles(resolvedSearchDir, filename, SearchOption.AllDirectories); + if (matches.Count() != 1) + { + throw new Exception($"Failed to get modules path, matched {matches.Count()} entries for directory {resolvedSearchDir} and filename {filename}."); + } + return Path.GetFullPath(matches.Single()); } } diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj index 7962b9c..0120f43 100644 --- a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj +++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj @@ -11,6 +11,7 @@ true wasi-wasm + appwithwitfolder diff --git a/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj b/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj index d19847a..89cb397 100644 --- a/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj +++ b/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj @@ -9,6 +9,7 @@ true wasi-wasm + ociwit diff --git a/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj b/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj index fba60f0..bb390be 100644 --- a/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj +++ b/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj @@ -11,6 +11,7 @@ true wasi-wasm + simpleconsumer @@ -31,7 +32,7 @@ - + diff --git a/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj b/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj index 48da1e2..ecab52f 100644 --- a/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj +++ b/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj @@ -10,6 +10,8 @@ true wasi-wasm + + simpleproducer diff --git a/test/WasmtimeCliFetcher/FetchWasmtime.targets b/test/WasmtimeCliFetcher/FetchWasmtime.targets index 5a4dd36..50d62e9 100644 --- a/test/WasmtimeCliFetcher/FetchWasmtime.targets +++ b/test/WasmtimeCliFetcher/FetchWasmtime.targets @@ -14,7 +14,7 @@ $(MSBuildThisFileDirectory)tools\version-$(WasmtimeVersion) - .tar.gz + .tar.xz .zip https://github.com/bytecodealliance/wasmtime/releases/download/v$(WasmtimeVersion)/wasmtime-v$(WasmtimeVersion)-$(WasmtimeTarget)$(WasmtimeUrlExtension) diff --git a/test/WitBindgenTest/WitBindgenTest/CodeGenerationTest.cs b/test/WitBindgenTest/WitBindgenTest/CodeGenerationTest.cs index b449260..576dc10 100644 --- a/test/WitBindgenTest/WitBindgenTest/CodeGenerationTest.cs +++ b/test/WitBindgenTest/WitBindgenTest/CodeGenerationTest.cs @@ -1,5 +1,6 @@ using MyFuncsWorld; using ProducerWorld; +using System; using Xunit; namespace WitBindgenTest; @@ -14,7 +15,8 @@ public void GeneratesSimpleImport() LibraryUsingWit.Code.CallSimpleDoSomething()); // Currently, it generates [DllImport("*", ...)] so validate that - Assert.StartsWith("Unable to load DLL", ex.Message); + var expectedErrorMessagePrefix = "Unable to load " + (OperatingSystem.IsWindows() ? "DLL" : "shared library"); + Assert.StartsWith(expectedErrorMessagePrefix, ex.Message); } [Fact]