diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index f362847..670aa5a 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -86,26 +86,15 @@ jobs: - name: Generate ELP master declarations header run: | - python3 - <<'PYEOF' -import os, re -dist = 'dist' -decls = set() -guard_pat = re.compile(r'^(el_val_t|void|int|char\*|const char\*)\s+\w+\s*\(') -for fn in sorted(os.listdir(dist)): - if not fn.endswith('.c'): - continue - with open(os.path.join(dist, fn)) as f: - for line in f: - line = line.rstrip() - if guard_pat.match(line) and line.endswith(';'): - decls.add(line) -header = ['/* Auto-generated C forward declarations for ELP cross-module calls */', - '#pragma once', '#include "el_runtime.h"', ''] -header += sorted(decls) -with open(os.path.join(dist, 'elp-c-decls.h'), 'w') as f: - f.write('\n'.join(header) + '\n') -print(f"Generated elp-c-decls.h with {len(decls)} declarations") -PYEOF + { + printf '/* Auto-generated C forward declarations for ELP cross-module calls */\n' + printf '#pragma once\n' + printf '#include "el_runtime.h"\n' + printf '\n' + grep -h -E '^(el_val_t|void|int|char\*|const char\*)[[:space:]]+[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]*\(' dist/*.c 2>/dev/null \ + | grep ';$' | sort -u + } > dist/elp-c-decls.h + echo "Generated elp-c-decls.h with $(grep -c ';' dist/elp-c-decls.h 2>/dev/null || echo 0) declarations" - name: Build neuron soul binary run: |