@vzn/vx 0.0.408 → 0.0.410

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.408",
3
+ "version": "0.0.410",
4
4
  "description": "The fastest task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,10 +21,10 @@
21
21
  "node": ">=18"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@vzn/vx-linux-x64": "0.0.408",
25
- "@vzn/vx-linux-arm64": "0.0.408",
26
- "@vzn/vx-darwin-x64": "0.0.408",
27
- "@vzn/vx-darwin-arm64": "0.0.408"
24
+ "@vzn/vx-linux-x64": "0.0.410",
25
+ "@vzn/vx-linux-arm64": "0.0.410",
26
+ "@vzn/vx-darwin-x64": "0.0.410",
27
+ "@vzn/vx-darwin-arm64": "0.0.410"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -2054,10 +2054,17 @@ const SQLITE_FCNTL_PERSIST_WAL = 10
2054
2054
  * `sqlite3_close_v2` does), so `cache.db` and its `-wal` and `-shm` stayed
2055
2055
  * open after `Cache.close()`: a leaked descriptor per run for an embedder
2056
2056
  * (O-10).
2057
- * `close(true)` finalizes them and closes.
2057
+ * `close(true)` finalizes them and closes. Below the Bun floor (1.3.14) it
2058
+ * does not finalize: it answers SQLITE_BUSY, "database is locked", and every
2059
+ * `vx run` exited 1 with that stack after its tasks had passed (M-44). There
2060
+ * the deferred close is the one that closes.
2058
2061
  */
2059
2062
  function closeDb(db: Database): void {
2060
- db.close(true)
2063
+ try {
2064
+ db.close(true)
2065
+ } catch {
2066
+ db.close()
2067
+ }
2061
2068
  }
2062
2069
 
2063
2070
  /**
@@ -152,13 +152,21 @@ export class ChangeJudge {
152
152
  const editForUncached = (p: string): boolean =>
153
153
  [...this.ctx.uncached()].some((dir) => p.startsWith(dir + path.sep)) &&
154
154
  !this.writtenDuringLastCycle(p)
155
+ // A path still there names the cycle before a gone one: an editor or
156
+ // `sed -i` saving through a temporary file fires that file first, and
157
+ // the cycle was announced by a name already renamed away.
158
+ let gone: [label: string, abs: string] | undefined
155
159
  for (const [p, l] of this.pending) {
156
160
  if (ignored.has(p) && !editForUncached(p)) continue
157
- if (!this.sameState(p) && first === undefined) {
158
- first = l
159
- firstAbs = p
161
+ if (this.sameState(p) || first !== undefined) continue
162
+ if (!fs.existsSync(p)) {
163
+ gone ??= [l, p]
164
+ continue
160
165
  }
166
+ first = l
167
+ firstAbs = p
161
168
  }
169
+ if (first === undefined && gone !== undefined) [first, firstAbs] = gone
162
170
  this.pending.clear()
163
171
  const byServer = firstAbs !== undefined && this.ctx.held()
164
172
  if (firstAbs === undefined || !this.writtenDuringLastCycle(firstAbs, true)) {