Skip to content

Commit

Permalink
cached wasmedge c lib in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharad committed Sep 8, 2023
1 parent c38bafc commit 18b5076
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,26 @@ jobs:
cabal-version: '3.6'

- name: cache
id: cache-wasmedge
uses: actions/cache@v3
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project*') }}
~/.wasmedge
key: |
${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-v1-
- name: Install dependencies
run: |
cabal build all --only-dependencies
- name: Install WasmEdge C library
if: steps.cache-wasmedge.outputs.cache-hit != 'true'
run: |
VERSION=0.13.3
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $VERSION
Expand Down
32 changes: 28 additions & 4 deletions src/WasmEdge/Internal/FFI/ValueTypes.chs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module WasmEdge.Internal.FFI.ValueTypes
(
--pointer
HsRefPtr
,fromHsRefAsVoidPtrIn
,WasmVal ( WasmInt32, WasmInt64, WasmFloat, WasmDouble, WasmInt128, WasmExternRef
, WasmFuncRef, WasmNullExternRef, WasmNullFuncRef
)
Expand Down Expand Up @@ -1106,6 +1107,9 @@ int Driver_UniTool(const char *Argv[], int Argc)
HsRef
-}
{#pointer *HsRef as HsRefPtr foreign newtype #}
{-|
WasmVal
-}
{#pointer *WasmVal as WasmVal foreign newtype #}
{-|
WasmEdge string struct.
Expand All @@ -1114,18 +1118,38 @@ int Driver_UniTool(const char *Argv[], int Argc)
instance HasFinalizer WasmString where
getFinalizer = deleteString

{-|
WasmEdge Result construct
-}
{#pointer *WasmEdge_Result as WasmResult foreign newtype #}

{-|
Struct of WASM limit.
-}
{#pointer *WasmEdge_Limit as Limit foreign newtype #}
-- | Program option for plugins.

{- |
Program option for plugins.
-}
{#pointer *WasmEdge_ProgramOption as ProgramOption foreign newtype #}
-- | Module descriptor for plugins.

{- | Module descriptor for plugins.
-}
{#pointer *WasmEdge_ModuleDescriptor as ModuleDescriptor foreign newtype #}
-- | Version data for plugins.

{- | Version data for plugins.
-}
{#pointer *WasmEdge_PluginVersionData as PluginVersionData foreign newtype #}
-- | Plugin descriptor for plugins.

{-|
Plugin descriptor for plugins.
-}
{#pointer *WasmEdge_PluginDescriptor as PluginDescriptor foreign newtype #}

---
{-|
fromHsRefIn
-}
fromHsRefIn :: HsRef -> (Ptr HsRefPtr -> IO a) -> IO a
fromHsRefIn = fromHsRefGenIn

Expand Down

0 comments on commit 18b5076

Please sign in to comment.