add('musl-wrapper')->download(false); $extractor = new ArtifactExtractor(ApplicationContext::get(ArtifactCache::class)); $extractor->extract('musl-wrapper'); // Apply CVE-2025-26519 patch and install musl wrapper SourcePatcher::patchFile('musl-1.2.5_CVE-2025-26519_0001.patch', SOURCE_PATH . '/musl-wrapper'); SourcePatcher::patchFile('musl-1.2.5_CVE-2025-26519_0002.patch', SOURCE_PATH . '/musl-wrapper'); $prefix = ''; if (get_current_user() !== 'root') { $prefix = 'sudo '; logger()->warning('Current user is not root, using sudo for running command'); } shell()->cd(SOURCE_PATH . '/musl-wrapper') ->exec('CC=gcc CXX=g++ AR=ar LD=ld ./configure --disable-gcc-wrapper') ->exec('CC=gcc CXX=g++ AR=ar LD=ld make -j') ->exec("CC=gcc CXX=g++ AR=ar LD=ld {$prefix}make install"); return true; } #[FixItem('fix-musl-cross-make')] public function fixMuslCrossMake(): bool { // sudo $prefix = ''; if (get_current_user() !== 'root') { $prefix = 'sudo '; logger()->warning('Current user is not root, using sudo for running command'); } Shell::passthruCallback(function () { InteractiveTerm::advance(); }); $downloader = new ArtifactDownloader(); $extractor = new ArtifactExtractor(ApplicationContext::get(ArtifactCache::class)); $downloader->add('musl-toolchain')->download(false); $extractor->extract('musl-toolchain'); $pkg_root = PKG_ROOT_PATH . '/musl-toolchain'; shell()->exec("{$prefix}cp -rf {$pkg_root}/* /usr/local/musl"); FileSystem::removeDir($pkg_root); return true; } }