From 0e449d7064169a73746949435bb2dca39e60222d Mon Sep 17 00:00:00 2001 From: mariobassem Date: Tue, 14 Jan 2025 11:58:06 +0200 Subject: [PATCH 1/4] fix: update ci build workflow --- .github/workflows/hero_build_s3.yml | 42 ++++++++++++++++++++++++++--- .gitignore | 3 ++- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hero_build_s3.yml b/.github/workflows/hero_build_s3.yml index 6745ee96..e3eaa69e 100644 --- a/.github/workflows/hero_build_s3.yml +++ b/.github/workflows/hero_build_s3.yml @@ -34,10 +34,44 @@ jobs: uses: actions/checkout@v3 - name: Setup Vlang - run: ./install_v.sh + run: | + git clone --depth=1 https://github.com/vlang/v + cd v + make + sudo ./v symlink + cd .. - name: Setup Herolib - run: ./install_herolib.vsh + run: | + mkdir -p ~/.vmodules/freeflowuniverse + ln -s $GITHUB_WORKSPACE/lib ~/.vmodules/freeflowuniverse/herolib + + echo "Installing secp256k1..." + if [ "${{ matrix.os }}" = "macos-latest" ]; then + brew install secp256k1 + elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then + # Install build dependencies + sudo apt-get install -y build-essential wget autoconf libtool + + # Download and extract secp256k1 + cd /tmp + wget https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.3.2.tar.gz + tar -xvf v0.3.2.tar.gz + + # Build and install + cd secp256k1-0.3.2/ + ./autogen.sh + ./configure + make -j 5 + sudo make install + + # Cleanup + rm -rf secp256k1-0.3.2 v0.3.2.tar.gz + else + echo "secp256k1 installation not implemented for ${OSNAME}" + exit 1 + fi + echo "secp256k1 installation complete!" - name: Install and Start Redis run: | @@ -64,7 +98,9 @@ jobs: fi - name: Do all the basic tests - run: ./test_basic.vsh + run: | + alias vtest='v -stats -enable-globals -n -w -cg -gc none -no-retry-compilation -cc tcc test' + ./test_basic.vsh # - name: Upload to S3 # run: | diff --git a/.gitignore b/.gitignore index 5d7b55f0..81379170 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ output/ .stellar vdocs/ data.ms/ -test_basic \ No newline at end of file +test_basic +cli/hero \ No newline at end of file From e255d6ed65fe66ff9757946a5574b22785dfbae6 Mon Sep 17 00:00:00 2001 From: mariobassem Date: Tue, 14 Jan 2025 14:06:51 +0200 Subject: [PATCH 2/4] refactor: remove unused url flag - Removed the unused `url` flag from the hero CLI. Co-authored-by: mahmmoud.hassanein --- cli/hero.v | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cli/hero.v b/cli/hero.v index d04de408..2ca1047b 100644 --- a/cli/hero.v +++ b/cli/hero.v @@ -1,7 +1,7 @@ module main import os -import cli { Command, Flag } +import cli { Command } import freeflowuniverse.herolib.core.herocmds // import freeflowuniverse.herolib.hero.cmds // import freeflowuniverse.herolib.hero.publishing @@ -34,14 +34,6 @@ fn do() ! { version: '2.0.0' } - cmd.add_flag(Flag{ - flag: .string - name: 'url' - abbrev: 'u' - global: true - description: 'url of playbook' - }) - // herocmds.cmd_run_add_flags(mut cmd) mut toinstall := false From de102f33d9107c8fa2e3a3be391dbf5a31a7111f Mon Sep 17 00:00:00 2001 From: mariobassem Date: Tue, 14 Jan 2025 15:34:02 +0200 Subject: [PATCH 3/4] fix: fix hero mdbook command --- cli/hero.v | 2 +- lib/core/herocmds/mdbook.v | 2 +- lib/core/playcmds/factory.v | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/hero.v b/cli/hero.v index 2ca1047b..ed1dd6d9 100644 --- a/cli/hero.v +++ b/cli/hero.v @@ -75,7 +75,7 @@ fn do() ! { // herocmds.cmd_installers(mut cmd) // herocmds.cmd_configure(mut cmd) // herocmds.cmd_postgres(mut cmd) - // herocmds.cmd_mdbook(mut cmd) + herocmds.cmd_mdbook(mut cmd) // herocmds.cmd_luadns(mut cmd) // herocmds.cmd_caddy(mut cmd) // herocmds.cmd_zola(mut cmd) diff --git a/lib/core/herocmds/mdbook.v b/lib/core/herocmds/mdbook.v index 398b5eb4..25ece2cd 100644 --- a/lib/core/herocmds/mdbook.v +++ b/lib/core/herocmds/mdbook.v @@ -88,7 +88,7 @@ fn cmd_mdbook_execute(cmd Command) ! { mut plbook, _ := plbook_run(cmd)! // get name from the book.generate action if name == '' { - mut a := plbook.action_get(actor: 'mdbook', name: 'define')! + mut a := plbook.action_get(actor: 'book', name: 'define')! name = a.params.get('name') or { '' } } } else { diff --git a/lib/core/playcmds/factory.v b/lib/core/playcmds/factory.v index 8b00658d..4045376e 100644 --- a/lib/core/playcmds/factory.v +++ b/lib/core/playcmds/factory.v @@ -22,6 +22,7 @@ pub fn run(mut plbook playbook.PlayBook, dagu bool) ! { play_core(mut plbook)! play_ssh(mut plbook)! play_git(mut plbook)! + play_publisher(mut plbook)! // play_zola(mut plbook)! // play_caddy(mut plbook)! // play_juggler(mut plbook)! @@ -36,8 +37,6 @@ pub fn run(mut plbook playbook.PlayBook, dagu bool) ! { // base_install(play(mut plbook)! // coredns.play(mut plbook)! - // publishing.play(mut plbook)! - // plbook.empty_check()! console.print_header('Actions concluded succesfully.') From 55fc87d9f25bbc89d53df1116a17e9bc1b5109de Mon Sep 17 00:00:00 2001 From: mariobassem Date: Tue, 14 Jan 2025 18:33:22 +0200 Subject: [PATCH 4/4] fix: use redis client reference in threefold grid module --- lib/threefold/grid/zdb.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/threefold/grid/zdb.v b/lib/threefold/grid/zdb.v index 40ad2df2..ed1fc9fb 100644 --- a/lib/threefold/grid/zdb.v +++ b/lib/threefold/grid/zdb.v @@ -78,7 +78,7 @@ pub fn (zdb ZDBDeployed) ping() bool { panic('implement') } -pub fn (zdb ZDBDeployed) redisclient() !redisclient.Redis { +pub fn (zdb ZDBDeployed) redisclient() !&redisclient.Redis { redis_addr := '${zdb.mycelium_ip}:6379' return redisclient.new(redis_addr)! }