Browse Source

Merge pull request #676 from peterhuene/fix-dotnet-interop

Fix .NET interop issue for Windows release builds.
pull/680/head
Peter Huene 5 years ago
committed by GitHub
parent
commit
b7c8408978
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      .github/workflows/main.yml
  2. 6
      crates/api/src/wasm.rs
  3. 2
      crates/misc/dotnet/src/ValueKind.cs

31
.github/workflows/main.yml

@ -330,7 +330,26 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] build: [linux-debug, linux-release, macos-debug, macos-release, windows-debug, windows-release]
include:
- build: linux-debug
os: ubuntu-latest
config: debug
- build: linux-release
os: ubuntu-latest
config: release
- build: macos-debug
os: macos-latest
config: debug
- build: macos-release
os: macos-latest
config: release
- build: windows-debug
os: windows-latest
config: debug
- build: windows-release
os: windows-latest
config: release
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
@ -341,12 +360,14 @@ jobs:
- uses: actions/setup-dotnet@v1 - uses: actions/setup-dotnet@v1
with: with:
dotnet-version: '3.0.101' dotnet-version: '3.0.101'
- run: | - name: Test
run: |
cd crates/misc/dotnet/tests cd crates/misc/dotnet/tests
dotnet test dotnet test -c ${{ matrix.config }}
- run: | - name: Create package
run: |
cd crates/misc/dotnet/src cd crates/misc/dotnet/src
dotnet pack dotnet pack -c ${{ matrix.config }}
if: matrix.os == 'macos-latest' # Currently the pack target only supports macOS if: matrix.os == 'macos-latest' # Currently the pack target only supports macOS
# Consumes all published artifacts from all the previous build steps, creates # Consumes all published artifacts from all the previous build steps, creates

6
crates/api/src/wasm.rs

@ -56,7 +56,7 @@ macro_rules! declare_vec {
#[allow(dead_code)] #[allow(dead_code)]
fn as_slice(&self) -> &[$elem_ty] { fn as_slice(&self) -> &[$elem_ty] {
unsafe { slice::from_raw_parts(self.data as *const $elem_ty, self.size) } unsafe { slice::from_raw_parts(self.data, self.size) }
} }
} }
@ -122,8 +122,8 @@ macro_rules! declare_vec {
} }
#[allow(dead_code)] #[allow(dead_code)]
fn as_slice(&self) -> &[$elem_ty] { fn as_slice(&self) -> &[*mut $elem_ty] {
unsafe { slice::from_raw_parts(self.data as *const $elem_ty, self.size) } unsafe { slice::from_raw_parts(self.data, self.size) }
} }
} }

2
crates/misc/dotnet/src/ValueKind.cs

@ -5,7 +5,7 @@ namespace Wasmtime
/// <summary> /// <summary>
/// Represents the possible kinds of WebAssembly values. /// Represents the possible kinds of WebAssembly values.
/// </summary> /// </summary>
public enum ValueKind public enum ValueKind : byte
{ {
/// <summary> /// <summary>
/// The value is a 32-bit integer. /// The value is a 32-bit integer.

Loading…
Cancel
Save