@pumpkin-plugins/build 0.0.0 → 0.1.1
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 +15 -1
- package/dist/cli.js +1788 -0
- package/package.json +77 -10
- package/runtime/LICENSE.componentize-qjs +202 -0
- package/runtime/README.md +94 -0
- package/runtime/build.sh +68 -0
- package/runtime/componentize-qjs-bigint.patch +57 -0
- package/runtime/provenance.json +16 -0
- package/runtime/provenance.mjs +154 -0
- package/runtime/quickjs-runtime-bigint.wasm +0 -0
- package/wasi-wit.lock.json +34 -0
package/package.json
CHANGED
|
@@ -1,12 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
2
|
+
"name": "@pumpkin-plugins/build",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Shared build tool for the plugins",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"minecraft",
|
|
7
|
+
"pumpkin",
|
|
8
|
+
"plugin",
|
|
9
|
+
"build-tool",
|
|
10
|
+
"webassembly",
|
|
11
|
+
"wasm",
|
|
12
|
+
"wasi"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/filiphsps/pumpkin-plugins/tree/master/tools/build#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/filiphsps/pumpkin-plugins/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/filiphsps/pumpkin-plugins.git",
|
|
21
|
+
"directory": "tools/build"
|
|
22
|
+
},
|
|
23
|
+
"funding": [
|
|
24
|
+
{
|
|
25
|
+
"type": "github",
|
|
26
|
+
"url": "https://github.com/sponsors/filiphsps"
|
|
8
27
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
28
|
+
{
|
|
29
|
+
"type": "custom",
|
|
30
|
+
"url": "https://paypal.me/filiph"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"author": "Filiph Sandström <filfat@hotmail.se> (https://github.com/filiphsps)",
|
|
35
|
+
"contributors": [
|
|
36
|
+
"Filiph Sandström <filfat@hotmail.se> (https://github.com/filiphsps)"
|
|
37
|
+
],
|
|
38
|
+
"type": "module",
|
|
39
|
+
"bin": {
|
|
40
|
+
"pumpkin-plugins-build": "dist/cli.js"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"runtime",
|
|
45
|
+
"wasi-wit.lock.json"
|
|
46
|
+
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@badisi/latest-version": "9.0.2",
|
|
49
|
+
"@bytecodealliance/jco": "1.36.1",
|
|
50
|
+
"@commander-js/extra-typings": "15.0.0",
|
|
51
|
+
"@di-framework/componentize-qjs": "0.4.4-di.3",
|
|
52
|
+
"@pumpkin-plugins/minecraft-colors": "0.1.0",
|
|
53
|
+
"@pumpkin-plugins/pumpkin-api": "0.1.0",
|
|
54
|
+
"@pumpkin-plugins/static-hermes-runtime": "0.1.0",
|
|
55
|
+
"commander": "15.0.0",
|
|
56
|
+
"esbuild": "0.28.2",
|
|
57
|
+
"typescript": "6.0.3"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@pumpkin-plugins/docs": "0.1.2",
|
|
61
|
+
"@types/node": "24.19.1",
|
|
62
|
+
"@vitest/coverage-v8": "5.0.4",
|
|
63
|
+
"vitest": "5.0.4"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=24.21.0"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node24 --packages=external --alias:@pumpkin-plugins/minecraft-colors=../minecraft-colors/src/index.ts --outfile=dist/cli.js",
|
|
73
|
+
"readme": "pumpkin-plugins-docs generate docs.ts",
|
|
74
|
+
"readme:check": "pumpkin-plugins-docs generate docs.ts --check",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:coverage": "vitest run --coverage",
|
|
77
|
+
"typecheck": "tsc --noEmit"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# BigInt QuickJS runtime
|
|
2
|
+
|
|
3
|
+
`quickjs-runtime-bigint.wasm` is built from the pinned upstream
|
|
4
|
+
`componentize-qjs` source with `componentize-qjs-bigint.patch` applied. The patch
|
|
5
|
+
converts WIT `u64` and `s64` values to JavaScript `bigint` on push and reads them
|
|
6
|
+
from JavaScript `bigint` on pop. The runtime is Apache-2.0; its license is
|
|
7
|
+
included as `LICENSE.componentize-qjs`.
|
|
8
|
+
|
|
9
|
+
The runtime tracks imported resource ownership, provides `drop()` and
|
|
10
|
+
`Symbol.dispose`, and releases unreachable owned handles after QuickJS evaluation.
|
|
11
|
+
Without those releases, handles can exhaust the component resource table even
|
|
12
|
+
when plugins request disposal. Event resources returned to Pumpkin must remain
|
|
13
|
+
alive until the return transfers ownership to the host.
|
|
14
|
+
|
|
15
|
+
The [build tool](../README.md) passes this runtime to its componentizer through
|
|
16
|
+
`--runtime`. That option cannot be combined with the componentizer's `--opt-size`
|
|
17
|
+
mode, so the runtime itself is compiled with the size optimization flags listed
|
|
18
|
+
in its generated provenance below.
|
|
19
|
+
|
|
20
|
+
## Pinned build provenance
|
|
21
|
+
|
|
22
|
+
The build script validates the source, patch, lockfile and toolchain against this
|
|
23
|
+
manifest before building. It reads the target, feature and compiler flags from
|
|
24
|
+
the same manifest, so the values below describe the inputs used by the script.
|
|
25
|
+
|
|
26
|
+
<!-- docs:begin provenance -->
|
|
27
|
+
<!-- Generated from runtime/provenance.json, runtime/build.sh, and package.json. Run `pnpm --filter @pumpkin-plugins/build readme`. -->
|
|
28
|
+
|
|
29
|
+
| Input | Pinned value |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| Node.js engine | `>=24.21.0` |
|
|
32
|
+
| QuickJS source | [`e563c6d6ae50b087980414015663ca9c948c09bb`](https://github.com/andreiltd/componentize-qjs/tree/e563c6d6ae50b087980414015663ca9c948c09bb) |
|
|
33
|
+
| Source repository | `https://github.com/andreiltd/componentize-qjs.git` |
|
|
34
|
+
| BigInt patch SHA-256 | `515a06e47c3c8eb819fb1ec464560cb66dfb9fe25c51ff560534da8de99b4a43` |
|
|
35
|
+
| Cargo.lock SHA-256 | `03e153b621bf6b830064d6b0931ebe98e28aa93bc833913397fb48720843d656` |
|
|
36
|
+
| Rust compiler | `rustc 1.99.0 (b940084d7 2026-09-28)` |
|
|
37
|
+
| Cargo | `cargo 1.99.0 (5f94df478 2026-08-27)` |
|
|
38
|
+
| WASI SDK | `34.0` (build script requires major `34`) |
|
|
39
|
+
| Clang | `clang version 23.1.0-wasi-sdk (https://github.com/llvm/llvm-project 895aa2c896ada719451be2e3673c83da8ddf1141)` |
|
|
40
|
+
| Target and feature | `wasm32-wasip2` / `component-model-async` |
|
|
41
|
+
| Rust flags | `-Clink-arg=--shared -Clink-arg=--no-entry -Clink-arg=--allow-undefined -Clto=fat -Copt-level=z` |
|
|
42
|
+
| C flags | `-fPIC -Oz` |
|
|
43
|
+
| Shipped runtime SHA-256 | `75219b89307011c7cd2bd6212e18a7d0ff1ba16d560c130d5173ccacb1880988` |
|
|
44
|
+
<!-- docs:end provenance -->
|
|
45
|
+
|
|
46
|
+
## Rebuild
|
|
47
|
+
|
|
48
|
+
Use the Node.js range and toolchain values shown above. Install the listed Rust
|
|
49
|
+
target and put the pinned Rust toolchain first on `PATH`.
|
|
50
|
+
|
|
51
|
+
<!-- docs:begin source-checkout -->
|
|
52
|
+
<!-- Generated from runtime/provenance.json, runtime/build.sh, and package.json. Run `pnpm --filter @pumpkin-plugins/build readme`. -->
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
git clone https://github.com/andreiltd/componentize-qjs.git /tmp/componentize-qjs
|
|
56
|
+
git -C /tmp/componentize-qjs checkout --detach e563c6d6ae50b087980414015663ca9c948c09bb
|
|
57
|
+
```
|
|
58
|
+
<!-- docs:end source-checkout -->
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
QJS_SOURCE_DIR=/tmp/componentize-qjs \
|
|
62
|
+
WASI_SDK_PATH=/path/to/wasi-sdk \
|
|
63
|
+
CARGO_TARGET_DIR=/tmp/componentize-qjs-target \
|
|
64
|
+
RUNTIME_OUTPUT_DIR=/tmp/componentize-qjs-candidate \
|
|
65
|
+
./tools/build/runtime/build.sh
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The script accepts a clean pinned checkout or exactly the declared patch, rejects
|
|
69
|
+
other tracked, untracked and ignored inputs, checks the dependency lock and tool
|
|
70
|
+
versions, and builds with `cargo --locked`. It emits a candidate runtime and a
|
|
71
|
+
`provenance.json` manifest in `RUNTIME_OUTPUT_DIR` (default:
|
|
72
|
+
`$CARGO_TARGET_DIR/runtime-artifact`). It does not replace the vendored runtime.
|
|
73
|
+
A failure before publication leaves a previous candidate untouched. Each candidate
|
|
74
|
+
manifest records the artifact hash, operating system and architecture, and OS release.
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
node tools/build/runtime/provenance.mjs verify-candidate /tmp/componentize-qjs-candidate
|
|
78
|
+
node tools/build/runtime/provenance.mjs verify tools/build/runtime
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The build script checks source and build inputs against the checked-in manifest
|
|
82
|
+
before building. `verify-candidate` checks the candidate manifest against the
|
|
83
|
+
pinned values and the artifact against its recorded hash. `verify` checks the
|
|
84
|
+
shipped artifact against the pinned hash. Neither command independently rebuilds
|
|
85
|
+
source.
|
|
86
|
+
|
|
87
|
+
CI compares two isolated builds on the same runner and loads the candidate in
|
|
88
|
+
real Pumpkin integration tests before permitting a code release. This checks
|
|
89
|
+
same-runner repeatability and runtime behavior; it does not guarantee matching
|
|
90
|
+
bytes across build environments.
|
|
91
|
+
|
|
92
|
+
Future runtime updates must review the source patch/license, refresh the manifest
|
|
93
|
+
and repeat clean builds plus bundle and real-server checks. Replacing the shipped
|
|
94
|
+
binary is a separate reviewed step.
|
package/runtime/build.sh
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
runtime_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
5
|
+
|
|
6
|
+
: "${QJS_SOURCE_DIR:?Set QJS_SOURCE_DIR to the pinned componentize-qjs checkout}"
|
|
7
|
+
: "${WASI_SDK_PATH:?Set WASI_SDK_PATH to wasi-sdk 34}"
|
|
8
|
+
|
|
9
|
+
QJS_SOURCE_DIR=$(CDPATH= cd -- "$QJS_SOURCE_DIR" && pwd)
|
|
10
|
+
WASI_SDK_PATH=$(CDPATH= cd -- "$WASI_SDK_PATH" && pwd)
|
|
11
|
+
target_dir=${CARGO_TARGET_DIR:-${TMPDIR:-/tmp}/componentize-qjs-bigint-target}
|
|
12
|
+
mkdir -p "$target_dir"
|
|
13
|
+
CARGO_TARGET_DIR=$(CDPATH= cd -- "$target_dir" && pwd)
|
|
14
|
+
export QJS_SOURCE_DIR WASI_SDK_PATH
|
|
15
|
+
export CARGO_TARGET_DIR
|
|
16
|
+
|
|
17
|
+
node "$runtime_dir/provenance.mjs" inputs "$QJS_SOURCE_DIR" "$WASI_SDK_PATH"
|
|
18
|
+
|
|
19
|
+
patch="$runtime_dir/componentize-qjs-bigint.patch"
|
|
20
|
+
if ! git -C "$QJS_SOURCE_DIR" apply --reverse --check "$patch" >/dev/null 2>&1; then
|
|
21
|
+
git -C "$QJS_SOURCE_DIR" apply --check "$patch"
|
|
22
|
+
git -C "$QJS_SOURCE_DIR" apply "$patch"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
unset RUSTFLAGS CARGO_ENCODED_RUSTFLAGS RUSTC_WRAPPER RUSTC_WORKSPACE_WRAPPER
|
|
26
|
+
RUSTC=$(command -v rustc)
|
|
27
|
+
export RUSTC
|
|
28
|
+
|
|
29
|
+
export WASI_SDK="$WASI_SDK_PATH"
|
|
30
|
+
export CARGO_TARGET_WASM32_WASIP2_LINKER="$WASI_SDK_PATH/bin/wasm-ld"
|
|
31
|
+
CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS=$(node "$runtime_dir/provenance.mjs" value rustFlags)
|
|
32
|
+
export CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS
|
|
33
|
+
CFLAGS_wasm32_wasip2=$(node "$runtime_dir/provenance.mjs" value cFlags)
|
|
34
|
+
export CFLAGS_wasm32_wasip2
|
|
35
|
+
export CC_wasm32_wasip2="$WASI_SDK_PATH/bin/clang"
|
|
36
|
+
: "${RUST_MIN_STACK:=33554432}"
|
|
37
|
+
export RUST_MIN_STACK
|
|
38
|
+
|
|
39
|
+
if [ "$(uname -s)" = Darwin ]; then
|
|
40
|
+
export DYLD_FALLBACK_LIBRARY_PATH="$WASI_SDK_PATH/lib${DYLD_FALLBACK_LIBRARY_PATH:+:$DYLD_FALLBACK_LIBRARY_PATH}"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
cd "$QJS_SOURCE_DIR"
|
|
44
|
+
cargo build --locked \
|
|
45
|
+
--target "$(node "$runtime_dir/provenance.mjs" value target)" \
|
|
46
|
+
-p componentize-qjs-runtime \
|
|
47
|
+
--no-default-features \
|
|
48
|
+
--features "$(node "$runtime_dir/provenance.mjs" value features)" \
|
|
49
|
+
--release
|
|
50
|
+
|
|
51
|
+
output_dir=${RUNTIME_OUTPUT_DIR:-$CARGO_TARGET_DIR/runtime-artifact}
|
|
52
|
+
mkdir -p "$output_dir"
|
|
53
|
+
output_dir=$(CDPATH= cd -- "$output_dir" && pwd)
|
|
54
|
+
# Candidate output is separate from the vendored artifact; publication needs explicit review.
|
|
55
|
+
if [ "$output_dir" = "$runtime_dir" ]; then
|
|
56
|
+
printf 'RUNTIME_OUTPUT_DIR must not replace the vendored runtime\n' >&2
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
candidate_dir=$(mktemp -d "$output_dir/.runtime-candidate.XXXXXX")
|
|
60
|
+
trap 'rm -rf "$candidate_dir"' EXIT HUP INT TERM
|
|
61
|
+
cp "$CARGO_TARGET_DIR/wasm32-wasip2/release/componentize_qjs_runtime.wasm" \
|
|
62
|
+
"$candidate_dir/quickjs-runtime-bigint.wasm"
|
|
63
|
+
chmod 644 "$candidate_dir/quickjs-runtime-bigint.wasm"
|
|
64
|
+
node "$runtime_dir/provenance.mjs" record "$QJS_SOURCE_DIR" "$WASI_SDK_PATH" "$candidate_dir"
|
|
65
|
+
node "$runtime_dir/provenance.mjs" verify-candidate "$candidate_dir"
|
|
66
|
+
mv -f "$candidate_dir/quickjs-runtime-bigint.wasm" "$output_dir/quickjs-runtime-bigint.wasm"
|
|
67
|
+
mv -f "$candidate_dir/provenance.json" "$output_dir/provenance.json"
|
|
68
|
+
printf 'Verified runtime candidate: %s\n' "$output_dir"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
diff --git a/crates/runtime/src/call.rs b/crates/runtime/src/call.rs
|
|
2
|
+
index efa8551..ff9f6aa 100644
|
|
3
|
+
--- a/crates/runtime/src/call.rs
|
|
4
|
+
+++ b/crates/runtime/src/call.rs
|
|
5
|
+
@@ -13,7 +13,7 @@ use crate::{QjsCallContext, with_ctx};
|
|
6
|
+
|
|
7
|
+
use rquickjs::class::Class;
|
|
8
|
+
use rquickjs::function::This;
|
|
9
|
+
-use rquickjs::{CatchResultExt, Coerced, Constructor, Function, IntoJs, Persistent, Symbol, Value};
|
|
10
|
+
+use rquickjs::{BigInt, CatchResultExt, Coerced, Constructor, Function, IntoJs, Persistent, Symbol, Value};
|
|
11
|
+
use smallvec::SmallVec;
|
|
12
|
+
use wit_dylib_ffi::{
|
|
13
|
+
Call, Enum, Flags, Future, List, Map, Record, Resource, Stream, Tuple, Type, Variant,
|
|
14
|
+
@@ -85,11 +85,27 @@ impl Call for QjsCallContext {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fn pop_u64(&mut self) -> u64 {
|
|
18
|
+
- pop_with(self, |v| v.get().expect("expected number"))
|
|
19
|
+
+ pop_with(self, |v| {
|
|
20
|
+
+ assert!(v.is_big_int(), "expected bigint");
|
|
21
|
+
+ let mut result = 0;
|
|
22
|
+
+ let status = unsafe {
|
|
23
|
+
+ rquickjs::qjs::JS_ToBigUint64(v.ctx().as_raw().as_ptr(), &mut result, v.as_raw())
|
|
24
|
+
+ };
|
|
25
|
+
+ assert_eq!(status, 0, "failed to read bigint as u64");
|
|
26
|
+
+ result
|
|
27
|
+
+ })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fn pop_s64(&mut self) -> i64 {
|
|
31
|
+
- pop_with(self, |v| v.get().expect("expected number"))
|
|
32
|
+
+ pop_with(self, |v| {
|
|
33
|
+
+ assert!(v.is_big_int(), "expected bigint");
|
|
34
|
+
+ let mut result = 0;
|
|
35
|
+
+ let status = unsafe {
|
|
36
|
+
+ rquickjs::qjs::JS_ToBigInt64(v.ctx().as_raw().as_ptr(), &mut result, v.as_raw())
|
|
37
|
+
+ };
|
|
38
|
+
+ assert_eq!(status, 0, "failed to read bigint as s64");
|
|
39
|
+
+ result
|
|
40
|
+
+ })
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fn pop_f32(&mut self) -> f32 {
|
|
44
|
+
@@ -474,11 +490,11 @@ impl Call for QjsCallContext {
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
fn push_u64(&mut self, val: u64) {
|
|
48
|
+
- push_with(self, |ctx| val.into_js(ctx).unwrap());
|
|
49
|
+
+ push_with(self, |ctx| BigInt::from_u64(ctx.clone(), val).unwrap().into_value());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fn push_s64(&mut self, val: i64) {
|
|
53
|
+
- push_with(self, |ctx| val.into_js(ctx).unwrap());
|
|
54
|
+
+ push_with(self, |ctx| BigInt::from_i64(ctx.clone(), val).unwrap().into_value());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fn push_f32(&mut self, val: f32) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"sourceRepository": "https://github.com/andreiltd/componentize-qjs.git",
|
|
4
|
+
"sourceCommit": "e563c6d6ae50b087980414015663ca9c948c09bb",
|
|
5
|
+
"patchSha256": "515a06e47c3c8eb819fb1ec464560cb66dfb9fe25c51ff560534da8de99b4a43",
|
|
6
|
+
"cargoLockSha256": "03e153b621bf6b830064d6b0931ebe98e28aa93bc833913397fb48720843d656",
|
|
7
|
+
"rustVersion": "rustc 1.99.0 (b940084d7 2026-09-28)",
|
|
8
|
+
"cargoVersion": "cargo 1.99.0 (5f94df478 2026-08-27)",
|
|
9
|
+
"sdkVersion": "34.0\nwasi-libc: 2e6fb9d8ee0c\nllvm: 895aa2c896ad\nllvm-version: 23.1.0\nconfig: f992bcc08219",
|
|
10
|
+
"clangVersion": "clang version 23.1.0-wasi-sdk (https://github.com/llvm/llvm-project 895aa2c896ada719451be2e3673c83da8ddf1141)",
|
|
11
|
+
"target": "wasm32-wasip2",
|
|
12
|
+
"features": "component-model-async",
|
|
13
|
+
"rustFlags": "-Clink-arg=--shared -Clink-arg=--no-entry -Clink-arg=--allow-undefined -Clto=fat -Copt-level=z",
|
|
14
|
+
"cFlags": "-fPIC -Oz",
|
|
15
|
+
"outputSha256": "75219b89307011c7cd2bd6212e18a7d0ff1ba16d560c130d5173ccacb1880988"
|
|
16
|
+
}
|