@di-framework/pglite-component 0.0.0-stage → 6.0.9

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 CHANGED
@@ -1,3 +1,145 @@
1
- # Temporary Holding Version
1
+ # di-framework:pglite — embedded PostgreSQL over WIT
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The provider bundles the PGlite PostgreSQL 17.5 engine into a WebAssembly
4
+ component. SQL calls cross WIT and WebAssembly memory. There is no TCP listener,
5
+ network client, native sidecar, or separate database service.
6
+
7
+ ```text
8
+ app.wasm → di-framework:pglite/database → bundled PostgreSQL engine
9
+ ↓
10
+ WASI filesystem
11
+ ↓
12
+ persistent /data mount
13
+ ```
14
+
15
+ `open("/data/orders", none)` opens a persistent database root. An empty path
16
+ selects `/data/pglite`. Missing or read-only storage fails; the provider never
17
+ silently substitutes an in-memory database. This replaces the old TCP client:
18
+ `PGHOST`, `PGPORT`, and connection-target strings are no longer used.
19
+
20
+ ## Build and verify
21
+
22
+ ```sh
23
+ make tools
24
+ make build
25
+ make smoke
26
+ bun test
27
+ ```
28
+
29
+ Use the pinned Rust toolchain through rustup, Python 3, and the installed
30
+ `wasm-tools`/`wac`. Preparing the engine from source also needs a Linux Docker
31
+ or Podman daemon, Git, curl, and several GB of build storage. The engine build
32
+ is cached under `target/engine`. Containers are build tools only; deployment
33
+ runs the resulting `.wasm` directly. For a remote Podman daemon, set the task's
34
+ `DOCKER_CONTEXT=podman`.
35
+
36
+ The build embeds the support filesystem, adapts the engine's WASI Preview 1
37
+ imports to Preview 2, and composes the engine with the Rust database provider.
38
+ It fails if the final artifact imports sockets or leaves the engine unresolved.
39
+ Ship `dist/di-framework-pglite.wasm` together with `THIRD-PARTY-NOTICES.txt`.
40
+ Build provenance and checksums are in `dist/BUILD-INFO.txt` and `SHA256SUMS`.
41
+
42
+ `make smoke` composes a real WIT consumer, runs it without network access, and
43
+ checks typed parameters/results, SQL errors and recovery, transactions,
44
+ rollback on close/drop, exclusive connection ownership, durability settings,
45
+ and persistence across separate runtime processes. It also exits a runtime
46
+ with an open transaction and verifies that committed rows survive and the
47
+ uncommitted row is absent after restart. No scripted database server is used.
48
+
49
+ ## Use from an application
50
+
51
+ The application imports `di-framework:pglite/database@0.1.0`. For a JavaScript
52
+ component built with the framework's component toolchain:
53
+
54
+ ```ts
55
+ import { open } from 'di-framework:pglite/database@0.1.0';
56
+
57
+ const db = open('/data/orders', undefined);
58
+ try {
59
+ db.exec('CREATE TABLE IF NOT EXISTS orders (id bigint PRIMARY KEY, title text)');
60
+ db.run('INSERT INTO orders VALUES ($1, $2)', [
61
+ { tag: 'integer', val: 1n },
62
+ { tag: 'text', val: 'First order' },
63
+ ]);
64
+ const row = db.first('SELECT title FROM orders WHERE id = $1', [
65
+ { tag: 'integer', val: 1n },
66
+ ]);
67
+ } finally {
68
+ db.close();
69
+ }
70
+ ```
71
+
72
+ Compose the application with the provider:
73
+
74
+ ```sh
75
+ make compose APP=path/to/app.wasm OUT=path/to/app.composed.wasm
76
+ mkdir -p ./data
77
+ wasmtime run --dir ./data::/data path/to/app.composed.wasm
78
+ ```
79
+
80
+ That invocation is for a command component; serve HTTP components using your
81
+ normal host while granting the same filesystem preopen. The final component
82
+ requires WASI filesystem, clocks, streams, CLI and randomness interfaces, plus
83
+ standardized WebAssembly exception handling for PostgreSQL error recovery.
84
+
85
+ The public interface retains `exec`, `run`, `query`, `first`, transactions,
86
+ savepoints, `rows-affected`, `close`, and `server-version`. PostgreSQL parameters
87
+ use `$1`, `$2`, etc. `server-version()` reports the bundled engine without
88
+ opening a database. Only the `template1` database is currently supported;
89
+ other `open-options.database` values are rejected. Requests must fit the engine's
90
+ input buffer; each serialized result is limited to 64 MiB and stays in memory.
91
+ Larger results return a PostgreSQL program-limit error. Signal-based statement
92
+ timeouts are unavailable in this WASI engine: nonzero `statement-timeout-ms`
93
+ options fail explicitly. Use host execution limits for runaway queries.
94
+
95
+ ## Persistence and ownership
96
+
97
+ For an `open("/data/orders", ...)` call:
98
+
99
+ - `/data/orders/data/` is PGDATA (catalogs, tables, WAL and configuration).
100
+ - `/data/orders/runtime/` contains bundled initialization/support files.
101
+ - Bootstrap and shared-memory scratch files also stay beneath `/data/orders`.
102
+
103
+ Mount the entire root on persistent storage and reuse it after restarts.
104
+ Initialization creates the cluster once; later starts reuse it. Incomplete
105
+ clusters or an incompatible PostgreSQL major version are rejected.
106
+ `fsync`, `synchronous_commit`, and `full_page_writes` are enabled before the
107
+ backend starts. The host filesystem must honor WASI sync operations; a local
108
+ restart test is not a power-loss durability certification.
109
+
110
+ **Give each database directory one component owner at a time.** The provider
111
+ rejects a second simultaneous connection within its component instance. Close
112
+ or drop rolls back uncommitted work, resets session settings, and allows the
113
+ same root to be reopened. A component instance stays bound to its first root;
114
+ use another instance for a different database.
115
+
116
+ There is no cross-instance filesystem lock in this WASI implementation. The
117
+ host must serialize access to each directory, including request instances and
118
+ rolling replacements. A single replica alone does not prevent concurrent
119
+ request instances from sharing files. Do not mount one root into overlapping
120
+ instances or replicas. Fatal engine traps require a new component instance.
121
+
122
+ For the framework's platform-managed storage, annotate the WorkloadDeployment:
123
+
124
+ ```yaml
125
+ metadata:
126
+ annotations:
127
+ di-framework.dev/persistent-storage: "true"
128
+ di-framework.dev/storage-mount: /data
129
+ ```
130
+
131
+ The platform controller mounts the workload's persistent directory and grants
132
+ its components the matching WASI preopen. Use a stable workload identity on
133
+ redeploy and configure exclusive execution for this database. These
134
+ annotations provide storage; they do not enforce database ownership.
135
+
136
+ ## Implementation
137
+
138
+ - `src/lib.rs`: public WIT resources and connection lifecycle.
139
+ - `src/pgwire.rs`: PostgreSQL message encoding and typed rows, over memory.
140
+ - `src/engine.rs`: persistent filesystem setup and exclusive engine access.
141
+ - `engine/bridge.wat`: private canonical ABI bridge to the core engine.
142
+ - `scripts/prepare-engine.ts`: pinned engine preparation and componentization (all build scripts are Bun TypeScript; see `scripts/`).
143
+ - `wit/deps/pglite-engine/engine.wit`: internal interface, composed away at build.
144
+
145
+ Engine provenance and modifications are described in `engine/NOTICE`.
@@ -0,0 +1,13 @@
1
+ component: di-framework:pglite@0.1.0
2
+ profile: release
3
+ built: 2026-10-11T16:07:09Z
4
+ rustc: rustc 1.97.1 (8bab26f4f 2026-07-14)
5
+ target: wasm32-wasip2
6
+ wasm-tools: wasm-tools 1.258.0 (5c6d31c78 2026-08-24)
7
+ wit-bindgen: 0.61.1
8
+ md5: 0.7.0
9
+ engine: PostgreSQL 17.5, persistent WASI filesystem
10
+ engine-source: https://github.com/moznion/wasipg/tree/fa290be67946c0d3c4540bd1400b11e193d874e1
11
+ adapter-sha256: e51dd61669a20daca34befe7fdadf1ac84e4795a2c84a8400818ee1de5373ccc
12
+ engine-sha256: 42d46914c081e0e14db55e077aa5a358c40a9d2ac63025571ff47895efc0f0d4
13
+ size: 17991975 bytes
@@ -0,0 +1,3 @@
1
+ 19b23dbd0286a68488437880c91583bc174bc9545ad7107a215d179f50914313 di-framework-pglite.wasm
2
+ 36b6039274ecf82f8820008be93eae19a06b8535b33dddf5ab335be7afe88dba di-framework-pglite.wit
3
+ 0b8bbbe8aa2898431d20371148a445c9b1ecdecb2ca81d3c98d43256f650590e THIRD-PARTY-NOTICES.txt
@@ -0,0 +1,345 @@
1
+ di-framework embedded PGlite component
2
+
3
+ The provider bundles PostgreSQL 17.5 (PGlite WASI), originally maintained by
4
+ ElectricSQL. PostgreSQL's license is reproduced in POSTGRESQL-COPYRIGHT.
5
+ The upstream bindings license and WASI adapter license are reproduced in
6
+ PGLITE-BINDINGS-LICENSE and WASMTIME-LICENSE.
7
+
8
+ Sources:
9
+ https://github.com/electric-sql/postgres-pglite
10
+ https://github.com/electric-sql/pglite-bindings
11
+ https://github.com/moznion/wasipg
12
+ https://github.com/bytecodealliance/wasmtime/tree/v29.0.1
13
+
14
+ The engine is compiled with PostgreSQL setjmp/longjmp recovery lowered to
15
+ standardized WebAssembly exceptions. di-framework adds a private canonical
16
+ ABI bridge, uses WASI randomness instead of a /dev/urandom preopen, and keeps
17
+ bootstrap files within the database's persistent filesystem mount. A growable,
18
+ bounded memory buffer replaces socket-file spillover for query replies. Backend
19
+ startup restores application session defaults after bootstrap and enables
20
+ durable writes.
21
+
22
+ The engine's core module, support files, adapter, and the provider are
23
+ composed into one deployable artifact. Engine code executes in the Wasm
24
+ runtime; no native database process or socket transport is used.
25
+
26
+ wasipg
27
+ Copyright 2026 Taiki Kawakami (a.k.a moznion) https://moznion.net
28
+
29
+ This product includes software developed as part of the wasipg project,
30
+ licensed under the Apache License, Version 2.0 (see LICENSE).
31
+
32
+ The Apache-2.0 grant covers the Go library, the build recipes, and the
33
+ tests in this repository. It does NOT cover the third-party software
34
+ listed below, which is redistributed — in source-patch form here, and in
35
+ binary form in the released bundle artifacts — under its own license.
36
+
37
+ --------------------------------------------------------------------------
38
+ PostgreSQL
39
+ --------------------------------------------------------------------------
40
+
41
+ The released artifacts (pglite.wasi, pglite-wasi.tar.xz,
42
+ pgdata-pristine.tar.xz) are builds of PostgreSQL 17.5, taken from the
43
+ electric-sql/postgres-pglite fork (branch REL_17_5_WASM-pglite; the exact
44
+ commit is pinned in build/versions.env). PostgreSQL and that fork are
45
+ distributed under the PostgreSQL License, reproduced in the COPYRIGHT
46
+ file shipped alongside the artifacts and inside pglite-wasi.tar.xz:
47
+
48
+ Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
49
+ Portions Copyright (c) 1994, The Regents of the University of California
50
+
51
+ The patches under build/patches/ are modifications of that source tree
52
+ and are likewise governed by the PostgreSQL License; see
53
+ build/patches/README.md.
54
+
55
+ --------------------------------------------------------------------------
56
+ zlib
57
+ --------------------------------------------------------------------------
58
+
59
+ The PostgreSQL module statically links zlib 1.2.13, distributed under the
60
+ zlib License:
61
+
62
+ Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
63
+
64
+ --------------------------------------------------------------------------
65
+ Go module dependencies
66
+ --------------------------------------------------------------------------
67
+
68
+ The Go library depends on modules fetched at build time by consumers
69
+ (github.com/jackc/pgx/v5 — MIT; github.com/tetratelabs/wazero —
70
+ Apache-2.0; github.com/ulikunitz/xz — BSD-3-Clause). They are not
71
+ redistributed in this repository or in the bundle artifacts; their
72
+ licenses accompany the modules themselves.
73
+
74
+ --------------------------------------------------------------------------
75
+ wasi-libc / wasi-sdk
76
+ --------------------------------------------------------------------------
77
+
78
+ The PostgreSQL module and gate/testdata/sjlj.wasm statically link
79
+ wasi-libc from wasi-sdk 33, distributed under
80
+ "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT". The shadow headers
81
+ under build/hotfix/ are derived from wasi-libc headers.
82
+ PostgreSQL Database Management System
83
+ (formerly known as Postgres, then as Postgres95)
84
+
85
+ Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
86
+
87
+ Portions Copyright (c) 1994, The Regents of the University of California
88
+
89
+ Permission to use, copy, modify, and distribute this software and its
90
+ documentation for any purpose, without fee, and without a written agreement
91
+ is hereby granted, provided that the above copyright notice and this
92
+ paragraph and the following two paragraphs appear in all copies.
93
+
94
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
95
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
96
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
97
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
98
+ POSSIBILITY OF SUCH DAMAGE.
99
+
100
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
101
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
102
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
103
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
104
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
105
+ MIT License
106
+
107
+ Copyright (c) 2024 ElectricSQL
108
+
109
+ Permission is hereby granted, free of charge, to any person obtaining a copy
110
+ of this software and associated documentation files (the "Software"), to deal
111
+ in the Software without restriction, including without limitation the rights
112
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
113
+ copies of the Software, and to permit persons to whom the Software is
114
+ furnished to do so, subject to the following conditions:
115
+
116
+ The above copyright notice and this permission notice shall be included in all
117
+ copies or substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
120
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
121
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
122
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
123
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
124
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
125
+ SOFTWARE.
126
+
127
+ Apache License
128
+ Version 2.0, January 2004
129
+ http://www.apache.org/licenses/
130
+
131
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
132
+
133
+ 1. Definitions.
134
+
135
+ "License" shall mean the terms and conditions for use, reproduction,
136
+ and distribution as defined by Sections 1 through 9 of this document.
137
+
138
+ "Licensor" shall mean the copyright owner or entity authorized by
139
+ the copyright owner that is granting the License.
140
+
141
+ "Legal Entity" shall mean the union of the acting entity and all
142
+ other entities that control, are controlled by, or are under common
143
+ control with that entity. For the purposes of this definition,
144
+ "control" means (i) the power, direct or indirect, to cause the
145
+ direction or management of such entity, whether by contract or
146
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
147
+ outstanding shares, or (iii) beneficial ownership of such entity.
148
+
149
+ "You" (or "Your") shall mean an individual or Legal Entity
150
+ exercising permissions granted by this License.
151
+
152
+ "Source" form shall mean the preferred form for making modifications,
153
+ including but not limited to software source code, documentation
154
+ source, and configuration files.
155
+
156
+ "Object" form shall mean any form resulting from mechanical
157
+ transformation or translation of a Source form, including but
158
+ not limited to compiled object code, generated documentation,
159
+ and conversions to other media types.
160
+
161
+ "Work" shall mean the work of authorship, whether in Source or
162
+ Object form, made available under the License, as indicated by a
163
+ copyright notice that is included in or attached to the work
164
+ (an example is provided in the Appendix below).
165
+
166
+ "Derivative Works" shall mean any work, whether in Source or Object
167
+ form, that is based on (or derived from) the Work and for which the
168
+ editorial revisions, annotations, elaborations, or other modifications
169
+ represent, as a whole, an original work of authorship. For the purposes
170
+ of this License, Derivative Works shall not include works that remain
171
+ separable from, or merely link (or bind by name) to the interfaces of,
172
+ the Work and Derivative Works thereof.
173
+
174
+ "Contribution" shall mean any work of authorship, including
175
+ the original version of the Work and any modifications or additions
176
+ to that Work or Derivative Works thereof, that is intentionally
177
+ submitted to Licensor for inclusion in the Work by the copyright owner
178
+ or by an individual or Legal Entity authorized to submit on behalf of
179
+ the copyright owner. For the purposes of this definition, "submitted"
180
+ means any form of electronic, verbal, or written communication sent
181
+ to the Licensor or its representatives, including but not limited to
182
+ communication on electronic mailing lists, source code control systems,
183
+ and issue tracking systems that are managed by, or on behalf of, the
184
+ Licensor for the purpose of discussing and improving the Work, but
185
+ excluding communication that is conspicuously marked or otherwise
186
+ designated in writing by the copyright owner as "Not a Contribution."
187
+
188
+ "Contributor" shall mean Licensor and any individual or Legal Entity
189
+ on behalf of whom a Contribution has been received by Licensor and
190
+ subsequently incorporated within the Work.
191
+
192
+ 2. Grant of Copyright License. Subject to the terms and conditions of
193
+ this License, each Contributor hereby grants to You a perpetual,
194
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
195
+ copyright license to reproduce, prepare Derivative Works of,
196
+ publicly display, publicly perform, sublicense, and distribute the
197
+ Work and such Derivative Works in Source or Object form.
198
+
199
+ 3. Grant of Patent License. Subject to the terms and conditions of
200
+ this License, each Contributor hereby grants to You a perpetual,
201
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
202
+ (except as stated in this section) patent license to make, have made,
203
+ use, offer to sell, sell, import, and otherwise transfer the Work,
204
+ where such license applies only to those patent claims licensable
205
+ by such Contributor that are necessarily infringed by their
206
+ Contribution(s) alone or by combination of their Contribution(s)
207
+ with the Work to which such Contribution(s) was submitted. If You
208
+ institute patent litigation against any entity (including a
209
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
210
+ or a Contribution incorporated within the Work constitutes direct
211
+ or contributory patent infringement, then any patent licenses
212
+ granted to You under this License for that Work shall terminate
213
+ as of the date such litigation is filed.
214
+
215
+ 4. Redistribution. You may reproduce and distribute copies of the
216
+ Work or Derivative Works thereof in any medium, with or without
217
+ modifications, and in Source or Object form, provided that You
218
+ meet the following conditions:
219
+
220
+ (a) You must give any other recipients of the Work or
221
+ Derivative Works a copy of this License; and
222
+
223
+ (b) You must cause any modified files to carry prominent notices
224
+ stating that You changed the files; and
225
+
226
+ (c) You must retain, in the Source form of any Derivative Works
227
+ that You distribute, all copyright, patent, trademark, and
228
+ attribution notices from the Source form of the Work,
229
+ excluding those notices that do not pertain to any part of
230
+ the Derivative Works; and
231
+
232
+ (d) If the Work includes a "NOTICE" text file as part of its
233
+ distribution, then any Derivative Works that You distribute must
234
+ include a readable copy of the attribution notices contained
235
+ within such NOTICE file, excluding those notices that do not
236
+ pertain to any part of the Derivative Works, in at least one
237
+ of the following places: within a NOTICE text file distributed
238
+ as part of the Derivative Works; within the Source form or
239
+ documentation, if provided along with the Derivative Works; or,
240
+ within a display generated by the Derivative Works, if and
241
+ wherever such third-party notices normally appear. The contents
242
+ of the NOTICE file are for informational purposes only and
243
+ do not modify the License. You may add Your own attribution
244
+ notices within Derivative Works that You distribute, alongside
245
+ or as an addendum to the NOTICE text from the Work, provided
246
+ that such additional attribution notices cannot be construed
247
+ as modifying the License.
248
+
249
+ You may add Your own copyright statement to Your modifications and
250
+ may provide additional or different license terms and conditions
251
+ for use, reproduction, or distribution of Your modifications, or
252
+ for any such Derivative Works as a whole, provided Your use,
253
+ reproduction, and distribution of the Work otherwise complies with
254
+ the conditions stated in this License.
255
+
256
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
257
+ any Contribution intentionally submitted for inclusion in the Work
258
+ by You to the Licensor shall be under the terms and conditions of
259
+ this License, without any additional terms or conditions.
260
+ Notwithstanding the above, nothing herein shall supersede or modify
261
+ the terms of any separate license agreement you may have executed
262
+ with Licensor regarding such Contributions.
263
+
264
+ 6. Trademarks. This License does not grant permission to use the trade
265
+ names, trademarks, service marks, or product names of the Licensor,
266
+ except as required for reasonable and customary use in describing the
267
+ origin of the Work and reproducing the content of the NOTICE file.
268
+
269
+ 7. Disclaimer of Warranty. Unless required by applicable law or
270
+ agreed to in writing, Licensor provides the Work (and each
271
+ Contributor provides its Contributions) on an "AS IS" BASIS,
272
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
273
+ implied, including, without limitation, any warranties or conditions
274
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
275
+ PARTICULAR PURPOSE. You are solely responsible for determining the
276
+ appropriateness of using or redistributing the Work and assume any
277
+ risks associated with Your exercise of permissions under this License.
278
+
279
+ 8. Limitation of Liability. In no event and under no legal theory,
280
+ whether in tort (including negligence), contract, or otherwise,
281
+ unless required by applicable law (such as deliberate and grossly
282
+ negligent acts) or agreed to in writing, shall any Contributor be
283
+ liable to You for damages, including any direct, indirect, special,
284
+ incidental, or consequential damages of any character arising as a
285
+ result of this License or out of the use or inability to use the
286
+ Work (including but not limited to damages for loss of goodwill,
287
+ work stoppage, computer failure or malfunction, or any and all
288
+ other commercial damages or losses), even if such Contributor
289
+ has been advised of the possibility of such damages.
290
+
291
+ 9. Accepting Warranty or Additional Liability. While redistributing
292
+ the Work or Derivative Works thereof, You may choose to offer,
293
+ and charge a fee for, acceptance of support, warranty, indemnity,
294
+ or other liability obligations and/or rights consistent with this
295
+ License. However, in accepting such obligations, You may act only
296
+ on Your own behalf and on Your sole responsibility, not on behalf
297
+ of any other Contributor, and only if You agree to indemnify,
298
+ defend, and hold each Contributor harmless for any liability
299
+ incurred by, or claims asserted against, such Contributor by reason
300
+ of your accepting any such warranty or additional liability.
301
+
302
+ END OF TERMS AND CONDITIONS
303
+
304
+ APPENDIX: How to apply the Apache License to your work.
305
+
306
+ To apply the Apache License to your work, attach the following
307
+ boilerplate notice, with the fields enclosed by brackets "[]"
308
+ replaced with your own identifying information. (Don't include
309
+ the brackets!) The text should be enclosed in the appropriate
310
+ comment syntax for the file format. We also recommend that a
311
+ file or class name and description of purpose be included on the
312
+ same "printed page" as the copyright notice for easier
313
+ identification within third-party archives.
314
+
315
+ Copyright [yyyy] [name of copyright owner]
316
+
317
+ Licensed under the Apache License, Version 2.0 (the "License");
318
+ you may not use this file except in compliance with the License.
319
+ You may obtain a copy of the License at
320
+
321
+ http://www.apache.org/licenses/LICENSE-2.0
322
+
323
+ Unless required by applicable law or agreed to in writing, software
324
+ distributed under the License is distributed on an "AS IS" BASIS,
325
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
326
+ See the License for the specific language governing permissions and
327
+ limitations under the License.
328
+
329
+
330
+ --- LLVM Exceptions to the Apache 2.0 License ----
331
+
332
+ As an exception, if, as a result of your compiling your source code, portions
333
+ of this Software are embedded into an Object form of such source code, you
334
+ may redistribute such embedded portions in such Object form without complying
335
+ with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
336
+
337
+ In addition, if you combine or link compiled forms of this Software with
338
+ software that is licensed under the GPLv2 ("Combined Software") and if a
339
+ court of competent jurisdiction determines that the patent provision (Section
340
+ 3), the indemnity provision (Section 9) or other Section of the License
341
+ conflicts with the conditions of the GPLv2, you may retroactively and
342
+ prospectively choose to deem waived or otherwise exclude such Section(s) of
343
+ the License, but only in their entirety and only with respect to the Combined
344
+ Software.
345
+
Binary file