Skip to content

Commit 19be332

Browse files
committed
chore: wip
1 parent 8973d73 commit 19be332

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

.github/workflows/precompile-php.yml

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,34 @@ jobs:
246246
# Install additional dependencies needed for PHP extensions
247247
echo "Windows build dependencies installed for PHP compilation"
248248
249+
- name: Setup Launchpad Environment (macOS)
250+
if: matrix.platform == 'darwin'
251+
shell: bash
252+
run: |
253+
# Find and setup Launchpad environment variables
254+
echo "🔧 Setting up Launchpad environment for macOS build..."
255+
256+
# Find pkg-config dynamically
257+
PKG_CONFIG_PATH_FOUND=$(find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -1)
258+
if [ -n "$PKG_CONFIG_PATH_FOUND" ]; then
259+
PKG_CONFIG_DIR=$(dirname "$PKG_CONFIG_PATH_FOUND")
260+
echo "LAUNCHPAD_PKG_CONFIG_DIR=$PKG_CONFIG_DIR" >> $GITHUB_ENV
261+
echo "✅ Found pkg-config at: $PKG_CONFIG_DIR"
262+
fi
263+
264+
# Find sed
265+
SED_PATH_FOUND=$(find "$HOME/.local" -path "*/gnu.org/sed/*/bin/sed" -type f 2>/dev/null | head -1)
266+
if [ -n "$SED_PATH_FOUND" ]; then
267+
SED_DIR=$(dirname "$SED_PATH_FOUND")
268+
echo "LAUNCHPAD_SED_DIR=$SED_DIR" >> $GITHUB_ENV
269+
echo "✅ Found sed at: $SED_DIR"
270+
fi
271+
272+
# Setup comprehensive PKG_CONFIG_PATH
273+
PKG_PATHS=$(find "$HOME/.local" -name "pkgconfig" -type d 2>/dev/null | tr '\n' ':')
274+
echo "LAUNCHPAD_PKG_CONFIG_PATH=$PKG_PATHS" >> $GITHUB_ENV
275+
echo "✅ PKG_CONFIG_PATH setup with $(echo "$PKG_PATHS" | tr ':' '\n' | wc -l) directories"
276+
249277
- name: Build PHP
250278
shell: bash
251279
env:
@@ -255,53 +283,21 @@ jobs:
255283
TARGET_ARCH: ${{ matrix.arch }}
256284
BUILD_DIR: ${{ github.workspace }}/build
257285
OUTPUT_DIR: ${{ github.workspace }}/binaries
286+
# Ensure Launchpad environment is available for all macOS builds
287+
PATH: ${{ matrix.platform == 'darwin' && format('{0}:{1}:{2}', env.LAUNCHPAD_PKG_CONFIG_DIR, env.LAUNCHPAD_SED_DIR, env.PATH) || env.PATH }}
288+
PKG_CONFIG_PATH: ${{ matrix.platform == 'darwin' && env.LAUNCHPAD_PKG_CONFIG_PATH || env.PKG_CONFIG_PATH }}
258289
run: |
259-
# Source Launchpad environment if available (macOS only)
290+
# Verify environment setup for macOS
260291
if [ "${{ matrix.platform }}" = "darwin" ]; then
261-
# Find and source the best available Launchpad environment
262-
if [ -f "$HOME/.local/build-env.sh" ]; then
263-
echo "🔧 Sourcing Launchpad build environment for macOS build..."
264-
source "$HOME/.local/build-env.sh"
265-
echo "✅ Environment sourced from build-env.sh"
266-
elif [ -f "$HOME/.local/share/launchpad/global/build-env.sh" ]; then
267-
echo "🔧 Sourcing global Launchpad environment for macOS build..."
268-
source "$HOME/.local/share/launchpad/global/build-env.sh"
269-
echo "✅ Environment sourced from global build-env.sh"
270-
else
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"
289-
fi
290-
291-
echo "✅ Current PATH includes freedesktop.org: $(echo $PATH | grep -o freedesktop.org || echo 'NO')"
292+
echo "🔧 Verifying Launchpad environment setup..."
293+
echo "✅ PATH includes pkg-config: $(echo $PATH | grep -o freedesktop.org || echo 'NO')"
292294
echo "✅ PKG_CONFIG_PATH: ${PKG_CONFIG_PATH:-'NOT SET'}"
293295
294-
# Verify pkg-config is accessible and set up PKG_CONFIG_PATH
296+
# Verify pkg-config is accessible
295297
if command -v pkg-config >/dev/null 2>&1; then
296298
echo "✅ pkg-config is accessible: $(which pkg-config)"
297299
echo "✅ pkg-config version: $(pkg-config --version)"
298300
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-
305301
# Test libxml-2.0 specifically
306302
if pkg-config --exists libxml-2.0; then
307303
echo "✅ libxml-2.0 package found via pkg-config"
@@ -311,13 +307,13 @@ jobs:
311307
echo "🔍 Available packages: $(pkg-config --list-all | head -10)"
312308
fi
313309
else
314-
echo "❌ pkg-config still not accessible"
310+
echo "❌ pkg-config not accessible"
315311
echo "🔍 All pkg-config instances:"
316312
find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null
317313
fi
318314
fi
319315
320-
# Run the build script with enhanced environment
316+
# Run the build script with properly configured environment
321317
bun run scripts/build-php.ts
322318
323319
- name: Create tarball (Unix)

0 commit comments

Comments
 (0)