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 }}
strategy:
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:
- uses: actions/checkout@v1
with:
@ -341,12 +360,14 @@ jobs:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.0.101'
- run: |
- name: Test
run: |
cd crates/misc/dotnet/tests
dotnet test
- run: |
dotnet test -c ${{ matrix.config }}
- name: Create package
run: |
cd crates/misc/dotnet/src
dotnet pack
dotnet pack -c ${{ matrix.config }}
if: matrix.os == 'macos-latest' # Currently the pack target only supports macOS
# 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)]
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)]
fn as_slice(&self) -> &[$elem_ty] {
unsafe { slice::from_raw_parts(self.data as *const $elem_ty, self.size) }
fn as_slice(&self) -> &[*mut $elem_ty] {
unsafe { slice::from_raw_parts(self.data, self.size) }
}
}

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

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

Loading…
Cancel
Save