native-dawn 0.1.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 CHANGED
@@ -15,11 +15,11 @@ Because the Node addon links the shared library instead of carrying its own copy
15
15
  npm install native-dawn
16
16
  ```
17
17
 
18
- Installation downloads the archive for your platform from this repository's GitHub releases, checks its SHA-256 and version, and loads the addon once to make sure it works.
18
+ Installation downloads the archive for your platform from this repository's GitHub releases, checks its SHA-256 and version, and loads the addon once to make sure it works. If that fails (an unsupported platform, no network, a C library too old for the binary), the install prints a warning and still succeeds, so packages that depend on native-dawn install everywhere; importing native-dawn then throws. A corrupt or mismatched archive is never installed. Set `NATIVE_DAWN_STRICT_INSTALL=1` to make install failures fatal.
19
19
 
20
20
  | Platform | Architectures | Backend |
21
21
  | --- | --- | --- |
22
- | Linux (glibc; release builds run on Ubuntu 22.04 and newer) | x64, arm64 | Vulkan |
22
+ | Linux (glibc 2.34+: Ubuntu 22.04, Debian 12 and newer) | x64, arm64 | Vulkan |
23
23
  | macOS 11+ | x64, arm64 | Metal |
24
24
  | Windows | x64, arm64 | D3D12 |
25
25
  | Android 8.0+ (API 26), C SDK only | arm64 | Vulkan, OpenGL ES |
@@ -229,6 +229,7 @@ Environment variables:
229
229
  | `NATIVE_DAWN_BUILD_FROM_SOURCE=1` | Make `npm install` build instead of downloading |
230
230
  | `NATIVE_DAWN_BINARY=/path/to/archive.tar.gz` | Install a local archive (with its `.sha256` beside it) |
231
231
  | `NATIVE_DAWN_SKIP_INSTALL=1` | Skip the install step entirely |
232
+ | `NATIVE_DAWN_STRICT_INSTALL=1` | Fail `npm install` when no native build can be installed |
232
233
 
233
234
  ## Tests
234
235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-dawn",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Prebuilt Dawn WebGPU for Node.js and native code: shared library, C headers, and Node-API bindings",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -69,9 +69,14 @@ export async function install() {
69
69
  }
70
70
  }
71
71
 
72
+ // A failed install leaves native-dawn without a native build but never fails
73
+ // the surrounding npm install: packages that depend on it (webgpu-node, and
74
+ // through it wasmcart) must still install on platforms native-dawn does not
75
+ // cover, and only error when WebGPU is actually used. A bad archive is never
76
+ // installed either way. NATIVE_DAWN_STRICT_INSTALL=1 makes failures fatal.
72
77
  try {
73
78
  await install()
74
79
  } catch (error) {
75
- console.error(`native-dawn: ${error.message}\nTo build from source instead, install the toolchain in README.md and set NATIVE_DAWN_BUILD_FROM_SOURCE=1.`)
76
- process.exitCode = 1
80
+ console.warn(`native-dawn: no native build installed: ${error.message}\nWebGPU will not be available on this machine; importing native-dawn will throw. To build from source, install the toolchain in README.md and set NATIVE_DAWN_BUILD_FROM_SOURCE=1.`)
81
+ if (process.env.NATIVE_DAWN_STRICT_INSTALL === '1') process.exitCode = 1
77
82
  }