Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions scripts/build-cli-archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ const stageWebClient = Effect.fn("stageWebClient")(function* (source: string, ta

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

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

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