Skip to content

Commit acd8864

Browse files
Merge pull request #29 from permaweb/edge
Sync with `permaweb/hyperbeam`
2 parents aca7ba0 + a722778 commit acd8864

File tree

434 files changed

+123844
-12639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+123844
-12639
lines changed

.githooks/_/install.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.githooks/commit-msg

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
name: 🥘 Build & Deploy Docs HB
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
# Trigger on changes to docs, mkdocs config, or the workflow itself
9+
- "docs/**"
10+
- "mkdocs.yml"
11+
- ".github/workflows/build-deploy-docs.yml"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
# Trigger on changes to docs, mkdocs config, or the workflow itself
17+
- "docs/**"
18+
- "mkdocs.yml"
19+
- ".github/workflows/build-deploy-docs.yml"
20+
21+
# Perform a release using a workflow dispatch
22+
workflow_dispatch:
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Run the build as part of PRs to confirm the site properly builds
30+
check_build:
31+
if: ${{ startsWith(github.ref, 'refs/pull/') }}
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- name: ⬇️ Checkout repo
35+
uses: actions/checkout@v3
36+
37+
# Setup Python environment
38+
- name: 🐍 Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.x' # Use a recent Python 3 version
42+
43+
# Install Erlang OTP 27 using kerl
44+
- name: Install Erlang OTP 27
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
48+
git clone https://github.com/kerl/kerl.git
49+
./kerl/kerl build 27.0 otp-27.0
50+
./kerl/kerl install otp-27.0 ~/otp-27.0
51+
echo '. ~/otp-27.0/activate' >> ~/.bashrc
52+
. ~/otp-27.0/activate
53+
echo "Erlang version:"
54+
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
55+
# Install system dependencies needed for HyperBEAM
56+
- name: Install system dependencies
57+
run: |
58+
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
59+
build-essential \
60+
cmake \
61+
pkg-config \
62+
ncurses-dev \
63+
libssl-dev \
64+
ca-certificates
65+
# Debug step - display the region with syntax error
66+
- name: Debug syntax error region
67+
run: |
68+
echo "Showing the region with syntax error in hb_message.erl:"
69+
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
70+
echo "Checking for syntax error fix files:"
71+
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
72+
echo "Erlang version:"
73+
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
74+
# Install rebar3
75+
- name: Install rebar3
76+
run: |
77+
. ~/otp-27.0/activate
78+
mkdir -p ~/.config/rebar3
79+
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
80+
sudo mv rebar3 /usr/local/bin/rebar3
81+
. ~/otp-27.0/activate && rebar3 --version
82+
# Install Rust toolchain (needed for WASM components)
83+
- name: Install Rust and Cargo
84+
run: |
85+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
86+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
87+
source "$HOME/.cargo/env"
88+
# Setup Node.js
89+
- name: ⎔ Setup Node
90+
uses: actions/setup-node@v3
91+
with:
92+
node-version: 22 # Or your preferred version
93+
94+
# Install pip dependencies and cache them
95+
- name: 📦 Install Python dependencies
96+
run: |
97+
python -m pip install --upgrade pip
98+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
99+
- name: 🛠 Build Docs
100+
run: |
101+
. ~/otp-27.0/activate
102+
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
103+
# Build and deploy the artifacts to Arweave via ArDrive
104+
deploy:
105+
if: github.ref == 'refs/heads/main'
106+
runs-on: ubuntu-22.04
107+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
108+
# However, do NOT cancel in-progress runs as we want to allow these deployments to complete.
109+
concurrency:
110+
group: deploy
111+
cancel-in-progress: false
112+
steps:
113+
- name: ⬇️ Checkout repo
114+
uses: actions/checkout@v3
115+
116+
# Setup Python environment
117+
- name: 🐍 Set up Python
118+
uses: actions/setup-python@v5
119+
with:
120+
python-version: '3.x'
121+
122+
# Install Erlang OTP 27 using kerl
123+
- name: Install Erlang OTP 27
124+
run: |
125+
sudo apt-get update
126+
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
127+
git clone https://github.com/kerl/kerl.git
128+
./kerl/kerl build 27.0 otp-27.0
129+
./kerl/kerl install otp-27.0 ~/otp-27.0
130+
echo '. ~/otp-27.0/activate' >> ~/.bashrc
131+
. ~/otp-27.0/activate
132+
echo "Erlang version:"
133+
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
134+
# Install system dependencies needed for HyperBEAM
135+
- name: Install system dependencies
136+
run: |
137+
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
138+
build-essential \
139+
cmake \
140+
pkg-config \
141+
ncurses-dev \
142+
libssl-dev \
143+
ca-certificates
144+
# Debug step - display the region with syntax error
145+
- name: Debug syntax error region
146+
run: |
147+
echo "Showing the region with syntax error in hb_message.erl:"
148+
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
149+
echo "Checking for syntax error fix files:"
150+
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
151+
echo "Erlang version:"
152+
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
153+
# Install rebar3
154+
- name: Install rebar3
155+
run: |
156+
. ~/otp-27.0/activate
157+
mkdir -p ~/.config/rebar3
158+
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
159+
sudo mv rebar3 /usr/local/bin/rebar3
160+
. ~/otp-27.0/activate && rebar3 --version
161+
# Install Rust toolchain (needed for WASM components)
162+
- name: Install Rust and Cargo
163+
run: |
164+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
165+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
166+
source "$HOME/.cargo/env"
167+
# Install pip dependencies and cache them
168+
- name: 📦 Install Python dependencies
169+
run: |
170+
python -m pip install --upgrade pip
171+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
172+
# Setup Node.js (needed for npx deploy command)
173+
- name: ⎔ Setup Node
174+
uses: actions/setup-node@v3
175+
with:
176+
node-version: 22 # Or your preferred version
177+
178+
- name: 👀 Env
179+
run: |
180+
echo "Event name: ${{ github.event_name }}"
181+
echo "Git ref: ${{ github.ref }}"
182+
echo "GH actor: ${{ github.actor }}"
183+
echo "SHA: ${{ github.sha }}"
184+
VER=`node --version`; echo "Node ver: $VER"
185+
VER=`npm --version`; echo "npm ver: $VER"
186+
. ~/otp-27.0/activate && erl -eval 'io:format("Erlang OTP version: ~s~n", [erlang:system_info(otp_release)]), halt().'
187+
- name: 🛠 Build Docs
188+
id: build_artifacts
189+
run: |
190+
. ~/otp-27.0/activate
191+
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
192+
touch mkdocs-site/.nojekyll
193+
echo "artifacts_output_dir=mkdocs-site" >> $GITHUB_OUTPUT
194+
- name: 💾 Publish to Arweave
195+
id: publish_artifacts
196+
run: |
197+
npx permaweb-deploy \
198+
--arns-name=dps-testing-facility \
199+
--ant-process=${{ secrets.ANT_PROCESS }} \
200+
--deploy-folder=${ARTIFACTS_OUTPUT_DIR}
201+
env:
202+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
203+
ARTIFACTS_OUTPUT_DIR: ${{ steps.build_artifacts.outputs.artifacts_output_dir }}
204+
ANT_PROCESS: ${{ secrets.ANT_PROCESS }}

