pgmem 0.1.0__py3-none-win_amd64.whl

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.
pgmem/__init__.py ADDED
@@ -0,0 +1,37 @@
1
+ """In-memory PostgreSQL for tests.
2
+
3
+ import pgmem
4
+
5
+ with pgmem.start(database="app") as pg:
6
+ run_migrations(pg.template.dsn)
7
+ snap = pg.template.snapshot()
8
+ with snap.fork() as fork:
9
+ conn = psycopg.connect(fork.dsn) # a private copy of the prepared database
10
+
11
+ With pytest installed the ``pgmem_dsn`` fixture does the fork/close per
12
+ test; override ``pgmem_snapshot`` to run migrations first.
13
+ """
14
+
15
+ from ._client import (
16
+ Fork,
17
+ Pgmem,
18
+ PgmemError,
19
+ ProtocolError,
20
+ Server,
21
+ ServerExited,
22
+ Snapshot,
23
+ start,
24
+ )
25
+ from ._binary import find_binary
26
+
27
+ __all__ = [
28
+ "Fork",
29
+ "Pgmem",
30
+ "PgmemError",
31
+ "ProtocolError",
32
+ "Server",
33
+ "ServerExited",
34
+ "Snapshot",
35
+ "find_binary",
36
+ "start",
37
+ ]
pgmem/_bin/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ pgmem
2
+ pgmem.exe
pgmem/_bin/pgmem.exe ADDED
Binary file
pgmem/_binary.py ADDED
@@ -0,0 +1,24 @@
1
+ import os
2
+ import shutil
3
+ import sys
4
+ from pathlib import Path
5
+
6
+
7
+ def find_binary(explicit=None):
8
+ """Locate the pgmem server binary.
9
+
10
+ Order: the ``explicit`` argument, the ``PGMEM_BINARY`` environment
11
+ variable, the binary bundled in this wheel, then ``pgmem`` on PATH.
12
+ """
13
+ name = "pgmem.exe" if sys.platform == "win32" else "pgmem"
14
+ candidates = [explicit, os.environ.get("PGMEM_BINARY"), str(Path(__file__).parent / "_bin" / name)]
15
+ for c in candidates:
16
+ if c and os.path.isfile(c):
17
+ return c
18
+ on_path = shutil.which("pgmem")
19
+ if on_path:
20
+ return on_path
21
+ raise FileNotFoundError(
22
+ "pgmem binary not found: this wheel has no bundled binary for your platform; "
23
+ "set PGMEM_BINARY to a build of github.com/shibukawa/pgmem/cmd/pgmem"
24
+ )
pgmem/_client.py ADDED
@@ -0,0 +1,276 @@
1
+ """Client for the pgmem control protocol (JSON lines over stdin/stdout)."""
2
+
3
+ import json
4
+ import os
5
+ import subprocess
6
+ import sys
7
+ import threading
8
+ from typing import Dict, List, Optional
9
+
10
+ from ._binary import find_binary
11
+
12
+ PROTOCOL = 1
13
+
14
+
15
+ class PgmemError(Exception):
16
+ """Base class for pgmem errors."""
17
+
18
+
19
+ class ProtocolError(PgmemError):
20
+ """The server answered a request with an error."""
21
+
22
+ def __init__(self, code, message):
23
+ super().__init__(f"{code}: {message}")
24
+ self.code = code
25
+ self.message = message
26
+
27
+
28
+ class ServerExited(PgmemError):
29
+ """The pgmem process ended while a request was pending."""
30
+
31
+
32
+ class _Waiter:
33
+ __slots__ = ("event", "response")
34
+
35
+ def __init__(self):
36
+ self.event = threading.Event()
37
+ self.response = None
38
+
39
+
40
+ class Pgmem:
41
+ """One pgmem process: the default template, extra templates, snapshots, forks.
42
+
43
+ Use :func:`start` to create it. Closing it (or the process exiting)
44
+ releases everything the process owns.
45
+ """
46
+
47
+ def __init__(self, proc: subprocess.Popen, ready: dict):
48
+ self._proc = proc
49
+ self._lock = threading.Lock() # guards stdin writes and the waiter table
50
+ self._seq = 0
51
+ self._waiters: Dict[int, _Waiter] = {}
52
+ self._exited = False
53
+ self._closed = False
54
+ self.pid = ready["pid"]
55
+ self.version = ready.get("version", "")
56
+ self.template = Server(self, ready["server"])
57
+ self._reader = threading.Thread(target=self._read_loop, name="pgmem-reader", daemon=True)
58
+ self._reader.start()
59
+
60
+ # -- lifecycle ---------------------------------------------------------
61
+
62
+ def start_server(self, database="postgres", user="postgres", params: Optional[List[str]] = None) -> "Server":
63
+ """Start another template server in the same process (op ``start``)."""
64
+ res = self._request("start", database=database, user=user, params=list(params or []))
65
+ return Server(self, res["server"])
66
+
67
+ def close(self):
68
+ """Shut the process down. Idempotent."""
69
+ if self._closed:
70
+ return
71
+ self._closed = True
72
+ try:
73
+ if not self._exited:
74
+ self._request("shutdown")
75
+ except PgmemError:
76
+ pass
77
+ finally:
78
+ try:
79
+ self._proc.stdin.close()
80
+ except OSError:
81
+ pass
82
+ try:
83
+ self._proc.wait(timeout=10)
84
+ except subprocess.TimeoutExpired:
85
+ self._proc.kill()
86
+ self._proc.wait()
87
+
88
+ def __enter__(self):
89
+ return self
90
+
91
+ def __exit__(self, *exc):
92
+ self.close()
93
+
94
+ # -- protocol ----------------------------------------------------------
95
+
96
+ def _request(self, op, **fields):
97
+ with self._lock:
98
+ if self._exited:
99
+ raise ServerExited("pgmem process has exited")
100
+ self._seq += 1
101
+ rid = self._seq
102
+ w = _Waiter()
103
+ self._waiters[rid] = w
104
+ line = json.dumps({"id": rid, "op": op, **fields}) + "\n"
105
+ try:
106
+ self._proc.stdin.write(line)
107
+ self._proc.stdin.flush()
108
+ except (OSError, ValueError) as e:
109
+ del self._waiters[rid]
110
+ raise ServerExited(f"cannot write to pgmem process: {e}") from e
111
+ w.event.wait()
112
+ res = w.response
113
+ if res is None:
114
+ raise ServerExited("pgmem process exited before answering")
115
+ if not res.get("ok"):
116
+ err = res.get("error") or {}
117
+ raise ProtocolError(err.get("code", "internal"), err.get("message", "unknown error"))
118
+ return res
119
+
120
+ def _read_loop(self):
121
+ out = self._proc.stdout
122
+ try:
123
+ for line in out:
124
+ line = line.strip()
125
+ if not line:
126
+ continue
127
+ try:
128
+ msg = json.loads(line)
129
+ except ValueError:
130
+ continue
131
+ if "event" in msg and msg.get("id") is None:
132
+ if msg["event"] == "fatal":
133
+ sys.stderr.write(f"pgmem: fatal: {msg.get('message')}\n")
134
+ continue
135
+ rid = msg.get("id")
136
+ with self._lock:
137
+ w = self._waiters.pop(rid, None)
138
+ if w is not None:
139
+ w.response = msg
140
+ w.event.set()
141
+ finally:
142
+ with self._lock:
143
+ self._exited = True
144
+ pending = list(self._waiters.values())
145
+ self._waiters.clear()
146
+ for w in pending:
147
+ w.event.set()
148
+
149
+
150
+ class Server:
151
+ """A listening PostgreSQL server inside the pgmem process."""
152
+
153
+ def __init__(self, pg: Pgmem, endpoint: dict):
154
+ self._pg = pg
155
+ self.id = endpoint["id"]
156
+ self.host = endpoint["host"]
157
+ self.port = endpoint["port"]
158
+ self.user = endpoint["user"]
159
+ self.database = endpoint["database"]
160
+ self.dsn = endpoint["dsn"]
161
+ self._closed = False
162
+
163
+ def snapshot(self, max_forks: Optional[int] = None, timeout: Optional[float] = 30.0) -> "Snapshot":
164
+ """Checkpoint and copy this server's state; forks start from the copy.
165
+
166
+ The snapshot waits for open transactions to end, so commit or close
167
+ every connection first. After ``timeout`` seconds (None = forever)
168
+ it fails with a ``ProtocolError`` whose code is ``busy``.
169
+ """
170
+ fields = {"server": self.id}
171
+ if max_forks:
172
+ fields["max_forks"] = max_forks
173
+ if timeout is not None:
174
+ fields["timeout_ms"] = int(timeout * 1000)
175
+ res = self._pg._request("snapshot", **fields)
176
+ return Snapshot(self._pg, res["snapshot"], self)
177
+
178
+ def close(self):
179
+ if self._closed:
180
+ return
181
+ self._closed = True
182
+ self._pg._request("close", server=self.id)
183
+
184
+ def __enter__(self):
185
+ return self
186
+
187
+ def __exit__(self, *exc):
188
+ self.close()
189
+
190
+ def __repr__(self):
191
+ return f"<pgmem.{type(self).__name__} {self.id} {self.dsn}>"
192
+
193
+
194
+ class Fork(Server):
195
+ """A server started from a snapshot; close it to free its pool slot."""
196
+
197
+
198
+ class Snapshot:
199
+ """A frozen copy of a server's state."""
200
+
201
+ def __init__(self, pg: Pgmem, sid: str, origin: Server):
202
+ self._pg = pg
203
+ self.id = sid
204
+ self.origin = origin
205
+ self._closed = False
206
+
207
+ def fork(self, timeout: Optional[float] = None) -> Fork:
208
+ """Start a fresh server on a copy of the snapshot.
209
+
210
+ Blocks while ``max_forks`` forks are alive; ``timeout`` (seconds)
211
+ turns that wait into a ``ProtocolError`` with code ``pool_timeout``.
212
+ """
213
+ fields = {"snapshot": self.id}
214
+ if timeout is not None:
215
+ fields["timeout_ms"] = int(timeout * 1000)
216
+ res = self._pg._request("fork", **fields)
217
+ return Fork(self._pg, res["server"])
218
+
219
+ def close(self):
220
+ if self._closed:
221
+ return
222
+ self._closed = True
223
+ self._pg._request("close", snapshot=self.id)
224
+
225
+ def __enter__(self):
226
+ return self
227
+
228
+ def __exit__(self, *exc):
229
+ self.close()
230
+
231
+
232
+ def start(database="postgres", user="postgres", params: Optional[List[str]] = None,
233
+ log=False, binary: Optional[str] = None, timeout: float = 30.0) -> Pgmem:
234
+ """Spawn a pgmem process and wait until its template server is ready.
235
+
236
+ ``params`` are ``postgres -c`` settings such as ``["log_statement=all"]``.
237
+ ``log`` passes the server log through to stderr. ``binary`` overrides
238
+ the binary lookup (see :func:`find_binary`).
239
+ """
240
+ args = [find_binary(binary), "-database", database, "-user", user]
241
+ if params:
242
+ args += ["-params", ",".join(params)]
243
+ if log:
244
+ args.append("-log")
245
+ proc = subprocess.Popen(
246
+ args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None,
247
+ text=True, encoding="utf-8", bufsize=1,
248
+ )
249
+ ready = _read_ready(proc, timeout)
250
+ return Pgmem(proc, ready)
251
+
252
+
253
+ def _read_ready(proc, timeout):
254
+ box = {}
255
+
256
+ def reader():
257
+ box["line"] = proc.stdout.readline()
258
+
259
+ t = threading.Thread(target=reader, daemon=True)
260
+ t.start()
261
+ t.join(timeout)
262
+ if t.is_alive():
263
+ proc.kill()
264
+ raise PgmemError(f"pgmem did not become ready within {timeout}s")
265
+ line = box.get("line") or ""
266
+ if not line:
267
+ code = proc.wait()
268
+ raise PgmemError(f"pgmem exited with status {code} before becoming ready")
269
+ ready = json.loads(line)
270
+ if ready.get("event") != "ready" or "server" not in ready:
271
+ proc.kill()
272
+ raise PgmemError(f"unexpected first line from pgmem: {line.strip()}")
273
+ if ready.get("protocol") != PROTOCOL:
274
+ proc.kill()
275
+ raise PgmemError(f"pgmem binary speaks protocol {ready.get('protocol')}, this package needs {PROTOCOL}")
276
+ return ready
pgmem/pytest_plugin.py ADDED
@@ -0,0 +1,64 @@
1
+ """pytest fixtures for pgmem.
2
+
3
+ Session scope: ``pgmem_process`` (the process), ``pgmem_server`` (its default
4
+ template) and ``pgmem_snapshot`` (a snapshot of the template). Override
5
+ ``pgmem_snapshot`` in your conftest to run migrations first::
6
+
7
+ @pytest.fixture(scope="session")
8
+ def pgmem_snapshot(pgmem_server):
9
+ run_migrations(pgmem_server.dsn)
10
+ return pgmem_server.snapshot()
11
+
12
+ Per test: ``pgmem_dsn`` gives the DSN of a fresh fork that is closed when
13
+ the test ends. ``pgmem_class_dsn`` shares one fork across a test class,
14
+ for read-only tests. ``pgmem_options`` (session) returns the keyword
15
+ arguments for :func:`pgmem.start`; override it to change database name,
16
+ server parameters or logging.
17
+ """
18
+
19
+ import pytest
20
+
21
+ import pgmem as _pgmem
22
+
23
+
24
+ @pytest.fixture(scope="session")
25
+ def pgmem_options():
26
+ return {}
27
+
28
+
29
+ @pytest.fixture(scope="session")
30
+ def pgmem_process(pgmem_options):
31
+ with _pgmem.start(**pgmem_options) as pg:
32
+ yield pg
33
+
34
+
35
+ @pytest.fixture(scope="session")
36
+ def pgmem_server(pgmem_process):
37
+ return pgmem_process.template
38
+
39
+
40
+ @pytest.fixture(scope="session")
41
+ def pgmem_snapshot(pgmem_server):
42
+ return pgmem_server.snapshot()
43
+
44
+
45
+ @pytest.fixture
46
+ def pgmem_fork(pgmem_snapshot):
47
+ with pgmem_snapshot.fork() as fork:
48
+ yield fork
49
+
50
+
51
+ @pytest.fixture
52
+ def pgmem_dsn(pgmem_fork):
53
+ return pgmem_fork.dsn
54
+
55
+
56
+ @pytest.fixture(scope="class")
57
+ def pgmem_class_fork(pgmem_snapshot):
58
+ with pgmem_snapshot.fork() as fork:
59
+ yield fork
60
+
61
+
62
+ @pytest.fixture(scope="class")
63
+ def pgmem_class_dsn(pgmem_class_fork):
64
+ return pgmem_class_fork.dsn
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.5
2
+ Name: pgmem
3
+ Version: 0.1.0
4
+ Summary: In-memory PostgreSQL for tests: prepare once, fork a fresh copy per test
5
+ Project-URL: Homepage, https://github.com/shibukawa/pgmem
6
+ Author: Yoshiki Shibukawa
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Keywords: fixture,postgresql,pytest,testing
11
+ Classifier: Framework :: Pytest
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Database
14
+ Classifier: Topic :: Software Development :: Testing
15
+ Requires-Python: >=3.9
16
+ Provides-Extra: pytest
17
+ Requires-Dist: pytest>=7; extra == 'pytest'
18
+ Description-Content-Type: text/markdown
19
+
20
+ # pgmem for Python
21
+
22
+ A real PostgreSQL 18 that runs entirely in memory, packaged as a single
23
+ binary and driven from Python. Prepare the schema once, then give every
24
+ test its own fork of that state in about 20 ms.
25
+
26
+ ```python
27
+ import pgmem, psycopg
28
+
29
+ with pgmem.start(database="app") as pg:
30
+ with psycopg.connect(pg.template.dsn) as conn:
31
+ conn.execute(open("schema.sql").read())
32
+ snap = pg.template.snapshot()
33
+ with snap.fork() as fork: # private copy of the prepared database
34
+ psycopg.connect(fork.dsn) ...
35
+ ```
36
+
37
+ ## pytest
38
+
39
+ The wheel registers a plugin. Override `pgmem_snapshot` to run migrations,
40
+ then use `pgmem_dsn` (or `pgmem_fork`) in tests:
41
+
42
+ ```python
43
+ # conftest.py
44
+ @pytest.fixture(scope="session")
45
+ def pgmem_snapshot(pgmem_server):
46
+ run_migrations(pgmem_server.dsn)
47
+ return pgmem_server.snapshot()
48
+
49
+ # test_orders.py
50
+ def test_orders(pgmem_dsn):
51
+ with psycopg.connect(pgmem_dsn) as conn: ...
52
+ ```
53
+
54
+ `pgmem_class_dsn` shares one fork across a test class for read-only tests.
55
+ `pgmem_options` returns the keyword arguments passed to `pgmem.start`.
56
+
57
+ Any driver works (psycopg, asyncpg, pg8000, SQLAlchemy): the wrapper only
58
+ hands out DSNs. The server is one PostgreSQL session per fork; pooled
59
+ connections are serialized at transaction boundaries.
60
+
61
+ ## Binary
62
+
63
+ Platform wheels bundle the `pgmem` binary. `PGMEM_BINARY` overrides the
64
+ lookup for platforms without a wheel or for local builds
65
+ (`go build ./cmd/pgmem`).
@@ -0,0 +1,12 @@
1
+ pgmem/__init__.py,sha256=PulCeWijnZSK9rbu7jJVGkkJD6IRx6s3XjGPVIdnzlU,766
2
+ pgmem/_binary.py,sha256=KerQ4V7IOxKpcXTvjAxrKfpmex6FlZ-II3gek43RADM,809
3
+ pgmem/_client.py,sha256=WzXkdi4159YJazCRN9Hp1wTCwmzi8ygOL3RDYpjRxCA,8915
4
+ pgmem/pytest_plugin.py,sha256=N8v-uPsnVkE6F3gORmYLbkvUMJGkTYPYvFmYdsMflVM,1582
5
+ pgmem/_bin/.gitignore,sha256=aZqEGM90PVNgkuLLRDCWdhdATcofqg7XR60JUmGubBE,16
6
+ pgmem/_bin/pgmem.exe,sha256=Rdc7YLUw3S6t3JminOeU0r6SkN7x1378NGfjqkut3H8,42300416
7
+ pgmem-0.1.0.dist-info/METADATA,sha256=kVUQY4-QqWLT8HEJ4RB4gYfcrb1a_S3vlAxUdhkF5do,2074
8
+ pgmem-0.1.0.dist-info/WHEEL,sha256=OA-gEgWbLnh0Tf6JrLOMFR4vOWY4QbBMSZuN6osy-Q0,94
9
+ pgmem-0.1.0.dist-info/entry_points.txt,sha256=CZEyMo4rbkkRzTIXwyV6MMcMWUX0F-iZ14DWWGZ98TY,39
10
+ pgmem-0.1.0.dist-info/licenses/LICENSE,sha256=-EG0igTVeHkIYfDKGDH47dLaukAH-bCdolHP1EePNDg,1074
11
+ pgmem-0.1.0.dist-info/licenses/NOTICE,sha256=adXePTJCcqM-rv3vwpxbflyArO5-s9wBFWrMYYU-ZyA,35033
12
+ pgmem-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,2 @@
1
+ [pytest11]
2
+ pgmem = pgmem.pytest_plugin
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yoshiki Shibukawa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,738 @@
1
+ pgmem
2
+ Copyright (c) 2026 Yoshiki Shibukawa
3
+ Licensed under the MIT License; see LICENSE.
4
+
5
+ The Go module and every pgmem binary contain third-party code. PostgreSQL
6
+ (from the PGlite fork) and pgvector were compiled to WebAssembly with
7
+ Emscripten, which links in its musl-based C library, and translated to Go
8
+ with wasm2go (internal/aot/pgaot). internal/assets and internal/pgdata hold
9
+ PostgreSQL's share files and a data directory made by its initdb. The
10
+ binaries also contain the Go standard library, golang.org/x/crypto,
11
+ golang.org/x/sys (Windows) and github.com/klauspost/compress. Their
12
+ copyright and license notices follow.
13
+
14
+ ================================================================================
15
+ PostgreSQL 18 (https://www.postgresql.org), as forked by PGlite
16
+ (https://github.com/electric-sql/postgres-pglite)
17
+ --------------------------------------------------------------------------------
18
+
19
+ PostgreSQL Database Management System
20
+ (also known as Postgres, formerly known as Postgres95)
21
+
22
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
23
+
24
+ Portions Copyright (c) 1994, The Regents of the University of California
25
+
26
+ Permission to use, copy, modify, and distribute this software and its
27
+ documentation for any purpose, without fee, and without a written agreement
28
+ is hereby granted, provided that the above copyright notice and this
29
+ paragraph and the following two paragraphs appear in all copies.
30
+
31
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
32
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
33
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
34
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
35
+ POSSIBILITY OF SUCH DAMAGE.
36
+
37
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
38
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
39
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
40
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
41
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
42
+
43
+ ================================================================================
44
+ pgvector 0.8.6 (https://github.com/pgvector/pgvector)
45
+ --------------------------------------------------------------------------------
46
+
47
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
48
+
49
+ Portions Copyright (c) 1994, The Regents of the University of California
50
+
51
+ Permission to use, copy, modify, and distribute this software and its
52
+ documentation for any purpose, without fee, and without a written agreement
53
+ is hereby granted, provided that the above copyright notice and this
54
+ paragraph and the following two paragraphs appear in all copies.
55
+
56
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
57
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
58
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
59
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
60
+ POSSIBILITY OF SUCH DAMAGE.
61
+
62
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
63
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
64
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
65
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
66
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
67
+
68
+ ================================================================================
69
+ Emscripten (https://emscripten.org)
70
+ --------------------------------------------------------------------------------
71
+
72
+ Emscripten is available under 2 licenses, the MIT license and the
73
+ University of Illinois/NCSA Open Source License.
74
+
75
+ Both are permissive open source licenses, with little if any
76
+ practical difference between them.
77
+
78
+ The reason for offering both is that (1) the MIT license is
79
+ well-known, while (2) the University of Illinois/NCSA Open Source
80
+ License allows Emscripten's code to be integrated upstream into
81
+ LLVM, which uses that license, should the opportunity arise.
82
+
83
+ The full text of both licenses follows.
84
+
85
+ ==============================================================================
86
+
87
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
88
+
89
+ Permission is hereby granted, free of charge, to any person obtaining a copy
90
+ of this software and associated documentation files (the "Software"), to deal
91
+ in the Software without restriction, including without limitation the rights
92
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
93
+ copies of the Software, and to permit persons to whom the Software is
94
+ furnished to do so, subject to the following conditions:
95
+
96
+ The above copyright notice and this permission notice shall be included in
97
+ all copies or substantial portions of the Software.
98
+
99
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
101
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
102
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
103
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
104
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
105
+ THE SOFTWARE.
106
+
107
+ ==============================================================================
108
+
109
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
110
+ All rights reserved.
111
+
112
+ Permission is hereby granted, free of charge, to any person obtaining a
113
+ copy of this software and associated documentation files (the
114
+ "Software"), to deal with the Software without restriction, including
115
+ without limitation the rights to use, copy, modify, merge, publish,
116
+ distribute, sublicense, and/or sell copies of the Software, and to
117
+ permit persons to whom the Software is furnished to do so, subject to
118
+ the following conditions:
119
+
120
+ Redistributions of source code must retain the above copyright
121
+ notice, this list of conditions and the following disclaimers.
122
+
123
+ Redistributions in binary form must reproduce the above
124
+ copyright notice, this list of conditions and the following disclaimers
125
+ in the documentation and/or other materials provided with the
126
+ distribution.
127
+
128
+ Neither the names of Mozilla,
129
+ nor the names of its contributors may be used to endorse
130
+ or promote products derived from this Software without specific prior
131
+ written permission.
132
+
133
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
134
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
135
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
136
+ IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
137
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
138
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
139
+ SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
140
+
141
+ ==============================================================================
142
+
143
+ This program uses portions of Node.js source code located in src/library_path.js,
144
+ in accordance with the terms of the MIT license. Node's license follows:
145
+
146
+ """
147
+ Copyright Joyent, Inc. and other Node contributors. All rights reserved.
148
+ Permission is hereby granted, free of charge, to any person obtaining a copy
149
+ of this software and associated documentation files (the "Software"), to
150
+ deal in the Software without restriction, including without limitation the
151
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
152
+ sell copies of the Software, and to permit persons to whom the Software is
153
+ furnished to do so, subject to the following conditions:
154
+
155
+ The above copyright notice and this permission notice shall be included in
156
+ all copies or substantial portions of the Software.
157
+
158
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
159
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
160
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
161
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
162
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
163
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
164
+ IN THE SOFTWARE.
165
+ """
166
+
167
+ The musl libc project is bundled in this repo, and it has the MIT license, see
168
+ system/lib/libc/musl/COPYRIGHT
169
+
170
+ The third_party/ subdirectory contains code with other licenses. None of it is
171
+ used by default, but certain options use it (e.g., the optional closure compiler
172
+ flag will run closure compiler from third_party/).
173
+
174
+
175
+ ================================================================================
176
+ musl libc, as bundled with Emscripten (https://musl.libc.org)
177
+ --------------------------------------------------------------------------------
178
+
179
+ musl as a whole is licensed under the following standard MIT license:
180
+
181
+ ----------------------------------------------------------------------
182
+ Copyright © 2005-2020 Rich Felker, et al.
183
+
184
+ Permission is hereby granted, free of charge, to any person obtaining
185
+ a copy of this software and associated documentation files (the
186
+ "Software"), to deal in the Software without restriction, including
187
+ without limitation the rights to use, copy, modify, merge, publish,
188
+ distribute, sublicense, and/or sell copies of the Software, and to
189
+ permit persons to whom the Software is furnished to do so, subject to
190
+ the following conditions:
191
+
192
+ The above copyright notice and this permission notice shall be
193
+ included in all copies or substantial portions of the Software.
194
+
195
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
196
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
197
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
198
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
199
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
200
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
201
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
202
+ ----------------------------------------------------------------------
203
+
204
+ Authors/contributors include:
205
+
206
+ A. Wilcox
207
+ Ada Worcester
208
+ Alex Dowad
209
+ Alex Suykov
210
+ Alexander Monakov
211
+ Andre McCurdy
212
+ Andrew Kelley
213
+ Anthony G. Basile
214
+ Aric Belsito
215
+ Arvid Picciani
216
+ Bartosz Brachaczek
217
+ Benjamin Peterson
218
+ Bobby Bingham
219
+ Boris Brezillon
220
+ Brent Cook
221
+ Chris Spiegel
222
+ Clément Vasseur
223
+ Daniel Micay
224
+ Daniel Sabogal
225
+ Daurnimator
226
+ David Carlier
227
+ David Edelsohn
228
+ Denys Vlasenko
229
+ Dmitry Ivanov
230
+ Dmitry V. Levin
231
+ Drew DeVault
232
+ Emil Renner Berthing
233
+ Fangrui Song
234
+ Felix Fietkau
235
+ Felix Janda
236
+ Gianluca Anzolin
237
+ Hauke Mehrtens
238
+ He X
239
+ Hiltjo Posthuma
240
+ Isaac Dunham
241
+ Jaydeep Patil
242
+ Jens Gustedt
243
+ Jeremy Huntwork
244
+ Jo-Philipp Wich
245
+ Joakim Sindholt
246
+ John Spencer
247
+ Julien Ramseier
248
+ Justin Cormack
249
+ Kaarle Ritvanen
250
+ Khem Raj
251
+ Kylie McClain
252
+ Leah Neukirchen
253
+ Luca Barbato
254
+ Luka Perkov
255
+ M Farkas-Dyck (Strake)
256
+ Mahesh Bodapati
257
+ Markus Wichmann
258
+ Masanori Ogino
259
+ Michael Clark
260
+ Michael Forney
261
+ Mikhail Kremnyov
262
+ Natanael Copa
263
+ Nicholas J. Kain
264
+ orc
265
+ Pascal Cuoq
266
+ Patrick Oppenlander
267
+ Petr Hosek
268
+ Petr Skocik
269
+ Pierre Carrier
270
+ Reini Urban
271
+ Rich Felker
272
+ Richard Pennington
273
+ Ryan Fairfax
274
+ Samuel Holland
275
+ Segev Finer
276
+ Shiz
277
+ sin
278
+ Solar Designer
279
+ Stefan Kristiansson
280
+ Stefan O'Rear
281
+ Szabolcs Nagy
282
+ Timo Teräs
283
+ Trutz Behn
284
+ Valentin Ochs
285
+ Will Dietz
286
+ William Haddon
287
+ William Pitcock
288
+
289
+ Portions of this software are derived from third-party works licensed
290
+ under terms compatible with the above MIT license:
291
+
292
+ The TRE regular expression implementation (src/regex/reg* and
293
+ src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
294
+ under a 2-clause BSD license (license text in the source files). The
295
+ included version has been heavily modified by Rich Felker in 2012, in
296
+ the interests of size, simplicity, and namespace cleanliness.
297
+
298
+ Much of the math library code (src/math/* and src/complex/*) is
299
+ Copyright © 1993,2004 Sun Microsystems or
300
+ Copyright © 2003-2011 David Schultz or
301
+ Copyright © 2003-2009 Steven G. Kargl or
302
+ Copyright © 2003-2009 Bruce D. Evans or
303
+ Copyright © 2008 Stephen L. Moshier or
304
+ Copyright © 2017-2018 Arm Limited
305
+ and labelled as such in comments in the individual source files. All
306
+ have been licensed under extremely permissive terms.
307
+
308
+ The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
309
+ The Android Open Source Project and is licensed under a two-clause BSD
310
+ license. It was taken from Bionic libc, used on Android.
311
+
312
+ The AArch64 memcpy and memset code (src/string/aarch64/*) are
313
+ Copyright © 1999-2019, Arm Limited.
314
+
315
+ The implementation of DES for crypt (src/crypt/crypt_des.c) is
316
+ Copyright © 1994 David Burren. It is licensed under a BSD license.
317
+
318
+ The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
319
+ originally written by Solar Designer and placed into the public
320
+ domain. The code also comes with a fallback permissive license for use
321
+ in jurisdictions that may not recognize the public domain.
322
+
323
+ The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
324
+ Valentin Ochs and is licensed under an MIT-style license.
325
+
326
+ The x86_64 port was written by Nicholas J. Kain and is licensed under
327
+ the standard MIT terms.
328
+
329
+ The mips and microblaze ports were originally written by Richard
330
+ Pennington for use in the ellcc project. The original code was adapted
331
+ by Rich Felker for build system and code conventions during upstream
332
+ integration. It is licensed under the standard MIT terms.
333
+
334
+ The mips64 port was contributed by Imagination Technologies and is
335
+ licensed under the standard MIT terms.
336
+
337
+ The powerpc port was also originally written by Richard Pennington,
338
+ and later supplemented and integrated by John Spencer. It is licensed
339
+ under the standard MIT terms.
340
+
341
+ All other files which have no copyright comments are original works
342
+ produced specifically for use as part of this library, written either
343
+ by Rich Felker, the main author of the library, or by one or more
344
+ contibutors listed above. Details on authorship of individual files
345
+ can be found in the git version control history of the project. The
346
+ omission of copyright and license comments in each file is in the
347
+ interest of source tree size.
348
+
349
+ In addition, permission is hereby granted for all public header files
350
+ (include/* and arch/*/bits/*) and crt files intended to be linked into
351
+ applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
352
+ the copyright notice and permission notice otherwise required by the
353
+ license, and to use these files without any requirement of
354
+ attribution. These files include substantial contributions from:
355
+
356
+ Bobby Bingham
357
+ John Spencer
358
+ Nicholas J. Kain
359
+ Rich Felker
360
+ Richard Pennington
361
+ Stefan Kristiansson
362
+ Szabolcs Nagy
363
+
364
+ all of whom have explicitly granted such permission.
365
+
366
+ This file previously contained text expressing a belief that most of
367
+ the files covered by the above exception were sufficiently trivial not
368
+ to be subject to copyright, resulting in confusion over whether it
369
+ negated the permissions granted in the license. In the spirit of
370
+ permissive licensing, and of not having licensing issues being an
371
+ obstacle to adoption, that text has been removed.
372
+
373
+ ================================================================================
374
+ wasm2go (https://github.com/goccy/wasm2go)
375
+ --------------------------------------------------------------------------------
376
+
377
+ MIT License
378
+
379
+ Copyright (c) 2026 Masaaki Goshima
380
+
381
+ Permission is hereby granted, free of charge, to any person obtaining a copy
382
+ of this software and associated documentation files (the "Software"), to deal
383
+ in the Software without restriction, including without limitation the rights
384
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
385
+ copies of the Software, and to permit persons to whom the Software is
386
+ furnished to do so, subject to the following conditions:
387
+
388
+ The above copyright notice and this permission notice shall be included in all
389
+ copies or substantial portions of the Software.
390
+
391
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
392
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
393
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
394
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
395
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
396
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
397
+ SOFTWARE.
398
+
399
+ ================================================================================
400
+ Go (https://go.dev), golang.org/x/crypto and golang.org/x/sys
401
+ --------------------------------------------------------------------------------
402
+
403
+ Copyright 2009 The Go Authors.
404
+
405
+ Redistribution and use in source and binary forms, with or without
406
+ modification, are permitted provided that the following conditions are
407
+ met:
408
+
409
+ * Redistributions of source code must retain the above copyright
410
+ notice, this list of conditions and the following disclaimer.
411
+ * Redistributions in binary form must reproduce the above
412
+ copyright notice, this list of conditions and the following disclaimer
413
+ in the documentation and/or other materials provided with the
414
+ distribution.
415
+ * Neither the name of Google LLC nor the names of its
416
+ contributors may be used to endorse or promote products derived from
417
+ this software without specific prior written permission.
418
+
419
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
420
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
421
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
422
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
423
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
424
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
425
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
426
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
427
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
428
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
429
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
430
+
431
+ ================================================================================
432
+ github.com/klauspost/compress
433
+ --------------------------------------------------------------------------------
434
+
435
+ Copyright (c) 2012 The Go Authors. All rights reserved.
436
+ Copyright (c) 2019 Klaus Post. All rights reserved.
437
+
438
+ Redistribution and use in source and binary forms, with or without
439
+ modification, are permitted provided that the following conditions are
440
+ met:
441
+
442
+ * Redistributions of source code must retain the above copyright
443
+ notice, this list of conditions and the following disclaimer.
444
+ * Redistributions in binary form must reproduce the above
445
+ copyright notice, this list of conditions and the following disclaimer
446
+ in the documentation and/or other materials provided with the
447
+ distribution.
448
+ * Neither the name of Google Inc. nor the names of its
449
+ contributors may be used to endorse or promote products derived from
450
+ this software without specific prior written permission.
451
+
452
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
453
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
454
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
455
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
456
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
457
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
458
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
459
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
460
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
461
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
462
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
463
+
464
+ ------------------
465
+
466
+ Files: gzhttp/*
467
+
468
+ Apache License
469
+ Version 2.0, January 2004
470
+ http://www.apache.org/licenses/
471
+
472
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
473
+
474
+ 1. Definitions.
475
+
476
+ "License" shall mean the terms and conditions for use, reproduction,
477
+ and distribution as defined by Sections 1 through 9 of this document.
478
+
479
+ "Licensor" shall mean the copyright owner or entity authorized by
480
+ the copyright owner that is granting the License.
481
+
482
+ "Legal Entity" shall mean the union of the acting entity and all
483
+ other entities that control, are controlled by, or are under common
484
+ control with that entity. For the purposes of this definition,
485
+ "control" means (i) the power, direct or indirect, to cause the
486
+ direction or management of such entity, whether by contract or
487
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
488
+ outstanding shares, or (iii) beneficial ownership of such entity.
489
+
490
+ "You" (or "Your") shall mean an individual or Legal Entity
491
+ exercising permissions granted by this License.
492
+
493
+ "Source" form shall mean the preferred form for making modifications,
494
+ including but not limited to software source code, documentation
495
+ source, and configuration files.
496
+
497
+ "Object" form shall mean any form resulting from mechanical
498
+ transformation or translation of a Source form, including but
499
+ not limited to compiled object code, generated documentation,
500
+ and conversions to other media types.
501
+
502
+ "Work" shall mean the work of authorship, whether in Source or
503
+ Object form, made available under the License, as indicated by a
504
+ copyright notice that is included in or attached to the work
505
+ (an example is provided in the Appendix below).
506
+
507
+ "Derivative Works" shall mean any work, whether in Source or Object
508
+ form, that is based on (or derived from) the Work and for which the
509
+ editorial revisions, annotations, elaborations, or other modifications
510
+ represent, as a whole, an original work of authorship. For the purposes
511
+ of this License, Derivative Works shall not include works that remain
512
+ separable from, or merely link (or bind by name) to the interfaces of,
513
+ the Work and Derivative Works thereof.
514
+
515
+ "Contribution" shall mean any work of authorship, including
516
+ the original version of the Work and any modifications or additions
517
+ to that Work or Derivative Works thereof, that is intentionally
518
+ submitted to Licensor for inclusion in the Work by the copyright owner
519
+ or by an individual or Legal Entity authorized to submit on behalf of
520
+ the copyright owner. For the purposes of this definition, "submitted"
521
+ means any form of electronic, verbal, or written communication sent
522
+ to the Licensor or its representatives, including but not limited to
523
+ communication on electronic mailing lists, source code control systems,
524
+ and issue tracking systems that are managed by, or on behalf of, the
525
+ Licensor for the purpose of discussing and improving the Work, but
526
+ excluding communication that is conspicuously marked or otherwise
527
+ designated in writing by the copyright owner as "Not a Contribution."
528
+
529
+ "Contributor" shall mean Licensor and any individual or Legal Entity
530
+ on behalf of whom a Contribution has been received by Licensor and
531
+ subsequently incorporated within the Work.
532
+
533
+ 2. Grant of Copyright License. Subject to the terms and conditions of
534
+ this License, each Contributor hereby grants to You a perpetual,
535
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
536
+ copyright license to reproduce, prepare Derivative Works of,
537
+ publicly display, publicly perform, sublicense, and distribute the
538
+ Work and such Derivative Works in Source or Object form.
539
+
540
+ 3. Grant of Patent License. Subject to the terms and conditions of
541
+ this License, each Contributor hereby grants to You a perpetual,
542
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
543
+ (except as stated in this section) patent license to make, have made,
544
+ use, offer to sell, sell, import, and otherwise transfer the Work,
545
+ where such license applies only to those patent claims licensable
546
+ by such Contributor that are necessarily infringed by their
547
+ Contribution(s) alone or by combination of their Contribution(s)
548
+ with the Work to which such Contribution(s) was submitted. If You
549
+ institute patent litigation against any entity (including a
550
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
551
+ or a Contribution incorporated within the Work constitutes direct
552
+ or contributory patent infringement, then any patent licenses
553
+ granted to You under this License for that Work shall terminate
554
+ as of the date such litigation is filed.
555
+
556
+ 4. Redistribution. You may reproduce and distribute copies of the
557
+ Work or Derivative Works thereof in any medium, with or without
558
+ modifications, and in Source or Object form, provided that You
559
+ meet the following conditions:
560
+
561
+ (a) You must give any other recipients of the Work or
562
+ Derivative Works a copy of this License; and
563
+
564
+ (b) You must cause any modified files to carry prominent notices
565
+ stating that You changed the files; and
566
+
567
+ (c) You must retain, in the Source form of any Derivative Works
568
+ that You distribute, all copyright, patent, trademark, and
569
+ attribution notices from the Source form of the Work,
570
+ excluding those notices that do not pertain to any part of
571
+ the Derivative Works; and
572
+
573
+ (d) If the Work includes a "NOTICE" text file as part of its
574
+ distribution, then any Derivative Works that You distribute must
575
+ include a readable copy of the attribution notices contained
576
+ within such NOTICE file, excluding those notices that do not
577
+ pertain to any part of the Derivative Works, in at least one
578
+ of the following places: within a NOTICE text file distributed
579
+ as part of the Derivative Works; within the Source form or
580
+ documentation, if provided along with the Derivative Works; or,
581
+ within a display generated by the Derivative Works, if and
582
+ wherever such third-party notices normally appear. The contents
583
+ of the NOTICE file are for informational purposes only and
584
+ do not modify the License. You may add Your own attribution
585
+ notices within Derivative Works that You distribute, alongside
586
+ or as an addendum to the NOTICE text from the Work, provided
587
+ that such additional attribution notices cannot be construed
588
+ as modifying the License.
589
+
590
+ You may add Your own copyright statement to Your modifications and
591
+ may provide additional or different license terms and conditions
592
+ for use, reproduction, or distribution of Your modifications, or
593
+ for any such Derivative Works as a whole, provided Your use,
594
+ reproduction, and distribution of the Work otherwise complies with
595
+ the conditions stated in this License.
596
+
597
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
598
+ any Contribution intentionally submitted for inclusion in the Work
599
+ by You to the Licensor shall be under the terms and conditions of
600
+ this License, without any additional terms or conditions.
601
+ Notwithstanding the above, nothing herein shall supersede or modify
602
+ the terms of any separate license agreement you may have executed
603
+ with Licensor regarding such Contributions.
604
+
605
+ 6. Trademarks. This License does not grant permission to use the trade
606
+ names, trademarks, service marks, or product names of the Licensor,
607
+ except as required for reasonable and customary use in describing the
608
+ origin of the Work and reproducing the content of the NOTICE file.
609
+
610
+ 7. Disclaimer of Warranty. Unless required by applicable law or
611
+ agreed to in writing, Licensor provides the Work (and each
612
+ Contributor provides its Contributions) on an "AS IS" BASIS,
613
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
614
+ implied, including, without limitation, any warranties or conditions
615
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
616
+ PARTICULAR PURPOSE. You are solely responsible for determining the
617
+ appropriateness of using or redistributing the Work and assume any
618
+ risks associated with Your exercise of permissions under this License.
619
+
620
+ 8. Limitation of Liability. In no event and under no legal theory,
621
+ whether in tort (including negligence), contract, or otherwise,
622
+ unless required by applicable law (such as deliberate and grossly
623
+ negligent acts) or agreed to in writing, shall any Contributor be
624
+ liable to You for damages, including any direct, indirect, special,
625
+ incidental, or consequential damages of any character arising as a
626
+ result of this License or out of the use or inability to use the
627
+ Work (including but not limited to damages for loss of goodwill,
628
+ work stoppage, computer failure or malfunction, or any and all
629
+ other commercial damages or losses), even if such Contributor
630
+ has been advised of the possibility of such damages.
631
+
632
+ 9. Accepting Warranty or Additional Liability. While redistributing
633
+ the Work or Derivative Works thereof, You may choose to offer,
634
+ and charge a fee for, acceptance of support, warranty, indemnity,
635
+ or other liability obligations and/or rights consistent with this
636
+ License. However, in accepting such obligations, You may act only
637
+ on Your own behalf and on Your sole responsibility, not on behalf
638
+ of any other Contributor, and only if You agree to indemnify,
639
+ defend, and hold each Contributor harmless for any liability
640
+ incurred by, or claims asserted against, such Contributor by reason
641
+ of your accepting any such warranty or additional liability.
642
+
643
+ END OF TERMS AND CONDITIONS
644
+
645
+ APPENDIX: How to apply the Apache License to your work.
646
+
647
+ To apply the Apache License to your work, attach the following
648
+ boilerplate notice, with the fields enclosed by brackets "[]"
649
+ replaced with your own identifying information. (Don't include
650
+ the brackets!) The text should be enclosed in the appropriate
651
+ comment syntax for the file format. We also recommend that a
652
+ file or class name and description of purpose be included on the
653
+ same "printed page" as the copyright notice for easier
654
+ identification within third-party archives.
655
+
656
+ Copyright 2016-2017 The New York Times Company
657
+
658
+ Licensed under the Apache License, Version 2.0 (the "License");
659
+ you may not use this file except in compliance with the License.
660
+ You may obtain a copy of the License at
661
+
662
+ http://www.apache.org/licenses/LICENSE-2.0
663
+
664
+ Unless required by applicable law or agreed to in writing, software
665
+ distributed under the License is distributed on an "AS IS" BASIS,
666
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
667
+ See the License for the specific language governing permissions and
668
+ limitations under the License.
669
+
670
+ ------------------
671
+
672
+ Files: s2/cmd/internal/readahead/*
673
+
674
+ The MIT License (MIT)
675
+
676
+ Copyright (c) 2015 Klaus Post
677
+
678
+ Permission is hereby granted, free of charge, to any person obtaining a copy
679
+ of this software and associated documentation files (the "Software"), to deal
680
+ in the Software without restriction, including without limitation the rights
681
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
682
+ copies of the Software, and to permit persons to whom the Software is
683
+ furnished to do so, subject to the following conditions:
684
+
685
+ The above copyright notice and this permission notice shall be included in all
686
+ copies or substantial portions of the Software.
687
+
688
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
689
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
690
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
691
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
692
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
693
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
694
+ SOFTWARE.
695
+
696
+ ---------------------
697
+ Files: snappy/*
698
+ Files: internal/snapref/*
699
+
700
+ Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.
701
+
702
+ Redistribution and use in source and binary forms, with or without
703
+ modification, are permitted provided that the following conditions are
704
+ met:
705
+
706
+ * Redistributions of source code must retain the above copyright
707
+ notice, this list of conditions and the following disclaimer.
708
+ * Redistributions in binary form must reproduce the above
709
+ copyright notice, this list of conditions and the following disclaimer
710
+ in the documentation and/or other materials provided with the
711
+ distribution.
712
+ * Neither the name of Google Inc. nor the names of its
713
+ contributors may be used to endorse or promote products derived from
714
+ this software without specific prior written permission.
715
+
716
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
717
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
718
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
719
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
720
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
721
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
722
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
723
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
724
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
725
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
726
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
727
+
728
+ -----------------
729
+
730
+ Files: s2/cmd/internal/filepathx/*
731
+
732
+ Copyright 2016 The filepathx Authors
733
+
734
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
735
+
736
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
737
+
738
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.