mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
chore(cli): clarify Bubblewrap licensing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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`))
|
||||
|
||||
Reference in New Issue
Block a user