Skip to content

Commit dfd2058

Browse files
committed
chore: wip
1 parent e3237c2 commit dfd2058

File tree

2 files changed

+60
-8
lines changed

2 files changed

+60
-8
lines changed

.github/workflows/build-binaries.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ jobs:
111111
echo " - Platform: linux"
112112
echo " - Architecture: $(uname -m)"
113113
echo " - Network connectivity test:"
114+
# Temporarily modify PATH to prioritize system binaries over launchpad binaries
115+
export PATH="/usr/bin:/usr/local/bin:/bin:$PATH"
114116
curl -I --connect-timeout 10 https://dist.pkgx.dev/ || echo " ⚠️ Network connectivity issues detected"
115117
116118
# Set environment variables for better debugging
@@ -155,9 +157,11 @@ jobs:
155157
# Install PHP dependencies via Launchpad with enhanced debugging
156158
echo "🔧 Installing PHP dependencies via Launchpad..."
157159
echo "🔍 Debug info:"
158-
echo " - Platform: linux"
160+
echo " - Platform: darwin"
159161
echo " - Architecture: $(uname -m)"
160162
echo " - Network connectivity test:"
163+
# Temporarily modify PATH to prioritize system binaries over launchpad binaries
164+
export PATH="/usr/bin:/usr/local/bin:/bin:$PATH"
161165
curl -I --connect-timeout 10 https://dist.pkgx.dev/ || echo " ⚠️ Network connectivity issues detected"
162166
163167
# Set environment variables for better debugging
@@ -233,6 +237,10 @@ jobs:
233237
- name: Download and extract PHP source
234238
run: |
235239
cd ${{ env.BUILD_DIR }}
240+
# Temporarily modify PATH to prioritize system binaries over launchpad binaries
241+
# This prevents conflicts with launchpad-installed binaries that may have library dependencies
242+
export PATH="/usr/bin:/usr/local/bin:/bin:$PATH"
243+
# Use system curl instead of launchpad curl to avoid library conflicts
236244
curl -fsSL "https://www.php.net/distributions/php-${{ matrix.php_version }}.tar.gz" -o php.tar.gz
237245
tar -xzf php.tar.gz
238246
cd php-${{ matrix.php_version }}

packages/launchpad/src/install-core.ts

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,61 @@ export async function installPackage(packageName: string, packageSpec: string, i
303303
}
304304

305305
// Download and install
306-
const installedFiles = await downloadPackage(domain, version, os, architecture, installPath)
306+
try {
307+
const installedFiles = await downloadPackage(domain, version, os, architecture, installPath)
307308

308-
// Create common library symlinks for better compatibility
309-
const packageDir = path.join(installPath, domain, `v${version}`)
310-
await createLibrarySymlinks(packageDir, domain)
309+
// Create common library symlinks for better compatibility
310+
const packageDir = path.join(installPath, domain, `v${version}`)
311+
await createLibrarySymlinks(packageDir, domain)
311312

312-
if (config.verbose) {
313-
console.log(`Successfully installed ${domain} v${version}`)
313+
if (config.verbose) {
314+
console.log(`Successfully installed ${domain} v${version}`)
315+
}
316+
317+
return installedFiles
314318
}
319+
catch (error) {
320+
// Special fallback for gnu.org/binutils - try lower version if 2.45.0 fails
321+
if (domain === 'gnu.org/binutils' && version === '2.45.0') {
322+
const fallbackVersions = ['2.44.0', '2.43.0', '2.42.0']
323+
324+
for (const fallbackVersion of fallbackVersions) {
325+
if (config.verbose) {
326+
console.warn(`⚠️ Version ${version} not available, trying fallback version ${fallbackVersion}`)
327+
}
328+
329+
try {
330+
const installedFiles = await downloadPackage(domain, fallbackVersion, os, architecture, installPath)
331+
332+
// Create common library symlinks for better compatibility
333+
const packageDir = path.join(installPath, domain, `v${fallbackVersion}`)
334+
await createLibrarySymlinks(packageDir, domain)
315335

316-
return installedFiles
336+
if (config.verbose) {
337+
console.log(`✅ Successfully installed ${domain} v${fallbackVersion} (fallback from v${version})`)
338+
}
339+
340+
return installedFiles
341+
}
342+
catch {
343+
if (config.verbose) {
344+
console.warn(`⚠️ Fallback version ${fallbackVersion} also failed, trying next...`)
345+
}
346+
continue
347+
}
348+
}
349+
350+
// If all fallback versions failed
351+
if (config.verbose) {
352+
console.error(`❌ All versions failed for ${domain}: ${version}, ${fallbackVersions.join(', ')}`)
353+
console.error(` Original error: ${error instanceof Error ? error.message : String(error)}`)
354+
}
355+
throw error // Re-throw the original error
356+
}
357+
358+
// Re-throw the original error for other packages
359+
throw error
360+
}
317361
}
318362

319363
/**

0 commit comments

Comments
 (0)