Repository navigation
Commit 07dfb84
committed
fix(service): keep an absolute POSIX sqlite home literal in POSIX service files
A generated systemd unit or launchd plist written from a Windows host carried
`CODEX_SQLITE_HOME=D:\tmp\codex-sqlite-home` for an input of `/tmp/codex-sqlite-home`,
while `CODEX_HOME` in the same file kept its POSIX value. One file, two variables
holding the same kind of value, disagreeing with each other.
`currentCodexSqliteHomeAbsolute` ends in `resolve()`, which is host-relative in both
directions: on a Windows host it anchors `/tmp/x` to the current drive, and on a POSIX
host it would turn `C:\data` into `<cwd>/C:\data`. Neither is a path the target can use.
The Windows branch above it already made this argument and preserved an
already-absolute drive/UNC path; the POSIX side had no counterpart.
Absolute-for-the-target paths are now preserved on both sides. A relative value still
resolves, which is why the `resolve()` is there at all — a service unit has no
meaningful working directory.
Fixes the two long-standing Windows failures in `tests/service.test.ts`
(`systemd service unit > preserves custom Codex and OpenCodex homes` and the launchd
equivalent), which the reporter had been carrying as tolerated-by-name for several
releases: 119 pass / 2 fail -> 123 pass / 0 fail.
The added invariant test was driven red against the unfixed resolver. Note it can only
fail on a Windows host: on POSIX, `resolve()` of an absolute POSIX path is identity, so
this class of bug is invisible there — which is why it survived CI for so long.
Closes #17861 parent 7612e4c commit 07dfb84
2 files changed
Lines changed: 53 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
666 | 705 | | |
667 | 706 | | |
668 | 707 | | |
| |||
0 commit comments