From 3a8831daf18cfd45612cc0f5b6ca6272cac8fe0e Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 3 Jan 2026 09:25:20 +0100 Subject: [PATCH] fix(ci): remove unnecessary Lua header installation step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our SecuBox packages are PKGARCH:=all (pure scripts) and don't require Lua headers or lucihttp compilation. The Lua header installation step was causing premature compilation attempts of lua/lucihttp which failed due to API incompatibility between lucihttp (Lua 5.1 API) and lua5.4. Changes: - Removed "Install Lua headers" step from GitHub Actions workflow - Removed Lua header installation from local-build.sh (2 instances) - Packages will use prebuilt dependencies as intended - lucihttp/cgi-io remain disabled in .config This resolves the lualib.h missing error by avoiding the compilation entirely rather than trying to fix header paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .claude/settings.local.json | 7 +- .github/workflows/build-openwrt-packages.yml | 81 ----------- secubox-tools/local-build.sh | 133 +------------------ 3 files changed, 12 insertions(+), 209 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 95cd150f..8467aa50 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -219,7 +219,12 @@ "Bash(source secubox-tools/webui/.venv/bin/activate:*)", "Bash(python -m app.ingest:*)", "Bash(python -m json.tool:*)", - "Bash(python -m uvicorn:*)" + "Bash(python -m uvicorn:*)", + "Bash(./local-build.sh)", + "Bash(./scripts/feeds search:*)", + "Bash(./sdk/scripts/feeds install:*)", + "Bash(readlink:*)", + "Bash(git -C feeds/luci branch:*)" ] } } diff --git a/.github/workflows/build-openwrt-packages.yml b/.github/workflows/build-openwrt-packages.yml index 8f9e860d..372fe845 100644 --- a/.github/workflows/build-openwrt-packages.yml +++ b/.github/workflows/build-openwrt-packages.yml @@ -533,87 +533,6 @@ jobs: echo "Note: Our SecuBox packages are PKGARCH:=all (scripts only)" echo "They will be built regardless of dependency availability" - - name: Install Lua headers in SDK staging directory - run: | - cd sdk - - echo "đŸ“Ļ Installing Lua headers manually to prevent lucihttp compilation failures..." - - # Install lua package to feeds - ./scripts/feeds install lua - - # Find Lua source directory in feeds - LUA_SRC=$(find feeds/packages/lang/lua/src -type d -name "lua-*" 2>/dev/null | head -1) - - if [ -n "$LUA_SRC" ]; then - echo "Found Lua source at: $LUA_SRC" - - # Create include directory in all target staging dirs - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - echo "Installing headers to $STAGING/usr/include/" - mkdir -p "$STAGING/usr/include" - - # Copy Lua headers - if [ -d "$LUA_SRC" ]; then - cp -v "$LUA_SRC"/*.h "$STAGING/usr/include/" 2>/dev/null || true - cp -v "$LUA_SRC"/src/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - fi - done - else - echo "âš ī¸ Lua source not found in feeds, trying alternative methods..." - - # Alternative 1: Search for Lua headers in build_dir - LUA_BUILD_DIR=$(find build_dir -type f -name "lua.h" -printf '%h\n' 2>/dev/null | head -1) - - if [ -n "$LUA_BUILD_DIR" ]; then - echo "Found Lua headers in build_dir at: $LUA_BUILD_DIR" - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - # Copy ALL header files from the directory - cp -v "$LUA_BUILD_DIR"/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - done - else - # Alternative 2: Use system Lua headers as last resort - echo "Searching for system Lua headers..." - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - - # Try to find lua headers anywhere in the SDK - find . -type f \( -name "lua.h" -o -name "lualib.h" -o -name "lauxlib.h" \) \ - -exec cp {} "$STAGING/usr/include/" \; 2>/dev/null || true - fi - done - fi - fi - - # Verify headers are installed - echo "" - echo "Verifying Lua headers installation:" - for STAGING in staging_dir/target-*; do - HEADERS_FOUND=0 - for HEADER in lua.h lualib.h lauxlib.h; do - if [ -f "$STAGING/usr/include/$HEADER" ]; then - echo "✅ $STAGING/usr/include/$HEADER" - HEADERS_FOUND=$((HEADERS_FOUND + 1)) - else - echo "❌ $STAGING/usr/include/$HEADER NOT FOUND" - fi - done - - if [ $HEADERS_FOUND -eq 3 ]; then - echo "✅ All required Lua headers installed for $(basename $STAGING)" - else - echo "âš ī¸ Warning: Missing some Lua headers in $(basename $STAGING)" - fi - done - - name: Configure packages run: | cd sdk diff --git a/secubox-tools/local-build.sh b/secubox-tools/local-build.sh index 6f54ddfb..7d71e67d 100755 --- a/secubox-tools/local-build.sh +++ b/secubox-tools/local-build.sh @@ -484,75 +484,12 @@ FEEDS print_warning "Feed installation had errors, checking if critical..." fi - # Install Lua headers manually to staging directory (prevents lua.h missing error in lucihttp) - echo "" - echo "đŸ“Ļ Installing Lua headers manually to staging directory..." - ./scripts/feeds install lua 2>&1 | grep -v "WARNING:" || true - - # Find Lua source directory in feeds - LUA_SRC=$(find feeds/packages/lang/lua/src -type d -name "lua-*" 2>/dev/null | head -1) - - if [ -n "$LUA_SRC" ]; then - print_info "Found Lua source at: $LUA_SRC" - - # Create include directory in all target staging dirs - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - echo "Installing headers to $STAGING/usr/include/" - mkdir -p "$STAGING/usr/include" - - # Copy Lua headers - cp "$LUA_SRC"/*.h "$STAGING/usr/include/" 2>/dev/null || true - cp "$LUA_SRC"/src/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - done - else - print_warn "Lua source not found in feeds, trying alternative methods..." - - # Alternative 1: Search for Lua headers in build_dir - LUA_BUILD_DIR=$(find build_dir -type f -name "lua.h" -printf '%h\n' 2>/dev/null | head -1) - - if [ -n "$LUA_BUILD_DIR" ]; then - echo "Found Lua headers in build_dir at: $LUA_BUILD_DIR" - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - # Copy ALL header files from the directory - cp "$LUA_BUILD_DIR"/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - done - else - # Alternative 2: Use system Lua headers as last resort - echo "Searching for system Lua headers..." - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - - # Try to find lua headers anywhere in the SDK - find . -type f \( -name "lua.h" -o -name "lualib.h" -o -name "lauxlib.h" \) \ - -exec cp {} "$STAGING/usr/include/" \; 2>/dev/null || true - fi - done - fi - fi - - # Verify headers are installed - if ls staging_dir/target-*/usr/include/lua.h 2>/dev/null > /dev/null; then - print_info "✅ Lua headers successfully installed in staging directory" - else - print_warn "âš ī¸ Lua headers not found, but continuing (may cause issues with lucihttp)" - fi - - # Note: We skip manual dependency installation as it causes hangs - # The feeds install -a command above already installed all available packages - # lucihttp and cgi-io will be disabled in .config to prevent compilation failures - # Our SecuBox packages are PKGARCH:=all (scripts) so they don't need compiled dependencies - + # Note: We skip Lua header installation and manual dependency builds + # Our SecuBox packages are PKGARCH:=all (scripts only) - no compilation needed + # lucihttp and cgi-io dependencies will be disabled in .config echo "" echo "â„šī¸ Dependencies will be handled via .config (pre-built packages preferred)" - echo " lucihttp and cgi-io will be disabled (fail to compile: missing lua.h)" + echo " Our packages are PKGARCH:=all (scripts) - no lucihttp compilation needed" # Verify feeds echo "" @@ -1114,66 +1051,8 @@ setup_openwrt_feeds() { print_warning "Feed install had warnings, checking directories..." fi - # Install Lua headers manually to staging directory (prevents lua.h missing error in lucihttp) - echo "" - print_info "Installing Lua headers manually to staging directory..." - ./scripts/feeds install lua 2>&1 | grep -v "WARNING:" || true - - # Find Lua source directory in feeds - LUA_SRC=$(find feeds/packages/lang/lua/src -type d -name "lua-*" 2>/dev/null | head -1) - - if [ -n "$LUA_SRC" ]; then - print_info "Found Lua source at: $LUA_SRC" - - # Create include directory in all target staging dirs - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - echo "Installing headers to $STAGING/usr/include/" - mkdir -p "$STAGING/usr/include" - - # Copy Lua headers - cp "$LUA_SRC"/*.h "$STAGING/usr/include/" 2>/dev/null || true - cp "$LUA_SRC"/src/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - done - else - print_warning "Lua source not found in feeds, trying alternative methods..." - - # Alternative 1: Search for Lua headers in build_dir - LUA_BUILD_DIR=$(find build_dir -type f -name "lua.h" -printf '%h\n' 2>/dev/null | head -1) - - if [ -n "$LUA_BUILD_DIR" ]; then - echo "Found Lua headers in build_dir at: $LUA_BUILD_DIR" - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - # Copy ALL header files from the directory - cp "$LUA_BUILD_DIR"/*.h "$STAGING/usr/include/" 2>/dev/null || true - fi - done - else - # Alternative 2: Use system Lua headers as last resort - echo "Searching for system Lua headers..." - - for STAGING in staging_dir/target-*; do - if [ -d "$STAGING" ]; then - mkdir -p "$STAGING/usr/include" - - # Try to find lua headers anywhere in the SDK - find . -type f \( -name "lua.h" -o -name "lualib.h" -o -name "lauxlib.h" \) \ - -exec cp {} "$STAGING/usr/include/" \; 2>/dev/null || true - fi - done - fi - fi - - # Verify headers are installed - if ls staging_dir/target-*/usr/include/lua.h 2>/dev/null > /dev/null; then - print_success "✅ Lua headers successfully installed in staging directory" - else - print_warning "âš ī¸ Lua headers not found, but continuing (may cause issues with lucihttp)" - fi + # Note: Skipping Lua header installation + # Our packages are PKGARCH:=all (scripts only) - no compilation needed # Verify feeds for feed in packages luci; do