.gitignore

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
config.*
12
.rebar3
23
_build
34
_checkouts
@@ -19,20 +20,29 @@ logs
1920
*.iml
2021
rebar3.crashdump
2122
*~
23+
/venv
2224

2325
*.json
24-
node_modules
2526
!.vscode/*
2627

2728
*.bin
28-
!.vscode/*
29+
.vscode/c_cpp_properties.json
30+
31+
native/hb_beamr/*.o
32+
native/hb_beamr/*.d
2933

30-
c_src/*.o
31-
c_src/*.d
3234
priv/*
3335
.DS_STORE
34-
TEST-data*
35-
test-cache/*
36-
TEST-cache-**
36+
cache-*
37+
38+
*.dot
39+
*.svg
40+
41+
cu/
42+
mkdocs-site/
43+
mkdocs-site-id.txt
44+
mkdocs-site-manifest.csv
3745

38-
.githooks/_/.setup
46+
!test/admissible-report-wallet.json
47+
!test/admissible-report.json
48+
!test/config.json

.gitpod.Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitpod.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "Launch Erlang with Dependencies",
5+
"name": "Launch debugger on a function.",
66
"type": "erlang",
77
"request": "launch",
88
"cwd": "${workspaceRoot}",
9+
"projectnode": "hb",
10+
"cookie": "hb-debug",
911
"preLaunchTask": "Rebar3 Compile",
10-
"arguments": "-pa _build/default/lib/*/ebin -eval \"ssl:start(), application:ensure_all_started(hb).\"",
11-
"stopOnEntry": false,
12-
"internalConsoleOptions": "openOnSessionStart"
12+
"postDebugTask": "Stop HyperBEAM",
13+
"stopOnEntry": true,
14+
"internalConsoleOptions": "openOnSessionStart",
15+
"module": "hb_debugger",
16+
"function": "start_and_break",
17+
"args": "[${input:moduleName}, ${input:functionName}, [${input:funcArgs}], <<\"${input:debuggerScope}\">>]"
18+
},
19+
{
20+
"name": "Attach to a 'rebar3 debugger' node.",
21+
"type": "erlang",
22+
"request": "attach",
23+
"projectnode": "hb",
24+
"cookie": "hb-debug",
25+
"timeout": 10,
26+
"cwd": "${workspaceRoot}"
1327
},
1428
{
1529
"name": "Attach C Debugger to beam.smp",
@@ -35,5 +49,27 @@
3549
},
3650
"internalConsoleOptions": "neverOpen"
3751
}
52+
],
53+
"inputs": [
54+
{
55+
"id": "moduleName",
56+
"type": "promptString",
57+
"description": "Enter module to break in:"
58+
},
59+
{
60+
"id": "functionName",
61+
"type": "promptString",
62+
"description": "Enter function to invoke:"
63+
},
64+
{
65+
"id": "funcArgs",
66+
"type": "promptString",
67+
"description": "(Optional) Pass arguments to the function:"
68+
},
69+
{
70+
"id": "debuggerScope",
71+
"type": "promptString",
72+
"description": "(Optional) Additional modules/prefixes for debugger scope:"
73+
}
3874
]
3975
}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"editor.detectIndentation": false,
3-
"editor.insertSpaces": false,
3+
"editor.insertSpaces": true,
44
"editor.tabSize": 4
5-
}
5+
}

0 commit comments

Comments
 (0)