Skip to content

Commit 53c4292

Browse files
committed
chore: wip
1 parent 7bae33d commit 53c4292

File tree

4 files changed

+70
-12
lines changed

4 files changed

+70
-12
lines changed

.github/workflows/build-binaries.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,19 @@ jobs:
105105
- name: Install build dependencies (Ubuntu)
106106
if: matrix.platform == 'linux'
107107
run: |
108-
# Use Launchpad to install PHP dependencies automatically
109-
# This replaces the manual apt-get install of all dependencies
110-
./launchpad install php --deps-only
108+
# Install PHP dependencies via Launchpad with enhanced debugging
109+
echo "🔧 Installing PHP dependencies via Launchpad..."
110+
echo "🔍 Debug info:"
111+
echo " - Platform: linux"
112+
echo " - Architecture: $(uname -m)"
113+
echo " - Network connectivity test:"
114+
curl -I --connect-timeout 10 https://dist.pkgx.dev/ || echo " ⚠️ Network connectivity issues detected"
115+
116+
# Set environment variables for better debugging
117+
export LAUNCHPAD_DEBUG=1
118+
export LAUNCHPAD_VERBOSE=1
119+
120+
./launchpad install php --deps-only --verbose
111121
112122
# Alternative: Use apt-get for manual dependency installation
113123
# sudo apt-get update
@@ -142,9 +152,19 @@ jobs:
142152
- name: Install build dependencies (macOS)
143153
if: matrix.platform == 'darwin'
144154
run: |
145-
# Use Launchpad to install PHP dependencies automatically
146-
# This replaces the manual brew install of all dependencies
147-
./launchpad install php --deps-only
155+
# Install PHP dependencies via Launchpad with enhanced debugging
156+
echo "🔧 Installing PHP dependencies via Launchpad..."
157+
echo "🔍 Debug info:"
158+
echo " - Platform: linux"
159+
echo " - Architecture: $(uname -m)"
160+
echo " - Network connectivity test:"
161+
curl -I --connect-timeout 10 https://dist.pkgx.dev/ || echo " ⚠️ Network connectivity issues detected"
162+
163+
# Set environment variables for better debugging
164+
export LAUNCHPAD_DEBUG=1
165+
export LAUNCHPAD_VERBOSE=1
166+
167+
./launchpad install php --deps-only --verbose
148168
149169
# Alternative: Use Homebrew for manual dependency installation
150170
# brew install \

packages/launchpad/src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ function getDefaultShimPath(): string {
3535
}
3636

3737
export const defaultConfig: LaunchpadConfig = {
38-
verbose: process.env.LAUNCHPAD_VERBOSE === 'true' || false,
38+
verbose: process.env.LAUNCHPAD_VERBOSE === 'true' || process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true' || false,
3939
sudoPassword: process.env.SUDO_PASSWORD || '',
4040
devAware: true,
4141
autoSudo: process.env.LAUNCHPAD_AUTO_SUDO !== 'false',
42-
maxRetries: 3,
43-
timeout: 60000, // 60 seconds
42+
maxRetries: process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true' ? 5 : 3,
43+
timeout: process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true' ? 120000 : 60000, // 2 minutes in CI, 1 minute locally
4444
symlinkVersions: true,
4545
forceReinstall: false,
4646
shimPath: getDefaultShimPath(),

packages/launchpad/src/install-core.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,31 @@ export async function downloadPackage(
587587
throw new Error(`Download timeout for ${domain} - cancelling after 30 seconds`)
588588
}
589589
else {
590-
if (config.verbose) {
591-
console.warn(`Failed to download ${format} format:`, error)
590+
// Always show download errors in CI environment
591+
const isCI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true'
592+
if (config.verbose || isCI) {
593+
console.warn(`⚠️ Failed to download ${domain} v${version} (${format} format):`, error instanceof Error ? error.message : String(error))
594+
console.warn(` URL: ${url}`)
595+
console.warn(` Platform: ${os}/${arch}`)
592596
}
593597
}
594598
}
595599
}
596600

597601
if (!downloadUrl || !archiveFile) {
598-
throw new Error(`Failed to download package ${domain} v${version}`)
602+
const isCI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true'
603+
const errorMsg = `Failed to download package ${domain} v${version}`
604+
if (isCI) {
605+
console.error(`❌ ${errorMsg}`)
606+
console.error(` Tried URLs:`)
607+
formats.forEach((format) => {
608+
const url = `${DISTRIBUTION_CONFIG.baseUrl}/${domain}/${os}/${arch}/v${version}.${format}`
609+
console.error(` - ${url}`)
610+
})
611+
console.error(` Platform: ${os}/${arch}`)
612+
console.error(` This may be due to network issues or the package not being available for this platform.`)
613+
}
614+
throw new Error(errorMsg)
599615
}
600616

601617
if (config.verbose && !usedCache) {

test-ci.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Test script for CI environment
4+
echo "🔧 Testing Launchpad in CI environment..."
5+
6+
# Test network connectivity
7+
echo "🔍 Testing network connectivity..."
8+
curl -I --connect-timeout 10 https://dist.pkgx.dev/ || echo "⚠️ Network connectivity issues detected"
9+
10+
# Test launchpad basic functionality
11+
echo "🔍 Testing Launchpad basic functionality..."
12+
./launchpad --version || echo "⚠️ Launchpad version check failed"
13+
14+
# Test launchpad help
15+
echo "🔍 Testing Launchpad help..."
16+
./launchpad --help || echo "⚠️ Launchpad help failed"
17+
18+
# Test launchpad list
19+
echo "🔍 Testing Launchpad list..."
20+
./launchpad list || echo "⚠️ Launchpad list failed"
21+
22+
echo "✅ CI environment test completed"

0 commit comments

Comments
 (0)