From 662e1dcf8728d282e50e49d40774f34a8150c59f Mon Sep 17 00:00:00 2001 From: Atticus Date: Wed, 8 Jan 2025 16:55:40 -0800 Subject: [PATCH 1/4] fix(gc): add collect flag to lua gc call --- dev-cli/container/src/core/loader.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-cli/container/src/core/loader.lua b/dev-cli/container/src/core/loader.lua index fb7e94aea..34553b476 100644 --- a/dev-cli/container/src/core/loader.lua +++ b/dev-cli/container/src/core/loader.lua @@ -16,6 +16,6 @@ function handle(msgJSON, aoJSON) local responseJSON = json.encode({ok = status, response = response}) -- free response = nil - collectgarbage() + collectgarbage("collect") return responseJSON end From 1c62d1acd464bcabc3825d6bd0f1cfcc5b7b5af2 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Sat, 15 Mar 2025 16:52:22 -0600 Subject: [PATCH 2/4] fix(build): update c build and deno deps --- dev-cli/container/src/ao_module_lib/languages/c.py | 3 +-- dev-cli/src/deps.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dev-cli/container/src/ao_module_lib/languages/c.py b/dev-cli/container/src/ao_module_lib/languages/c.py index be2dedf27..fe051a063 100644 --- a/dev-cli/container/src/ao_module_lib/languages/c.py +++ b/dev-cli/container/src/ao_module_lib/languages/c.py @@ -1,8 +1,7 @@ import glob from ao_module_lib.definition import Definition -from ao_module_lib.file import BundleFile -def inject_c_files(definition: Definition, c_program: str, c_source_files: list, link_libraries: list): +def inject_c_files(definition: Definition, c_program: str, c_source_files: list): c_header_files = [] diff --git a/dev-cli/src/deps.js b/dev-cli/src/deps.js index 3a568d201..291746616 100644 --- a/dev-cli/src/deps.js +++ b/dev-cli/src/deps.js @@ -1,4 +1,4 @@ -export { Command } from 'https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts' +export { Command } from 'https://deno.land/x/cliffy@v1.0.0-rc.4/command/mod.ts'; export { basename, resolve } from 'https://deno.land/std@0.224.0/path/mod.ts' export { copy } from 'https://deno.land/std@0.224.0/fs/copy.ts' export { parse } from 'jsr:@std/yaml' From 5b0369e668436e9a73f22f2ddef8c8ac39801177 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Sat, 15 Mar 2025 17:10:19 -0600 Subject: [PATCH 3/4] chore(actions): add build action to check that template projects can build --- .github/workflows/dev-cli.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/dev-cli.yml b/.github/workflows/dev-cli.yml index 0cfdd0ffb..1819310b1 100644 --- a/.github/workflows/dev-cli.yml +++ b/.github/workflows/dev-cli.yml @@ -46,6 +46,31 @@ jobs: deno task test env: CI: true + build: + if: github.event_name != 'workflow_dispatch' + runs-on: ubuntu-latest + strategy: + matrix: + lang: [lua, c] + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + + - name: 🦕 Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: 1.x + + - name: Build and install CLI + run: deno task build-binaries && deno task install-local + + - name: Verify ao installation + run: which ao && ao --version + + - name: Initialize and build template projects + run: | + echo "Building for language: ${{ matrix.lang }}" + ao init -l ${{ matrix.lang }} && ao build test-node-commands: if: github.event_name != 'workflow_dispatch' From 6654a0b3d7e7b7afc6e5f5e86723368aba0388c6 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Sat, 15 Mar 2025 17:40:09 -0600 Subject: [PATCH 4/4] chore(actions): add ao to path --- .github/workflows/dev-cli.yml | 24 +++++++++++++++++------- dev-cli/container/src/core/loader.lua | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev-cli.yml b/.github/workflows/dev-cli.yml index 1819310b1..927ed87a1 100644 --- a/.github/workflows/dev-cli.yml +++ b/.github/workflows/dev-cli.yml @@ -55,22 +55,32 @@ jobs: steps: - name: ⬇️ Checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: 🦕 Setup Deno uses: denoland/setup-deno@v1 with: deno-version: 1.x - - name: Build and install CLI - run: deno task build-binaries && deno task install-local - - - name: Verify ao installation - run: which ao && ao --version - - name: Initialize and build template projects run: | + docker build container -t p3rmaw3b/ao + echo 'export AO_INSTALL=/home/runner/.ao' >> $GITHUB_PATH + echo 'export PATH="$AO_INSTALL/bin:$PATH"' >> $GITHUB_PATH + source $GITHUB_PATH + echo 'Building and installing binaries' + deno task build-binaries && deno task install-local echo "Building for language: ${{ matrix.lang }}" - ao init -l ${{ matrix.lang }} && ao build + ao init my-template -l ${{ matrix.lang }} && cd my-template && ao build + + echo 'Checking that process.wasm exists' + if [ -f "process.wasm" ]; then + echo "✅ process.wasm exists" + else + echo "❌ process.wasm is missing!" >&2 + exit 1 + fi test-node-commands: if: github.event_name != 'workflow_dispatch' diff --git a/dev-cli/container/src/core/loader.lua b/dev-cli/container/src/core/loader.lua index 34553b476..fb7e94aea 100644 --- a/dev-cli/container/src/core/loader.lua +++ b/dev-cli/container/src/core/loader.lua @@ -16,6 +16,6 @@ function handle(msgJSON, aoJSON) local responseJSON = json.encode({ok = status, response = response}) -- free response = nil - collectgarbage("collect") + collectgarbage() return responseJSON end