Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(scripts/pack-next): Add support for compressing debuginfo with zlib #74662

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/pack-next.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ async function main() {
await packWithTar(packagePath, NEXT_SWC_TARBALL)
break
case 'objcopy-zstd':
case 'objcopy-zlib':
if (process.platform !== 'linux') {
throw new Error('objcopy-zstd is only supported on Linux')
throw new Error('objcopy-{zstd,zlib} is only supported on Linux')
}
const format = PACK_NEXT_COMPRESS == 'objcopy-zstd' ? 'zstd' : 'zlib'
await Promise.all(
(await nextSwcBinaries()).map((bin) =>
execAsyncWithOutput(
'Compressing debug symbols in next-swc native binary',
['objcopy', '--compress-debug-sections=zstd', '--', bin]
['objcopy', `--compress-debug-sections=${format}`, '--', bin]
)
)
)
Expand All @@ -119,7 +121,8 @@ async function main() {
break
default:
throw new Error(
"PACK_NEXT_COMPRESS must be one of 'strip', 'objcopy-zstd', or 'none'"
"PACK_NEXT_COMPRESS must be one of 'strip', 'objcopy-zstd', " +
"'objcopy-zlib', or 'none'"
)
}
}
Expand Down
Loading