Skip to content

Commit 8973d73

Browse files
committed
chore: wip
1 parent facbeea commit 8973d73

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

.github/workflows/precompile-php.yml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ jobs:
247247
echo "Windows build dependencies installed for PHP compilation"
248248
249249
- name: Build PHP
250+
shell: bash
250251
env:
251252
PHP_VERSION: ${{ matrix.php_version }}
252253
PHP_CONFIG: ${{ matrix.config }}
@@ -257,7 +258,7 @@ jobs:
257258
run: |
258259
# Source Launchpad environment if available (macOS only)
259260
if [ "${{ matrix.platform }}" = "darwin" ]; then
260-
# Try to source the Launchpad build environment
261+
# Find and source the best available Launchpad environment
261262
if [ -f "$HOME/.local/build-env.sh" ]; then
262263
echo "🔧 Sourcing Launchpad build environment for macOS build..."
263264
source "$HOME/.local/build-env.sh"
@@ -267,28 +268,56 @@ jobs:
267268
source "$HOME/.local/share/launchpad/global/build-env.sh"
268269
echo "✅ Environment sourced from global build-env.sh"
269270
else
270-
echo "⚠️ No Launchpad environment file found, manually setting PATH..."
271-
# Manually add common Launchpad paths
272-
export PATH="$HOME/.local/freedesktop.org/pkg-config/v0.29.2/bin:$PATH"
273-
export PATH="$HOME/.local/gnu.org/sed/v4.9.0/bin:$PATH"
274-
echo "✅ Manually added pkg-config to PATH"
271+
echo "⚠️ No Launchpad environment file found"
272+
fi
273+
274+
# Always ensure pkg-config is available - find it dynamically
275+
echo "🔍 Finding and adding pkg-config to PATH..."
276+
PKG_CONFIG_PATH_FOUND=$(find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -1)
277+
if [ -n "$PKG_CONFIG_PATH_FOUND" ]; then
278+
PKG_CONFIG_DIR=$(dirname "$PKG_CONFIG_PATH_FOUND")
279+
export PATH="$PKG_CONFIG_DIR:$PATH"
280+
echo "✅ Added pkg-config to PATH from: $PKG_CONFIG_DIR"
281+
fi
282+
283+
# Also ensure sed is available
284+
SED_PATH_FOUND=$(find "$HOME/.local" -path "*/gnu.org/sed/*/bin/sed" -type f 2>/dev/null | head -1)
285+
if [ -n "$SED_PATH_FOUND" ]; then
286+
SED_DIR=$(dirname "$SED_PATH_FOUND")
287+
export PATH="$SED_DIR:$PATH"
288+
echo "✅ Added sed to PATH from: $SED_DIR"
275289
fi
276290
277291
echo "✅ Current PATH includes freedesktop.org: $(echo $PATH | grep -o freedesktop.org || echo 'NO')"
278292
echo "✅ PKG_CONFIG_PATH: ${PKG_CONFIG_PATH:-'NOT SET'}"
279293
280-
# Verify pkg-config is accessible
294+
# Verify pkg-config is accessible and set up PKG_CONFIG_PATH
281295
if command -v pkg-config >/dev/null 2>&1; then
282296
echo "✅ pkg-config is accessible: $(which pkg-config)"
283297
echo "✅ pkg-config version: $(pkg-config --version)"
298+
299+
# Ensure PKG_CONFIG_PATH includes all Launchpad library paths
300+
echo "🔧 Setting up comprehensive PKG_CONFIG_PATH..."
301+
PKG_PATHS=$(find "$HOME/.local" -name "pkgconfig" -type d 2>/dev/null | tr '\n' ':')
302+
export PKG_CONFIG_PATH="$PKG_PATHS:${PKG_CONFIG_PATH:-}"
303+
echo "✅ PKG_CONFIG_PATH set to: $PKG_CONFIG_PATH"
304+
305+
# Test libxml-2.0 specifically
306+
if pkg-config --exists libxml-2.0; then
307+
echo "✅ libxml-2.0 package found via pkg-config"
308+
echo "📋 libxml-2.0 cflags: $(pkg-config --cflags libxml-2.0)"
309+
else
310+
echo "❌ libxml-2.0 package not found via pkg-config"
311+
echo "🔍 Available packages: $(pkg-config --list-all | head -10)"
312+
fi
284313
else
285-
echo "❌ pkg-config still not accessible after sourcing environment"
286-
echo "🔍 Searching for pkg-config..."
287-
find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -5
314+
echo "❌ pkg-config still not accessible"
315+
echo "🔍 All pkg-config instances:"
316+
find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null
288317
fi
289318
fi
290319
291-
# Run the build script
320+
# Run the build script with enhanced environment
292321
bun run scripts/build-php.ts
293322
294323
- name: Create tarball (Unix)

0 commit comments

Comments
 (0)