@pylair/cli 0.1.0-rc.3 → 0.1.0-rc.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/build/artifacts.d.ts +14 -0
- package/dist/build/artifacts.d.ts.map +1 -0
- package/dist/build/artifacts.js +61 -0
- package/dist/build/artifacts.js.map +1 -0
- package/dist/build/bytecode.d.ts +29 -0
- package/dist/build/bytecode.d.ts.map +1 -0
- package/dist/build/bytecode.js +65 -0
- package/dist/build/bytecode.js.map +1 -0
- package/dist/build/download.d.ts +53 -0
- package/dist/build/download.d.ts.map +1 -0
- package/dist/build/download.js +327 -0
- package/dist/build/download.js.map +1 -0
- package/dist/build/notices.d.ts +10 -0
- package/dist/build/notices.d.ts.map +1 -0
- package/dist/build/notices.js +109 -0
- package/dist/build/notices.js.map +1 -0
- package/dist/build/pbs.d.ts +12 -0
- package/dist/build/pbs.d.ts.map +1 -0
- package/dist/build/pbs.js +36 -0
- package/dist/build/pbs.js.map +1 -0
- package/dist/build/python.d.ts +24 -0
- package/dist/build/python.d.ts.map +1 -0
- package/dist/build/python.js +106 -0
- package/dist/build/python.js.map +1 -0
- package/dist/build/sign.d.ts +18 -0
- package/dist/build/sign.d.ts.map +1 -0
- package/dist/build/sign.js +182 -0
- package/dist/build/sign.js.map +1 -0
- package/dist/build/source.d.ts +19 -0
- package/dist/build/source.d.ts.map +1 -0
- package/dist/build/source.js +91 -0
- package/dist/build/source.js.map +1 -0
- package/dist/build/util.d.ts +20 -0
- package/dist/build/util.d.ts.map +1 -0
- package/dist/build/util.js +62 -0
- package/dist/build/util.js.map +1 -0
- package/dist/build.d.ts +26 -12
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +240 -270
- package/dist/build.js.map +1 -1
- package/dist/capabilities.d.ts +51 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +232 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli.d.ts +38 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +266 -39
- package/dist/cli.js.map +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +12 -1
- package/dist/codegen.js.map +1 -1
- package/dist/config.d.ts +25 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -12
- package/dist/config.js.map +1 -1
- package/dist/dev.d.ts +7 -3
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +120 -16
- package/dist/dev.js.map +1 -1
- package/dist/doctor.d.ts +34 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +268 -19
- package/dist/doctor.js.map +1 -1
- package/dist/keys.d.ts +50 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +192 -0
- package/dist/keys.js.map +1 -0
- package/dist/prune.d.ts.map +1 -1
- package/dist/prune.js +1 -0
- package/dist/prune.js.map +1 -1
- package/dist/ui/caps.d.ts +45 -0
- package/dist/ui/caps.d.ts.map +1 -0
- package/dist/ui/caps.js +81 -0
- package/dist/ui/caps.js.map +1 -0
- package/dist/ui/index.d.ts +106 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +264 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompts.d.ts +39 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +209 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/style.d.ts +27 -0
- package/dist/ui/style.d.ts.map +1 -0
- package/dist/ui/style.js +71 -0
- package/dist/ui/style.js.map +1 -0
- package/dist/update.d.ts +64 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +266 -0
- package/dist/update.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +15 -0
- package/dist/version.js.map +1 -0
- package/dist/wrap.d.ts +69 -0
- package/dist/wrap.d.ts.map +1 -0
- package/dist/wrap.js +292 -0
- package/dist/wrap.js.map +1 -0
- package/dist/wrapbuild.d.ts +33 -0
- package/dist/wrapbuild.d.ts.map +1 -0
- package/dist/wrapbuild.js +83 -0
- package/dist/wrapbuild.js.map +1 -0
- package/dist/wrapconfig.d.ts +52 -0
- package/dist/wrapconfig.d.ts.map +1 -0
- package/dist/wrapconfig.js +117 -0
- package/dist/wrapconfig.js.map +1 -0
- package/package.json +4 -3
package/dist/build.js
CHANGED
|
@@ -1,291 +1,261 @@
|
|
|
1
|
-
/** `pylair build
|
|
2
|
-
* fetch standalone CPython
|
|
3
|
-
* interpreter (native wheels only
|
|
4
|
-
* source
|
|
1
|
+
/** `pylair build`, the M0 recipe, generalized:
|
|
2
|
+
* fetch standalone CPython, stage site-packages via the bundled
|
|
3
|
+
* interpreter (native wheels only, no cross-compile), stage app
|
|
4
|
+
* source, prune, tauri build, unsigned warning.
|
|
5
|
+
*
|
|
6
|
+
* Output goes through ui/ (one step line per stage with its time; the tauri
|
|
7
|
+
* build folded into one progress line on a live terminal; plain, stable text
|
|
8
|
+
* everywhere else).
|
|
5
9
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
/*
|
|
11
|
+
* Where each step lives. build() below calls into them; this file also
|
|
12
|
+
* re-exports the helpers other modules and the tests import from here.
|
|
13
|
+
*
|
|
14
|
+
* build/pbs.ts python-build-standalone release, versions, host
|
|
15
|
+
* triples, committed SHA-256 table, hostTriple()
|
|
16
|
+
* build/download.ts the interpreter download: retry, resume, progress,
|
|
17
|
+
* timeout, cache and SHA-256 check (ensureTarball)
|
|
18
|
+
* build/python.ts fetchPython (unpack CPython), uv export and
|
|
19
|
+
* `uv pip install` into site-packages (stageEnv)
|
|
20
|
+
* build/source.ts stageSource: copy the app source, refuse secrets
|
|
21
|
+
* build/notices.ts stageNotices: THIRD-PARTY-NOTICES for the bundle
|
|
22
|
+
* build/bytecode.ts compileBytecode: checked-hash pycs for the bundle
|
|
23
|
+
* build/sign.ts macOS ad-hoc signing of the built .app (adHocSign)
|
|
24
|
+
* build/artifacts.ts the installers a build produced, for the summary
|
|
25
|
+
* build/util.ts isWin, run() and runTool(), shared by build() and the modules
|
|
26
|
+
* ./prune.ts pruning the staged tree (DEFAULT_PRUNE, prune)
|
|
27
|
+
* ./config.ts [tool.pylair] and tauri.conf.json loading
|
|
28
|
+
*/
|
|
29
|
+
import { spawnSync } from "node:child_process";
|
|
30
|
+
import { existsSync, rmSync } from "node:fs";
|
|
10
31
|
import { arch, platform, tmpdir } from "node:os";
|
|
11
32
|
import { join } from "node:path";
|
|
12
33
|
import { fileURLToPath } from "node:url";
|
|
13
|
-
import { importRoot, loadConfig, loadTauriConfig, tauriCliEntry } from "./config.js";
|
|
34
|
+
import { importRoot, loadConfig, loadTauriConfig, tauriCliEntry, windowsSigningConfigured, } from "./config.js";
|
|
35
|
+
import { assertCapabilities, checkPatterns, formatFinding, loadCapabilities } from "./capabilities.js";
|
|
36
|
+
import { loadManifest } from "./manifest.js";
|
|
14
37
|
import { DEFAULT_PRUNE, prune } from "./prune.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"3.12.12-x86_64-pc-windows-msvc": "70ecfaf0bfc58298db11d6389be92c29ec4ef8cd93ebb6a7e54b41d9fc056b10",
|
|
35
|
-
"3.12.12-x86_64-unknown-linux-gnu": "8d2cd1393c1aec9d701cebeccb83d1519951f71d3ecb42d5e70c70af4db9be34",
|
|
36
|
-
"3.13.9-aarch64-apple-darwin": "29d38bd5fbe267b37cecac990015c662796edcf51c2f5e321d59ec06a1850816",
|
|
37
|
-
"3.13.9-aarch64-unknown-linux-gnu": "fdc5d80488b64fcef3b99f297618f68e5374c13d89e888a66abeff4967afd308",
|
|
38
|
-
"3.13.9-x86_64-apple-darwin": "9da51afb00480a8ccd4909bd302c80d9c104d633c5e865cf37dd5e587185e125",
|
|
39
|
-
"3.13.9-x86_64-pc-windows-msvc": "f4c22b31ddbf8d7824cbcba2d8707621c2c8fab1fb6d2c1810c2bb0304d8e9a8",
|
|
40
|
-
"3.13.9-x86_64-unknown-linux-gnu": "1bc9a94ab2425fb6ae58e45f69cab61647759b57895649701390822d976fa923",
|
|
41
|
-
};
|
|
42
|
-
export function hostTriple() {
|
|
43
|
-
const t = HOST_TRIPLES[`${platform()}:${arch()}`];
|
|
44
|
-
if (!t)
|
|
45
|
-
throw new Error(`no standalone CPython build for ${platform()}/${arch()}`);
|
|
46
|
-
return t;
|
|
47
|
-
}
|
|
48
|
-
function download(url, to) {
|
|
49
|
-
return new Promise((res, rej) => {
|
|
50
|
-
const follow = (u) => get(u, (r) => {
|
|
51
|
-
if (r.statusCode >= 300 && r.statusCode < 400 && r.headers.location)
|
|
52
|
-
return follow(r.headers.location);
|
|
53
|
-
if (r.statusCode !== 200)
|
|
54
|
-
return rej(new Error(`GET ${u} -> ${r.statusCode}`));
|
|
55
|
-
const out = createWriteStream(to);
|
|
56
|
-
r.pipe(out);
|
|
57
|
-
out.on("finish", () => out.close(() => res()));
|
|
58
|
-
out.on("error", rej);
|
|
59
|
-
}).on("error", rej);
|
|
60
|
-
follow(url);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
async function fetchPython(resources, cacheDir, versionClass) {
|
|
64
|
-
const ver = PBS_VERSIONS[versionClass];
|
|
65
|
-
if (!ver)
|
|
66
|
-
throw new Error(`python-version "${versionClass}" not available — supported: ${Object.keys(PBS_VERSIONS).join(", ")}`);
|
|
67
|
-
const triple = hostTriple();
|
|
68
|
-
const asset = `cpython-${ver}+${PBS_TAG}-${triple}-install_only_stripped.tar.gz`;
|
|
69
|
-
const base = `https://github.com/astral-sh/python-build-standalone/releases/download/${PBS_TAG}`;
|
|
70
|
-
mkdirSync(resources, { recursive: true });
|
|
71
|
-
mkdirSync(cacheDir, { recursive: true });
|
|
72
|
-
const tarball = join(cacheDir, asset);
|
|
73
|
-
if (!existsSync(tarball)) {
|
|
74
|
-
console.log(`fetching ${asset}`);
|
|
75
|
-
await download(`${base}/${asset}`, tarball);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
console.log(`using cached ${asset}`);
|
|
79
|
-
}
|
|
80
|
-
// The interpreter ships to end users — verify against hashes committed
|
|
81
|
-
// in-repo (see PBS_SHA256), not a checksum file from the same release.
|
|
82
|
-
const want = PBS_SHA256[`${ver}-${triple}`];
|
|
83
|
-
if (!want)
|
|
84
|
-
throw new Error(`no committed SHA256 for ${ver}/${triple}`);
|
|
85
|
-
const got = createHash("sha256").update(readFileSync(tarball)).digest("hex");
|
|
86
|
-
if (got !== want)
|
|
87
|
-
throw new Error(`SHA256 mismatch for ${asset}: got ${got}, want ${want} — refusing to bundle`);
|
|
88
|
-
const dest = join(resources, "python");
|
|
89
|
-
rmSync(dest, { recursive: true, force: true });
|
|
90
|
-
mkdirSync(dest, { recursive: true });
|
|
91
|
-
execFileSync("tar", ["-xzf", tarball, "-C", dest, "--strip-components=1"], { stdio: "inherit" });
|
|
92
|
-
const py = join(dest, isWin ? "python.exe" : "bin/python3");
|
|
93
|
-
if (!existsSync(py))
|
|
94
|
-
throw new Error(`expected interpreter at ${py}`);
|
|
95
|
-
return py;
|
|
96
|
-
}
|
|
97
|
-
function stageEnv(resources, python, appDir, reqs, cacheDir) {
|
|
98
|
-
const target = join(resources, "site-packages");
|
|
99
|
-
rmSync(target, { recursive: true, force: true });
|
|
100
|
-
// dev uses `uv sync` (uv.lock) — build must install the SAME locked set,
|
|
101
|
-
// hashed, or dev/prod parity is a fiction. requirements.txt is the
|
|
102
|
-
// fallback for projects that don't lock.
|
|
103
|
-
const lock = join(appDir, "uv.lock");
|
|
104
|
-
let reqsFile = reqs;
|
|
105
|
-
let exported;
|
|
106
|
-
if (existsSync(lock)) {
|
|
107
|
-
exported = join(cacheDir, "requirements.exported.txt");
|
|
108
|
-
execFileSync("uv", ["export", "--frozen", "--format", "requirements-txt", "-o", exported], { cwd: appDir, stdio: "inherit" });
|
|
109
|
-
reqsFile = exported;
|
|
110
|
-
}
|
|
111
|
-
else if (!existsSync(reqs)) {
|
|
112
|
-
console.log(`no uv.lock and no ${reqs} — bundling stdlib only`);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
console.warn("warning: no uv.lock — building from requirements.txt; " +
|
|
117
|
-
"the bundled env may drift from `pylair dev`'s env");
|
|
118
|
-
}
|
|
119
|
-
execFileSync("uv", ["pip", "install", "--python", python, "--target", target, "-r", reqsFile], { cwd: appDir, stdio: "inherit" });
|
|
120
|
-
}
|
|
121
|
-
function run(cmd, args, cwd) {
|
|
122
|
-
const r = spawnSync(cmd, args, { cwd, stdio: "inherit" });
|
|
123
|
-
if (r.error)
|
|
124
|
-
throw new Error(`${cmd} ${args.join(" ")} failed to start: ${r.error.message}`);
|
|
125
|
-
if (r.status !== 0)
|
|
126
|
-
throw new Error(`${cmd} ${args.join(" ")} exited ${r.status}`);
|
|
127
|
-
}
|
|
128
|
-
/** Shipped bundles must carry the licenses of what they embed. Collects:
|
|
129
|
-
* pylair's own dual license, the interpreter's license tree (PSF license
|
|
130
|
-
* requires LICENSE text with redistributed CPython), and each wheel's
|
|
131
|
-
* dist-info license files. Runs before prune so nothing collected is
|
|
132
|
-
* deleted afterwards. Returns the notice dir.
|
|
133
|
-
*/
|
|
134
|
-
export function stageNotices(resources, pylairDir) {
|
|
135
|
-
const out = join(resources, "THIRD-PARTY-NOTICES");
|
|
136
|
-
rmSync(out, { recursive: true, force: true });
|
|
137
|
-
mkdirSync(out, { recursive: true });
|
|
138
|
-
const index = [];
|
|
139
|
-
const copyInto = (subdir, src, dest) => {
|
|
140
|
-
mkdirSync(join(out, subdir), { recursive: true });
|
|
141
|
-
cpSync(src, join(out, subdir, dest));
|
|
142
|
-
};
|
|
143
|
-
const LICENSEISH = /^(licen[cs]e|copying|notice|authors|copyright)/i;
|
|
144
|
-
for (const f of ["LICENSE-MIT", "LICENSE-APACHE"]) {
|
|
145
|
-
const src = join(pylairDir, f);
|
|
146
|
-
if (existsSync(src))
|
|
147
|
-
copyInto("pylair", src, f);
|
|
148
|
-
}
|
|
149
|
-
index.push("pylair/ — pylair itself (MIT OR Apache-2.0)");
|
|
150
|
-
// The interpreter: python-build-standalone ships a licenses/ dir holding
|
|
151
|
-
// CPython's license plus every statically-linked dep (OpenSSL, libffi…).
|
|
152
|
-
const pyRoot = join(resources, "python");
|
|
153
|
-
let found = 0;
|
|
154
|
-
const walkPy = (dir) => {
|
|
155
|
-
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
156
|
-
const p = join(dir, e.name);
|
|
157
|
-
if (e.isDirectory()) {
|
|
158
|
-
if (e.name.toLowerCase() === "licenses") {
|
|
159
|
-
cpSync(p, join(out, "python", "licenses"), { recursive: true });
|
|
160
|
-
found++;
|
|
161
|
-
}
|
|
162
|
-
else
|
|
163
|
-
walkPy(p);
|
|
164
|
-
}
|
|
165
|
-
else if (LICENSEISH.test(e.name)) {
|
|
166
|
-
copyInto("python", p, e.name);
|
|
167
|
-
found++;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
if (existsSync(pyRoot))
|
|
172
|
-
walkPy(pyRoot);
|
|
173
|
-
if (!found) {
|
|
174
|
-
mkdirSync(join(out, "python"), { recursive: true });
|
|
175
|
-
writeFileSync(join(out, "python", "NOTICE.txt"), "This app bundles CPython (PSF-2.0 license) via python-build-standalone.\n" +
|
|
176
|
-
"License texts were not located in the interpreter tree at build time;\n" +
|
|
177
|
-
"they ship upstream in the python/licenses directory of each\n" +
|
|
178
|
-
"python-build-standalone release.\n");
|
|
179
|
-
console.warn("warning: no license files found under resources/python — wrote placeholder NOTICE");
|
|
180
|
-
}
|
|
181
|
-
index.push("python/ — bundled CPython interpreter (PSF-2.0) and its vendored deps");
|
|
182
|
-
// Wheels: every installed dist-info/egg-info carries license files or
|
|
183
|
-
// license metadata. Copy whichever exists.
|
|
184
|
-
const sp = join(resources, "site-packages");
|
|
185
|
-
let wheels = 0;
|
|
186
|
-
if (existsSync(sp)) {
|
|
187
|
-
for (const e of readdirSync(sp, { withFileTypes: true })) {
|
|
188
|
-
if (!e.isDirectory())
|
|
189
|
-
continue;
|
|
190
|
-
const m = /^(.*?)-[\d.]+.*\.(dist-info|egg-info)$/.exec(e.name);
|
|
191
|
-
if (!m)
|
|
192
|
-
continue;
|
|
193
|
-
const pkg = m[1].replace(/[^\w.-]/g, "_");
|
|
194
|
-
const d = join(sp, e.name);
|
|
195
|
-
let kept = false;
|
|
196
|
-
for (const f of readdirSync(d, { withFileTypes: true })) {
|
|
197
|
-
if (f.isDirectory() && f.name.toLowerCase() === "licenses") {
|
|
198
|
-
cpSync(join(d, f.name), join(out, pkg, "licenses"), { recursive: true });
|
|
199
|
-
kept = true;
|
|
200
|
-
}
|
|
201
|
-
else if (f.isFile() && LICENSEISH.test(f.name)) {
|
|
202
|
-
copyInto(pkg, join(d, f.name), f.name);
|
|
203
|
-
kept = true;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
const meta = join(d, "METADATA");
|
|
207
|
-
if (existsSync(meta)) {
|
|
208
|
-
const lines = readFileSync(meta, "utf-8")
|
|
209
|
-
.split("\n")
|
|
210
|
-
.filter((l) => /^(License|Classifier: License)/i.test(l));
|
|
211
|
-
// Copyleft is legal to ship but app authors deserve to know they
|
|
212
|
-
// bundled it — warn, never block.
|
|
213
|
-
if (/\b(a?lgpl|gpl)[ -]?v?\d/i.test(lines.join(" ")))
|
|
214
|
-
console.warn(`warning: bundled wheel ${e.name} declares a copyleft license`);
|
|
215
|
-
if (lines.length) {
|
|
216
|
-
mkdirSync(join(out, pkg), { recursive: true });
|
|
217
|
-
writeFileSync(join(out, pkg, "METADATA-LICENSE.txt"), lines.join("\n") + "\n");
|
|
218
|
-
kept = true;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
if (kept) {
|
|
222
|
-
wheels++;
|
|
223
|
-
index.push(`${pkg}/ — from ${e.name}`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
writeFileSync(join(out, "INDEX.txt"), index.join("\n") + "\n");
|
|
228
|
-
console.log(`third-party notices: pylair, python interpreter, ${wheels} wheel(s)`);
|
|
229
|
-
return out;
|
|
230
|
-
}
|
|
38
|
+
import { findArtifacts } from "./build/artifacts.js";
|
|
39
|
+
import { compileBytecode } from "./build/bytecode.js";
|
|
40
|
+
import { stageNotices } from "./build/notices.js";
|
|
41
|
+
import { hostTriple } from "./build/pbs.js";
|
|
42
|
+
import { fetchPython, stageEnv } from "./build/python.js";
|
|
43
|
+
import { adHocSign } from "./build/sign.js";
|
|
44
|
+
import { stageSource } from "./build/source.js";
|
|
45
|
+
import { isWin, runTool } from "./build/util.js";
|
|
46
|
+
import { assertUpdaterVersionSync } from "./update.js";
|
|
47
|
+
import { formatDuration, formatSize, ui } from "./ui/index.js";
|
|
48
|
+
import { wrapWarnings } from "./wrapconfig.js";
|
|
49
|
+
import { ROOT_SOURCE_EXCLUDES, STAGED_APP, runSmokeImports, smokeImports, sourceIsRoot, writeRuntimeFile, } from "./wrapbuild.js";
|
|
50
|
+
export { compileBytecode, PYC_INVALIDATION_MODE } from "./build/bytecode.js";
|
|
51
|
+
export { DownloadError, backoffMs, download, downloadTimeoutMs, downloadWithRetry, ensureTarball, } from "./build/download.js";
|
|
52
|
+
export { stageNotices } from "./build/notices.js";
|
|
53
|
+
export { hostTriple } from "./build/pbs.js";
|
|
54
|
+
export { stageSource } from "./build/source.js";
|
|
55
|
+
export { requirementsHaveHashes, uvExportArgs, uvPipInstallArgs } from "./build/python.js";
|
|
56
|
+
const UNSIGNED_WARNING = "UNSIGNED BUILD: Gatekeeper and SmartScreen will warn users (see docs/build.md#signing)";
|
|
231
57
|
export async function build(opts) {
|
|
232
58
|
const { appDir } = opts;
|
|
59
|
+
const verbose = opts.verbose ?? false;
|
|
60
|
+
const started = Date.now();
|
|
233
61
|
const tauriDir = join(appDir, "src-tauri");
|
|
234
62
|
const resources = join(tauriDir, "resources");
|
|
235
63
|
const tconf = loadTauriConfig(appDir);
|
|
236
64
|
const cfg = loadConfig(appDir);
|
|
65
|
+
const wrap = cfg.mode === "wrap" ? cfg.wrap : undefined;
|
|
66
|
+
if (wrap)
|
|
67
|
+
for (const w of wrapWarnings(wrap))
|
|
68
|
+
ui.warn(`warning: ${w}`);
|
|
69
|
+
// Capability scopes are checked first: a bad `allow: []` or a half-scoped
|
|
70
|
+
// window is a configuration error, not worth a Python download to find out.
|
|
71
|
+
for (const w of assertCapabilities(appDir))
|
|
72
|
+
ui.warn(formatFinding(w), { bare: true });
|
|
73
|
+
// Updater-enabled apps: tauri.conf.json's version is what the updater
|
|
74
|
+
// compares an offer against; Cargo.toml's is what the binary reports —
|
|
75
|
+
// they must match or an updated app misreports itself (0011 §1). Checked
|
|
76
|
+
// for every build once plugins.updater exists, and whenever --sign asks
|
|
77
|
+
// for updater artifacts.
|
|
78
|
+
if (tconf.updater || opts.sign)
|
|
79
|
+
assertUpdaterVersionSync(tauriDir, tconf.version);
|
|
80
|
+
if (opts.sign) {
|
|
81
|
+
if (!process.env.TAURI_SIGNING_PRIVATE_KEY)
|
|
82
|
+
throw new Error("pylair build --sign: TAURI_SIGNING_PRIVATE_KEY is not set - generate " +
|
|
83
|
+
"the keypair with `pylair keys init` and put the private key in CI " +
|
|
84
|
+
"secrets (docs/updates.md)");
|
|
85
|
+
if (!tconf.updater)
|
|
86
|
+
ui.warn("warning: --sign produces updater artifacts but tauri.conf.json has no " +
|
|
87
|
+
"plugins.updater block - nothing will consume them (docs/updates.md)", { bare: true });
|
|
88
|
+
}
|
|
237
89
|
const targetTriple = hostTriple(); // cross-compile refused by construction
|
|
238
|
-
|
|
239
|
-
|
|
90
|
+
ui.header("pylair build", [
|
|
91
|
+
["app", tconf.productName],
|
|
92
|
+
["version", tconf.version],
|
|
93
|
+
["platform", `${platform()}/${arch()} (${targetTriple}), native build only`],
|
|
94
|
+
["mode", wrap ? `wrap (${wrap.framework})` : "bridge"],
|
|
95
|
+
], [
|
|
96
|
+
`building ${tconf.productName} ${tconf.version} for ${platform()}/${arch()} (${targetTriple})`,
|
|
97
|
+
"note: pylair builds native bundles only; run this on each target OS",
|
|
98
|
+
]);
|
|
99
|
+
const stages = [
|
|
100
|
+
"bundle python",
|
|
101
|
+
"install deps",
|
|
102
|
+
"stage app",
|
|
103
|
+
"prune",
|
|
104
|
+
"compile bytecode",
|
|
105
|
+
"smoke test",
|
|
106
|
+
...(opts.stageOnly ? [] : ["build installer"]),
|
|
107
|
+
];
|
|
108
|
+
ui.setStepWidth(Math.max(...stages.map((s) => s.length)));
|
|
240
109
|
const cacheDir = join(appDir, ".pylair", "cache");
|
|
241
|
-
const bundled =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
110
|
+
const bundled = await ui.step("bundle python", async (s) => {
|
|
111
|
+
if (opts.skipFetch) {
|
|
112
|
+
s.detail("reusing staged python");
|
|
113
|
+
return join(resources, "python", isWin ? "python.exe" : "bin/python3");
|
|
114
|
+
}
|
|
115
|
+
return fetchPython(resources, cacheDir, cfg.pythonVersion);
|
|
116
|
+
});
|
|
117
|
+
await ui.step("install deps", (s) => stageEnv(resources, bundled, appDir, join(appDir, cfg.requirements), cacheDir, { step: s, verbose }));
|
|
247
118
|
// Stage app source so resources/ mirrors the installed layout.
|
|
119
|
+
// Wrap mode stages the app as `app/` whatever the source dir is called, so
|
|
120
|
+
// tauri.conf.json's resource mapping never changes with `source`.
|
|
121
|
+
const staged = wrap ? STAGED_APP : cfg.source;
|
|
248
122
|
const srcDir = join(appDir, cfg.source);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
123
|
+
await ui.step("stage app", () => {
|
|
124
|
+
// Licenses ship with the bundle: collect before prune can remove sources.
|
|
125
|
+
stageNotices(resources, fileURLToPath(new URL("..", import.meta.url)));
|
|
126
|
+
if (!existsSync(srcDir))
|
|
127
|
+
throw new Error(`source dir ${srcDir} missing`);
|
|
128
|
+
if (wrap?.entry && !existsSync(join(srcDir, wrap.entry)))
|
|
129
|
+
throw new Error(`[tool.pylair.wrap] entry ${wrap.entry} not found under ${srcDir}`);
|
|
130
|
+
rmSync(join(resources, staged), { recursive: true, force: true });
|
|
131
|
+
stageSource(srcDir, join(resources, staged), cfg.include, undefined, wrap && sourceIsRoot(appDir, cfg.source) ? ROOT_SOURCE_EXCLUDES : []);
|
|
132
|
+
// What the plugin reads at startup: the launcher command and the window options.
|
|
133
|
+
if (wrap)
|
|
134
|
+
writeRuntimeFile(join(resources, "pylair-wrap.json"), cfg, STAGED_APP);
|
|
135
|
+
});
|
|
136
|
+
await ui.step("prune", (s) => {
|
|
137
|
+
const res = prune(resources, [...DEFAULT_PRUNE, ...cfg.prune]);
|
|
138
|
+
const mib = (res.bytesFreed / 2 ** 20).toFixed(1);
|
|
139
|
+
if (ui.caps.fancy)
|
|
140
|
+
s.detail(`${res.removed} paths, ${mib} MiB freed`);
|
|
141
|
+
else
|
|
142
|
+
ui.line(`pruned ${res.removed} paths (${mib} MiB) from staged resources`);
|
|
143
|
+
});
|
|
144
|
+
// Precompile what survives the prune: read-only installs cannot
|
|
145
|
+
// write pycs at launch, so the bundle ships them ready-made.
|
|
146
|
+
await ui.step("compile bytecode", (s) => {
|
|
147
|
+
const failed = compileBytecode(resources, bundled, ["site-packages", staged]);
|
|
148
|
+
if (failed.length)
|
|
149
|
+
s.detail(`${failed.length} file(s) left uncompiled`);
|
|
150
|
+
});
|
|
256
151
|
// Over-pruning must fail at build time, not on the user's machine:
|
|
257
|
-
// import the app
|
|
152
|
+
// import the app (bridge) or the framework (wrap) with the staged tree
|
|
153
|
+
// exactly as the bundle sees it.
|
|
258
154
|
const sep = isWin ? ";" : ":";
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
155
|
+
await ui.step("smoke test", (s) => {
|
|
156
|
+
if (wrap) {
|
|
157
|
+
// The server runs in the staged app dir; the framework (gradio,
|
|
158
|
+
// streamlit, or the `-m` module of a command) must import with the
|
|
159
|
+
// bundled interpreter after the prune.
|
|
160
|
+
const failure = runSmokeImports(bundled, smokeImports(wrap), {
|
|
161
|
+
PYTHONPATH: `${join(resources, STAGED_APP)}${sep}${join(resources, "site-packages")}`,
|
|
162
|
+
PYTHONNOUSERSITE: "1",
|
|
163
|
+
PYTHONDONTWRITEBYTECODE: "1",
|
|
164
|
+
}, tmpdir());
|
|
165
|
+
if (failure)
|
|
166
|
+
throw new Error(`staged bundle failed the framework import check (${smokeImports(wrap).join(", ")}): ` +
|
|
167
|
+
`pruning or missing deps? ${failure}`);
|
|
168
|
+
s.detail(`imports ${smokeImports(wrap).join(", ")}`);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// The import root is the PARENT of the staged source dir ("backend.app"
|
|
172
|
+
// resolves from resources/, not resources/backend/). Run from an unrelated
|
|
173
|
+
// cwd so the project checkout can't satisfy the import by accident.
|
|
174
|
+
// PYTHONDONTWRITEBYTECODE: the check exercises the compiled pycs rather
|
|
175
|
+
// than writing a second, non-deterministic set into the staged tree.
|
|
176
|
+
const check = spawnSync(bundled, ["-c", `import ${cfg.appModule}; print("staged import ok")`], {
|
|
177
|
+
encoding: "utf-8",
|
|
178
|
+
cwd: tmpdir(),
|
|
179
|
+
env: {
|
|
180
|
+
...process.env,
|
|
181
|
+
PYTHONPATH: `${importRoot(resources, cfg.source)}${sep}${join(resources, "site-packages")}`,
|
|
182
|
+
PYTHONNOUSERSITE: "1",
|
|
183
|
+
PYTHONDONTWRITEBYTECODE: "1",
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
if (check.status !== 0)
|
|
187
|
+
throw new Error(`staged bundle failed the import check (${cfg.appModule}): ` +
|
|
188
|
+
`pruning or missing deps? ${check.stderr?.trim()}`);
|
|
189
|
+
s.detail(`imports ${cfg.appModule}`);
|
|
190
|
+
}
|
|
191
|
+
// With the app importable, ask it which functions it exposes and warn
|
|
192
|
+
// about scope patterns that match none. Best effort: a failure here only
|
|
193
|
+
// skips the warning, it never fails the build.
|
|
194
|
+
const caps = wrap ? [] : loadCapabilities(appDir).capabilities;
|
|
195
|
+
if (caps.length) {
|
|
196
|
+
try {
|
|
197
|
+
const m = loadManifest({
|
|
198
|
+
python: bundled,
|
|
199
|
+
module: cfg.appModule,
|
|
200
|
+
cwd: tmpdir(),
|
|
201
|
+
env: {
|
|
202
|
+
PYTHONPATH: `${importRoot(resources, cfg.source)}${sep}${join(resources, "site-packages")}`,
|
|
203
|
+
PYTHONNOUSERSITE: "1",
|
|
204
|
+
PYTHONDONTWRITEBYTECODE: "1",
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
const names = (m.functions ?? []).map((f) => f.name);
|
|
208
|
+
for (const w of checkPatterns(caps, names))
|
|
209
|
+
ui.warn(formatFinding(w), { bare: true });
|
|
210
|
+
}
|
|
211
|
+
catch (e) {
|
|
212
|
+
ui.note(`note: skipped the capability pattern check (could not list exposed functions: ${e.message.split("\n")[0]})`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
270
215
|
});
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// NOTE: TAURI_SIGNING_PRIVATE_KEY signs *updater* artifacts, not the app —
|
|
276
|
-
// it must NOT silence the unsigned warning.
|
|
277
|
-
const hasSigning = !!(process.env.APPLE_SIGNING_IDENTITY ||
|
|
278
|
-
process.env.APPLE_CERTIFICATE ||
|
|
279
|
-
process.env.WINDOWS_CERTIFICATE_THUMBPRINT);
|
|
280
|
-
run(process.execPath, [tauriCliEntry(appDir), "build", ...(opts.tauriArgs ?? [])], appDir);
|
|
281
|
-
if (!hasSigning) {
|
|
282
|
-
console.warn(`
|
|
283
|
-
╔══════════════════════════════════════════════════════════════════╗
|
|
284
|
-
║ UNSIGNED BUILD — this bundle is not code-signed or notarized. ║
|
|
285
|
-
║ macOS Gatekeeper and Windows SmartScreen will warn users. ║
|
|
286
|
-
║ To sign: set APPLE_SIGNING_IDENTITY / TAURI_SIGNING_PRIVATE_KEY / ║
|
|
287
|
-
║ WINDOWS_CERTIFICATE_THUMBPRINT (see docs/build.md). ║
|
|
288
|
-
╚══════════════════════════════════════════════════════════════════╝`);
|
|
216
|
+
if (opts.stageOnly) {
|
|
217
|
+
ui.line();
|
|
218
|
+
ui.summary("ok", `stage-only: resources staged and verified; tauri build skipped (${formatDuration(Date.now() - started)})`);
|
|
219
|
+
return;
|
|
289
220
|
}
|
|
221
|
+
// Signing is per-platform: only macOS creds (env OR tauri.conf
|
|
222
|
+
// signingIdentity) mean this Mac build gets a real signature; a Windows
|
|
223
|
+
// thumbprint on its own must not suppress the ad-hoc pass.
|
|
224
|
+
// NOTE: TAURI_SIGNING_PRIVATE_KEY signs *updater* artifacts, not the app,
|
|
225
|
+
// so it must NOT silence the unsigned warning.
|
|
226
|
+
const appleSigned = !!(process.env.APPLE_SIGNING_IDENTITY ||
|
|
227
|
+
process.env.APPLE_CERTIFICATE ||
|
|
228
|
+
tconf.macSigningIdentity);
|
|
229
|
+
const hasSigning = platform() === "darwin"
|
|
230
|
+
? appleSigned
|
|
231
|
+
: platform() === "win32"
|
|
232
|
+
? windowsSigningConfigured(appDir)
|
|
233
|
+
: true; // no signing concept on Linux: don't warn
|
|
234
|
+
const tauriArgs = opts.tauriArgs ?? [];
|
|
235
|
+
// --sign forces bundle.createUpdaterArtifacts via tauri's --config merge,
|
|
236
|
+
// so a one-off signed build needs no conf edit. Merged last: it wins over
|
|
237
|
+
// a --config the user forwarded only for this one key.
|
|
238
|
+
if (opts.sign)
|
|
239
|
+
tauriArgs.push("--config", JSON.stringify({ bundle: { createUpdaterArtifacts: true } }));
|
|
240
|
+
const tauriStarted = Date.now();
|
|
241
|
+
await ui.step("build installer", (s) => runTool(ui, process.execPath, [tauriCliEntry(appDir), "build", ...tauriArgs], appDir, {
|
|
242
|
+
step: s,
|
|
243
|
+
verbose: verbose || tauriArgs.includes("--verbose"),
|
|
244
|
+
}));
|
|
245
|
+
// Unsigned macOS builds get a full-bundle ad-hoc signature, better
|
|
246
|
+
// than the linker stub Tauri leaves on just the main binary. Skipped
|
|
247
|
+
// entirely when a real identity is configured: ad-hoc must never run
|
|
248
|
+
// over a proper signature.
|
|
249
|
+
if (platform() === "darwin" && !appleSigned)
|
|
250
|
+
await ui.step("ad-hoc sign", () => adHocSign(tauriDir, tconf.productName));
|
|
251
|
+
const artifacts = findArtifacts(tauriDir, tauriStarted, { debug: tauriArgs.includes("--debug") });
|
|
252
|
+
ui.line();
|
|
253
|
+
ui.summary("ok", `built ${tconf.productName} ${tconf.version} in ${formatDuration(Date.now() - started)}`);
|
|
254
|
+
if (artifacts.length)
|
|
255
|
+
ui.rows(artifacts.map((a) => [formatSize(a.bytes).padStart(9), a.path]), 2);
|
|
256
|
+
else
|
|
257
|
+
ui.note(" no installer found under the bundle directory (built with --no-bundle?)");
|
|
258
|
+
if (!hasSigning)
|
|
259
|
+
ui.warn(UNSIGNED_WARNING, { bare: true });
|
|
290
260
|
}
|
|
291
261
|
//# sourceMappingURL=build.js.map
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE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AAC;IACV,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3G,IAAI,SAAS,CAAC,MAAM;QAClB,EAAE,CAAC,IAAI,CACL,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAU,CAAC,EACxE,CAAC,CACF,CAAC;;QACC,EAAE,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;IAC1F,IAAI,CAAC,UAAU;QAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static checks over `src-tauri/capabilities/*.json|toml` for the
|
|
3
|
+
* per-function permissions of `tauri-plugin-pylair` (docs/security.md,
|
|
4
|
+
* "Restricting functions per window"). Run by `pylair build` and
|
|
5
|
+
* `pylair doctor`.
|
|
6
|
+
*
|
|
7
|
+
* The plugin enforces the scopes at runtime and fails closed; these checks
|
|
8
|
+
* exist to catch the configurations that are legal but almost certainly not
|
|
9
|
+
* what the author meant, before an app ships:
|
|
10
|
+
*
|
|
11
|
+
* - `allow: []` on a pylair permission: Tauri treats an empty list as "no
|
|
12
|
+
* scope entries", which permits EVERY function. (error)
|
|
13
|
+
* - a window that scopes `python-call` but not `python-call-stream`, or the
|
|
14
|
+
* reverse: the unscoped command is an open side door. (error)
|
|
15
|
+
* - a malformed scope entry: the plugin refuses every call it covers. (error)
|
|
16
|
+
* - a pattern that matches no exposed function: a typo, or a function that
|
|
17
|
+
* was renamed. (warning, only when the exposed names are known)
|
|
18
|
+
* - different scopes on the two commands of one window. (warning)
|
|
19
|
+
*/
|
|
20
|
+
export interface Finding {
|
|
21
|
+
level: "error" | "warn";
|
|
22
|
+
/** Path relative to the app dir, forward slashes. */
|
|
23
|
+
file: string;
|
|
24
|
+
/** Capability `identifier`; empty when the file did not parse. */
|
|
25
|
+
capability: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Capability {
|
|
29
|
+
file: string;
|
|
30
|
+
identifier: string;
|
|
31
|
+
windows: string[];
|
|
32
|
+
permissions: unknown[];
|
|
33
|
+
}
|
|
34
|
+
/** The plugin's matching rule: exact, or a single trailing `*` as a prefix
|
|
35
|
+
* wildcard. A `*` anywhere else is a literal character. Keep in step with
|
|
36
|
+
* `fn_scope::pattern_matches` in the plugin. */
|
|
37
|
+
export declare function patternMatches(pattern: string, name: string): boolean;
|
|
38
|
+
export declare function loadCapabilities(appDir: string): {
|
|
39
|
+
capabilities: Capability[];
|
|
40
|
+
findings: Finding[];
|
|
41
|
+
};
|
|
42
|
+
/** Warn for every pattern that matches no name in `exposed`. */
|
|
43
|
+
export declare function checkPatterns(caps: Capability[], exposed: string[]): Finding[];
|
|
44
|
+
export declare function checkCapabilities(caps: Capability[], exposed?: string[]): Finding[];
|
|
45
|
+
export declare function formatFinding(f: Finding): string;
|
|
46
|
+
/**
|
|
47
|
+
* The static checks `pylair build` runs before any slow work: throws,
|
|
48
|
+
* listing every error, if any; otherwise returns the warnings.
|
|
49
|
+
*/
|
|
50
|
+
export declare function assertCapabilities(appDir: string, exposed?: string[]): Finding[];
|
|
51
|
+
//# sourceMappingURL=capabilities.d.ts.map
|