From 265a21199d74dfbea208144b117d1f3b25edc4c0 Mon Sep 17 00:00:00 2001 From: marius-kilocode Date: Tue, 23 Jun 2026 18:56:16 +0200 Subject: [PATCH] chore(cli): clarify Bubblewrap licensing --- .github/workflows/publish.yml | 4 +++- .../tests/unit/server-manager-utils.test.ts | 5 +++++ packages/opencode/script/build.ts | 14 +++++++++++++- packages/opencode/script/kilocode/bubblewrap.ts | 14 ++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ecf968219..866cf143b8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -190,6 +190,7 @@ jobs: helper="$(dirname "$binary")/bwrap" if [[ "${{ matrix.target }}" == linux-* ]]; then test -x "$helper" + grep -q '^SPDX-License-Identifier: LGPL-2.0-or-later$' "$(dirname "$binary")/licenses/bubblewrap/NOTICE" "$helper" --version "$helper" --unshare-user --disable-userns --unshare-pid --die-with-parent --new-session \ --ro-bind / / --dev /dev --proc /proc -- "$helper" --version @@ -228,8 +229,9 @@ jobs: apk add --no-cache libstdc++ libgcc # kilocode_change end binary="/dist/$PACKAGE/bin/kilo" # kilocode_change - "$binary" --version + "$binary" --version # kilocode_change "/dist/$PACKAGE/bin/bwrap" --version # kilocode_change + grep -q '^SPDX-License-Identifier: LGPL-2.0-or-later$' "/dist/$PACKAGE/bin/licenses/bubblewrap/NOTICE" # kilocode_change root="$(mktemp -d)" trap '\''rm -rf "$root"'\'' EXIT unset KILO_MODELS_PATH KILO_MODELS_URL KILO_CONFIG KILO_CONFIG_DIR diff --git a/packages/kilo-vscode/tests/unit/server-manager-utils.test.ts b/packages/kilo-vscode/tests/unit/server-manager-utils.test.ts index 9365931762..58efd7f097 100644 --- a/packages/kilo-vscode/tests/unit/server-manager-utils.test.ts +++ b/packages/kilo-vscode/tests/unit/server-manager-utils.test.ts @@ -114,6 +114,7 @@ describe("cli tree-sitter resources", () => { const target = path.join(root, "extension", "bin", "kilo") const helper = path.join(path.dirname(source), "bwrap") const license = path.join(path.dirname(source), "licenses", "bubblewrap", "COPYING") + const notice = path.join(path.dirname(license), "NOTICE") await fs.mkdir(path.dirname(license), { recursive: true }) await fs.mkdir(path.dirname(target), { recursive: true }) @@ -121,6 +122,7 @@ describe("cli tree-sitter resources", () => { await fs.writeFile(target, "binary") await fs.writeFile(helper, "helper") await fs.writeFile(license, "LGPL") + await fs.writeFile(notice, "SPDX-License-Identifier: LGPL-2.0-or-later") await copySandboxResources(source, target) @@ -130,6 +132,9 @@ describe("cli tree-sitter resources", () => { expect(await fs.readFile(path.join(path.dirname(target), "licenses", "bubblewrap", "COPYING"), "utf8")).toBe( "LGPL", ) + expect(await fs.readFile(path.join(path.dirname(target), "licenses", "bubblewrap", "NOTICE"), "utf8")).toBe( + "SPDX-License-Identifier: LGPL-2.0-or-later", + ) } finally { await fs.rm(root, { recursive: true, force: true }) } diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 09f7e73e25..73afccba68 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -379,12 +379,24 @@ for (const item of targets) { } await $`rm -rf ./dist/${name}/bin/tui` + // kilocode_change start + if (bwrap) { + const licenses = path.resolve(dir, `dist/${name}/bin/licenses/bubblewrap`) + const content = await Promise.all([ + Bun.file(path.resolve(dir, "../../LICENSE")).text(), + Bun.file(path.join(licenses, "NOTICE")).text(), + Bun.file(path.join(licenses, "COPYING")).text(), + Bun.file(path.join(licenses, "MUSL-COPYRIGHT")).text(), + ]) + await Bun.write(`dist/${name}/LICENSE`, content.join("\n\n---\n\n")) + } + // kilocode_change end await Bun.file(`dist/${name}/package.json`).write( JSON.stringify( { name, version: Script.version, - license: pkg.license, // kilocode_change + license: bwrap ? "SEE LICENSE IN LICENSE" : pkg.license, // kilocode_change preferUnplugged: true, os: [item.os], cpu: [item.arch], diff --git a/packages/opencode/script/kilocode/bubblewrap.ts b/packages/opencode/script/kilocode/bubblewrap.ts index fc8512c4bd..d6f5aa779a 100644 --- a/packages/opencode/script/kilocode/bubblewrap.ts +++ b/packages/opencode/script/kilocode/bubblewrap.ts @@ -40,6 +40,19 @@ const config = `#pragma once #define PACKAGE_VERSION "${version}" ` +const notice = `Bubblewrap ${version} + +SPDX-License-Identifier: LGPL-2.0-or-later +Source: https://github.com/containers/bubblewrap/tree/${commit} + +Kilo distributes Bubblewrap as a separate executable. The complete license text is +in COPYING. The exact corresponding source is in bubblewrap-${commit}.tar.gz, and +the build recipe and generated compatibility headers are in build.ts. + +The executable is statically linked with musl. Its copyright and license notices +are in MUSL-COPYRIGHT. +` + function sha256(file: string) { return createHash("sha256").update(readFileSync(file)).digest("hex") } @@ -141,6 +154,7 @@ export async function stageBubblewrap(arch: "x64" | "arm64", dir: string) { rmSync(licenses, { recursive: true, force: true }) mkdirSync(licenses, { recursive: true }) copyFileSync(built.executable, path.join(dir, "bwrap")) + await Bun.write(path.join(licenses, "NOTICE"), notice) copyFileSync(built.license, path.join(licenses, "COPYING")) copyFileSync(built.musl, path.join(licenses, "MUSL-COPYRIGHT")) copyFileSync(built.archive, path.join(licenses, `bubblewrap-${commit}.tar.gz`))