Skip to content

Commit 6d450a4

Browse files
t3dotggclaude
andauthored
fix(release): Linux CLI archives build on runners without package docs (#26932)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 4453f53 commit 6d450a4

2 files changed

Lines changed: 760 additions & 5 deletions

File tree

‎scripts/build-cli-archive.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ const stageWebClient = Effect.fn("stageWebClient")(function* (source: string, ta
253253

254254
/** Node links libatomic.so.1, which Ubuntu server and container images lack, so t3 carries its own. */
255255
const bundleLinuxLibatomic = Effect.fn("bundleLinuxLibatomic")(function* (input: {
256+
readonly repoRoot: string;
256257
readonly contentDir: string;
257258
readonly executablePath: string;
258259
}) {
@@ -295,13 +296,14 @@ const bundleLinuxLibatomic = Effect.fn("bundleLinuxLibatomic")(function* (input:
295296
const header = [
296297
`libatomic.so.1 is copied from the Ubuntu package ${pkg} ${version}.`,
297298
`Source: https://launchpad.net/ubuntu/+source/${sourcePackage}/${sourceVersion}`,
298-
"License: GPL-3.0-or-later WITH GCC-exception-3.1. The package copyright file and GPL-3 follow.",
299299
].join("\n");
300-
const copyright = yield* fs.readFileString(`/usr/share/doc/${pkg}/copyright`);
301-
const gpl3 = yield* fs.readFileString("/usr/share/common-licenses/GPL-3");
300+
// Vendored because CI runner images strip /usr/share/doc.
301+
const license = yield* fs.readFileString(
302+
path.join(input.repoRoot, "scripts/licenses/libatomic.LICENSE"),
303+
);
302304
yield* fs.writeFileString(
303305
path.join(input.contentDir, "lib/libatomic.so.1.LICENSE"),
304-
`${header}\n\n${copyright}\n${gpl3}`,
306+
`${header}\n\n${license}`,
305307
);
306308

307309
// RUNPATH resolves through symlinks and is not inherited by child processes, unlike LD_LIBRARY_PATH.
@@ -530,7 +532,7 @@ const buildCliArchive = Effect.fn("buildCliArchive")(function* (input: {
530532

531533
const executablePath = path.join(contentDir, executableName);
532534
if (input.platform === "linux") {
533-
yield* bundleLinuxLibatomic({ contentDir, executablePath });
535+
yield* bundleLinuxLibatomic({ repoRoot, contentDir, executablePath });
534536
}
535537
// TEMPORARY one-time Node fix. Remove when fixed: https://github.com/nodejs/node/issues/67048
536538
if (input.platform === "linux" && input.arch === "arm64") {

0 commit comments

Comments
 (0)