dshm-compat 0.1.5 → 0.1.6
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/CHANGELOG.md +11 -0
- package/INSTALL.md +5 -5
- package/README.md +7 -6
- package/docs/RECIPES.md +4 -1
- package/lib/s2-native.js +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
- Native worker wrappers now bridge the DSHM host app-files prefix
|
|
6
|
+
`/data/storage/el2/base/haps/entry/files` to the guest's `/mnt/share` 9p
|
|
7
|
+
mount. `dsh-ops` passes the host `policy.workspaceRoot` as the worker's
|
|
8
|
+
`root`; the worker canonicalizes it before doing anything, so an unmapped
|
|
9
|
+
host path made every `ops_*` call fail with `NOT_FOUND` even when the guest
|
|
10
|
+
path existed. The wrapper creates the symlink only when the guest mount
|
|
11
|
+
exists and the host prefix is absent.
|
|
12
|
+
- Offline regression suite: 30/30.
|
|
13
|
+
|
|
3
14
|
## 0.1.5
|
|
4
15
|
|
|
5
16
|
- Spawn rewriting now uses `['bash', file]` plus a staged shell wrapper instead
|
package/INSTALL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Installing dshm-compat
|
|
2
2
|
|
|
3
|
-
The artifact is a normal DSH bundle package: `dshm-compat-0.1.
|
|
3
|
+
The artifact is a normal DSH bundle package: `dshm-compat-0.1.6.tgz`.
|
|
4
4
|
It is host-only, has no runtime dependencies, and adds twelve agent tools.
|
|
5
5
|
|
|
6
6
|
## A. DSHM (the tablet)
|
|
@@ -15,7 +15,7 @@ input calls `pnpm view` before installing and fails with
|
|
|
15
15
|
`Command failed with EACCES: pnpm view ... spawn pnpm EACCES`. Use one of these
|
|
16
16
|
instead:
|
|
17
17
|
|
|
18
|
-
- ask the DSHM Agent to run `pnpm add dshm-compat@0.1.
|
|
18
|
+
- ask the DSHM Agent to run `pnpm add dshm-compat@0.1.6` in its bash tool (the
|
|
19
19
|
bundled pnpm shim routes that command to the host install queue); or
|
|
20
20
|
- install from a GitHub repository URL; or
|
|
21
21
|
- after any working install, use the plugin's own `compat_install` tool for
|
|
@@ -28,7 +28,7 @@ not accept local paths, `file:` or `http://` specs.
|
|
|
28
28
|
|
|
29
29
|
### A2. HTTPS tarball
|
|
30
30
|
|
|
31
|
-
Put `dshm-compat-0.1.
|
|
31
|
+
Put `dshm-compat-0.1.6.tgz` on any HTTPS host (GitHub Release, Gitee Release,
|
|
32
32
|
object storage) and paste the `.tgz` URL into the same Add plugin input. DSHM's
|
|
33
33
|
installer accepts tarball specs; if the current market UI refuses a plain URL,
|
|
34
34
|
use A1.
|
|
@@ -38,7 +38,7 @@ use A1.
|
|
|
38
38
|
If `hdc` is available and the app can read the path:
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
hdc file send dshm-compat-0.1.
|
|
41
|
+
hdc file send dshm-compat-0.1.6.tgz /data/storage/el2/base/haps/entry/files/dshm-compat-0.1.6.tgz
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Then enter the absolute path (or `file:/...`) in the Add plugin input. This
|
|
@@ -47,7 +47,7 @@ depends on the DSHM build's local-file support; A1 is safer.
|
|
|
47
47
|
## B. Desktop DSH (for testing only)
|
|
48
48
|
|
|
49
49
|
```powershell
|
|
50
|
-
& 'D:\安装\dsh-desktop\resources\runtime\cli\bin\dsh.cmd' plugin --profile desktop add 'D:\dsh\dsh-26-09-30\dshm-compat\dshm-compat-0.1.
|
|
50
|
+
& 'D:\安装\dsh-desktop\resources\runtime\cli\bin\dsh.cmd' plugin --profile desktop add 'D:\dsh\dsh-26-09-30\dshm-compat\dshm-compat-0.1.6.tgz'
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
If the profile reports `ERR_PNPM_UNEXPECTED_VIRTUAL_STORE`, its `node_modules`
|
package/README.md
CHANGED
|
@@ -5,12 +5,13 @@ them through the least invasive strategy that can work.
|
|
|
5
5
|
|
|
6
6
|
## Current phase
|
|
7
7
|
|
|
8
|
-
0.1.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
queue
|
|
8
|
+
0.1.6 bridges the host app-files prefix to the guest `/mnt/share` mount for
|
|
9
|
+
native worker roots, fixing `NOT_FOUND` from `ops_*`. 0.1.5 added non-`-c`
|
|
10
|
+
spawn wrappers, release fallbacks, and `compat_uninstall`; 0.1.4 added the
|
|
11
|
+
generic S2 adapter with x86_64 QEMU and GitHub Release acquisition. Phase 1
|
|
12
|
+
ships the analyzer, the S0/S1 converter, the generic S2 engine, guest
|
|
13
|
+
probing/provisioning, the DSHM install-queue transport, and a profile-local
|
|
14
|
+
fallback for artifacts the host queue rejects:
|
|
14
15
|
|
|
15
16
|
- `compat_analyze` downloads an npm/GitHub/local package and classifies it.
|
|
16
17
|
- `compat_plan` returns the concrete conversion plan without changing anything.
|
package/docs/RECIPES.md
CHANGED
|
@@ -33,7 +33,10 @@ For each match it:
|
|
|
33
33
|
- adds `openharmony`/target/arch to `dsh-plugin.json` component targets;
|
|
34
34
|
- stages the wrapper at `runtime/<target>/<worker>` and the real binary at
|
|
35
35
|
`<worker>-bin` (AArch64) or `<worker>-x64` (x86_64), with a matching
|
|
36
|
-
`provenance.json` (`version`, `target`, `executable`, `sha256`).
|
|
36
|
+
`provenance.json` (`version`, `target`, `executable`, `sha256`). The wrapper
|
|
37
|
+
also links the host app-files prefix
|
|
38
|
+
`/data/storage/el2/base/haps/entry/files` to the guest `/mnt/share` mount, so
|
|
39
|
+
a worker that canonicalizes the host `policy.workspaceRoot` sees a real path.
|
|
37
40
|
|
|
38
41
|
A source package whose `main` is absent but which has a `build`/`prepack` script
|
|
39
42
|
returns `needs-build` with `npm ci && npm run build && npm pack`; the produced
|
package/lib/s2-native.js
CHANGED
|
@@ -230,11 +230,19 @@ export async function convertS2Native(spec, options = {}) {
|
|
|
230
230
|
let stagedWorker
|
|
231
231
|
let workerSource
|
|
232
232
|
try {
|
|
233
|
+
const hostFilesLink = [
|
|
234
|
+
'# DSHM host app-files prefix -> guest 9p mount',
|
|
235
|
+
'if [ -d /mnt/share ] && [ ! -e /data/storage/el2/base/haps/entry/files ] && [ ! -L /data/storage/el2/base/haps/entry/files ]; then',
|
|
236
|
+
' mkdir -p /data/storage/el2/base/haps/entry 2>/dev/null || true',
|
|
237
|
+
' ln -s /mnt/share /data/storage/el2/base/haps/entry/files 2>/dev/null || true',
|
|
238
|
+
'fi',
|
|
239
|
+
]
|
|
233
240
|
if (workerArch === 'x64') {
|
|
234
241
|
const realName = `${workerName}-x64`
|
|
235
242
|
stagedWorker = Buffer.from([
|
|
236
243
|
'#!/bin/sh',
|
|
237
244
|
'set -e',
|
|
245
|
+
...hostFilesLink,
|
|
238
246
|
'DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)',
|
|
239
247
|
`exec "$DIR/qemu-x86_64" -L "$DIR/rootfs" "$DIR/${realName}" "$@"`,
|
|
240
248
|
'',
|
|
@@ -250,6 +258,7 @@ export async function convertS2Native(spec, options = {}) {
|
|
|
250
258
|
stagedWorker = Buffer.from([
|
|
251
259
|
'#!/bin/sh',
|
|
252
260
|
'set -e',
|
|
261
|
+
...hostFilesLink,
|
|
253
262
|
'DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)',
|
|
254
263
|
`exec "$DIR/${realName}" "$@"`,
|
|
255
264
|
'',
|
|
@@ -281,6 +290,7 @@ export async function convertS2Native(spec, options = {}) {
|
|
|
281
290
|
workerArch === 'x64'
|
|
282
291
|
? `staged ${workerName} as a shell wrapper over qemu-x86_64 + glibc rootfs`
|
|
283
292
|
: `staged ${workerName} as a shell wrapper over ${workerName}-bin`,
|
|
293
|
+
'mapped /data/storage/el2/base/haps/entry/files to the guest /mnt/share mount',
|
|
284
294
|
]
|
|
285
295
|
|
|
286
296
|
const output = files.filter(file => file.path !== workerPath).map(file => {
|