nedb-engine 9.0.0 → 9.0.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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/nesql.js CHANGED
@@ -33,15 +33,52 @@ const { spawn } = require("child_process");
33
33
  const path = require("path");
34
34
  const fs = require("fs");
35
35
 
36
+ // Keyed platform-arch, with the Linux legs split by libc.
37
+ //
38
+ // This table promised four platforms while the published package carried a
39
+ // binary for NONE of them (v8.0.0 through v9.0.0): the build that arch-named
40
+ // these files ran in a job that never uploaded them. The table was not the
41
+ // bug, but it was the thing that made the bug speak -- so it now covers every
42
+ // binary the release actually builds, rather than a subset chosen by hand.
36
43
  const SUPPORTED = {
37
44
  "linux-x64": "nesql-linux-x64",
45
+ "linux-arm64": "nesql-linux-arm64",
46
+ "linux-x64-musl": "nesql-linux-x64-musl",
47
+ "linux-arm64-musl": "nesql-linux-arm64-musl",
38
48
  "win32-x64": "nesql-win-x64.exe",
39
49
  "darwin-arm64": "nesql-darwin-arm64",
40
50
  "darwin-x64": "nesql-darwin-x64",
41
51
  };
42
52
 
53
+ // musl and glibc binaries are not interchangeable, and the failure when they
54
+ // are swapped is a loader error that names neither libc. Node reports the
55
+ // runtime glibc version in its process report; on musl the field is simply
56
+ // absent. That is the same probe napi-rs uses to pick an addon, so a musl
57
+ // Alpine container resolves the musl CLI for the same reason it resolves the
58
+ // musl addon.
59
+ function libcSuffix() {
60
+ if (process.platform !== "linux") return "";
61
+ try {
62
+ const rep = typeof process.report?.getReport === "function"
63
+ ? process.report.getReport()
64
+ : null;
65
+ if (rep && rep.header && !rep.header.glibcVersionRuntime) return "-musl";
66
+ } catch (err) {
67
+ // Named, not swallowed: if the probe itself breaks we fall through to the
68
+ // glibc name, and the reader needs to know that is a GUESS rather than a
69
+ // detection, because the resulting error will be a confusing loader
70
+ // failure rather than a clean "unsupported platform".
71
+ process.stderr.write(
72
+ `nesql: could not probe libc (${err.message}); assuming glibc. ` +
73
+ `If this is Alpine/musl and the next error is a loader failure, that ` +
74
+ `is why.\n`
75
+ );
76
+ }
77
+ return "";
78
+ }
79
+
43
80
  function main() {
44
- const key = `${process.platform}-${process.arch}`;
81
+ const key = `${process.platform}-${process.arch}${libcSuffix()}`;
45
82
  const name = SUPPORTED[key];
46
83
 
47
84
  if (!name) {
@@ -55,13 +92,21 @@ function main() {
55
92
 
56
93
  const binPath = path.join(__dirname, name);
57
94
  if (!fs.existsSync(binPath)) {
95
+ // The remedy list used to lead with `npm install --force nedb-engine`,
96
+ // which cannot work and wasted the reader's time: through v9.0.0 no
97
+ // published version contained a nesql binary for ANY platform, so
98
+ // reinstalling fetched the same incomplete tarball. Do not suggest a
99
+ // reinstall as a fix for a packaging gap -- name the gap.
58
100
  process.stderr.write(
59
- `nesql: the prebuilt binary is missing for this platform.\n` +
101
+ `nesql: the prebuilt binary is missing from this package.\n` +
60
102
  ` expected: ${binPath}\n` +
61
103
  ` platform: ${key}\n\n` +
62
- `This nedb-engine install did not include it. Fixes:\n` +
63
- ` npm install --force nedb-engine\n` +
64
- ` cargo install nesql # builds from source, any platform\n`
104
+ `This is a packaging gap, not a corrupt install -- reinstalling will\n` +
105
+ `fetch the same tarball. Working alternatives right now:\n\n` +
106
+ ` pip install nedb-engine && nesql --help # the wheel ships the CLI\n` +
107
+ ` cargo install nesql # builds from source\n\n` +
108
+ `Please report it with the two lines above:\n` +
109
+ ` https://github.com/Eth-Interchained/nedb/issues\n`
65
110
  );
66
111
  process.exit(5);
67
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nedb-engine",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "NEDB \u2014 hash-chained, time-traveling, bi-temporal embedded database with Rust native core. SQL, Redis, MongoDB adapters. Causal Write Provenance. RESP2 wire protocol.",
5
5
  "main": "index.js",
6
6
  "exports": {
Binary file
Binary file