Skip to content

Commit 7fe322e

Browse files
committed
chore: wip
1 parent 48d278c commit 7fe322e

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

.github/workflows/precompile-php.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,18 @@ jobs:
175175
176176
# Wait for dependencies to be fully installed
177177
echo "⏳ Waiting for dependency installation to complete..."
178-
sleep 5
178+
sleep 10
179+
180+
# Debug: Check what was actually installed
181+
echo "🔍 Checking installed dependencies..."
182+
echo "📁 .local directory structure (first level):"
183+
find "$HOME/.local" -maxdepth 2 -type d | sort | head -20
184+
185+
echo "🔍 Looking for pkg-config specifically..."
186+
find "$HOME/.local" -name "*pkg*" -type f 2>/dev/null | head -10 || echo "No pkg-related files found"
187+
188+
echo "🔍 Looking for freedesktop.org directory..."
189+
find "$HOME/.local" -path "*freedesktop*" -type d 2>/dev/null | head -5 || echo "No freedesktop.org directories found"
179190
180191
# Debug: Check if pkg-config is available
181192
echo "🔍 Checking for pkg-config..."
@@ -259,16 +270,21 @@ jobs:
259270
# Find all Launchpad binary directories that should be added to PATH
260271
LAUNCHPAD_PATHS=""
261272
262-
# Find pkg-config binary (from freedesktop.org)
263-
PKG_CONFIG_BINARY=$(find "$HOME/.local" -path "*/freedesktop.org/*/bin/pkg-config" -type f 2>/dev/null | head -1)
273+
# Find pkg-config binary - search broadly first
274+
echo "🔍 Searching for pkg-config binary..."
275+
PKG_CONFIG_BINARY=$(find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -1)
264276
if [ -n "$PKG_CONFIG_BINARY" ]; then
265277
PKG_CONFIG_DIR=$(dirname "$PKG_CONFIG_BINARY")
266278
echo "✅ Found pkg-config at: $PKG_CONFIG_DIR"
267279
LAUNCHPAD_PATHS="$PKG_CONFIG_DIR"
268280
else
269-
echo "❌ pkg-config binary not found in freedesktop.org paths"
270-
echo "🔍 Searching all .local paths for pkg-config..."
271-
find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -3 || echo "No pkg-config found anywhere"
281+
echo "❌ pkg-config binary not found in .local"
282+
echo "🔍 Checking if pkg-config exists in system PATH..."
283+
if command -v pkg-config >/dev/null 2>&1; then
284+
echo "✅ pkg-config found in system PATH: $(which pkg-config)"
285+
else
286+
echo "❌ pkg-config not found anywhere"
287+
fi
272288
fi
273289
274290
# Find other essential Launchpad tools that might override system tools
@@ -288,7 +304,8 @@ jobs:
288304
echo "LAUNCHPAD_BINARY_PATHS=$LAUNCHPAD_PATHS" >> $GITHUB_ENV
289305
echo "✅ Launchpad binary paths: $LAUNCHPAD_PATHS"
290306
else
291-
echo "❌ No Launchpad binary paths found"
307+
echo "LAUNCHPAD_BINARY_PATHS=" >> $GITHUB_ENV
308+
echo "❌ No Launchpad binary paths found - PATH will not be modified"
292309
fi
293310
294311
# Setup comprehensive PKG_CONFIG_PATH
@@ -307,22 +324,31 @@ jobs:
307324
TARGET_ARCH: ${{ matrix.arch }}
308325
BUILD_DIR: ${{ github.workspace }}/build
309326
OUTPUT_DIR: ${{ github.workspace }}/binaries
310-
# Ensure Launchpad environment is available for all macOS builds
311-
# Prepend Launchpad paths while preserving system tools
312-
PATH: ${{ matrix.platform == 'darwin' && env.LAUNCHPAD_BINARY_PATHS && format('{0}:{1}', env.LAUNCHPAD_BINARY_PATHS, env.ORIGINAL_PATH) || env.PATH }}
327+
# Environment for all platforms - will handle PATH logic in shell script
313328
PKG_CONFIG_PATH: ${{ matrix.platform == 'darwin' && env.LAUNCHPAD_PKG_CONFIG_PATH || env.PKG_CONFIG_PATH }}
314329
run: |
315-
# Verify environment setup for macOS
330+
# Setup PATH for macOS with Launchpad tools
316331
if [ "${{ matrix.platform }}" = "darwin" ]; then
317-
echo "🔧 Verifying Launchpad environment setup..."
318-
echo "✅ LAUNCHPAD_BINARY_PATHS: ${LAUNCHPAD_BINARY_PATHS:-'NOT SET'}"
332+
echo "🔧 Setting up macOS environment..."
333+
334+
# Preserve original PATH
335+
ORIGINAL_PATH="$PATH"
336+
echo "✅ Original PATH: ${ORIGINAL_PATH:0:100}..."
337+
338+
# Add Launchpad binary paths to PATH if they exist
339+
if [ -n "${LAUNCHPAD_BINARY_PATHS:-}" ] && [ "${LAUNCHPAD_BINARY_PATHS}" != "NOT SET" ]; then
340+
export PATH="$LAUNCHPAD_BINARY_PATHS:$ORIGINAL_PATH"
341+
echo "✅ Updated PATH with Launchpad binaries: ${LAUNCHPAD_BINARY_PATHS}"
342+
else
343+
echo "❌ No Launchpad binary paths found - using original PATH"
344+
fi
345+
346+
echo "✅ Final PATH: ${PATH:0:100}..."
319347
echo "✅ PKG_CONFIG_PATH: ${PKG_CONFIG_PATH:-'NOT SET'}"
320-
echo "✅ Current PATH length: $(echo "$PATH" | wc -c) characters"
321-
echo "✅ PATH first 300 chars: ${PATH:0:300}..."
322348
323349
# Verify essential system tools are available
324350
echo "🔧 Checking essential system tools..."
325-
for tool in curl tar gzip grep tr find; do
351+
for tool in curl tar gzip grep tr find wc head; do
326352
if command -v $tool >/dev/null 2>&1; then
327353
echo "✅ $tool: $(which $tool)"
328354
else

0 commit comments

Comments
 (0)