Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The code change in 3e61534 looks right, but the PR needs one live run before merge. I did not run the tests; I read the diff. Every new test replaces Not blocking, take or leave: a warm read used to spawn nothing, and now every read without The three cubic-dev-ai threads (#3726 (comment), #3726 (comment), #3726 (comment)) are fixed at this head, so please resolve them. CI shows 16 checks passing and Smoke Tests still running. I did not read that job, so I do not know if it starts an iOS runner and so reaches the real |
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The earlier findings on 3e61534 are partly addressed at 2953a77: the memo key now comes from the resolved xcode-select directory. One finding remains. The earlier review asked for one live run on a host with two Xcodes, and this head still has none. The new key source is the realpath of /var/db/xcode_select_link (https://github.com/callstack/agent-device/blob/2953a77/packages/platform-apple/src/runner/runner-toolchain-probe.ts#L209). Every test fakes it by mocking fs.realpathSync for that path (https://github.com/callstack/agent-device/blob/2953a77/packages/platform-apple/src/runner/apple-toolchain-fixtures.ts#L70-L83). No run reads the real root-owned link after a real Not blocking, and you can take or leave it: the PR body still describes 3e61534 (it says the key comes from xcode-select -p on every read and that hits no longer extend the TTL), while at this head the link read comes first and hits renew the entry, so please update the Summary bullets; XCODE_SELECT_LINK_PATH is also exported only so the suite can match it. The open inline threads still apply in part. Two hold: the renewal on every hit can serve an old build after an in-place Xcode update at the same real path, and rewording the comments settles it (#3726 (comment)); and the "no key" test wording is inaccurate (#3726 (comment)). One does not apply, so you can resolve it: realpathSync reads a local root-owned link, and any stall would also stall xcodebuild in the same read (#3726 (comment)). I did not run the tests, so I did not confirm that the new tests fail on 3e61534 or on main. I also did not measure realpath against the spawn cost, and I could not check whether every macOS or Xcode version writes that link. When it is missing, the read falls back to xcode-select -p. The 11 checks that are not passing are queued or still running for the latest push, so none has failed yet. Coverage and Integration cover the runner suites this diff touches. Before merge, the live run with a real |
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Status at Renewal serving an old build after an in-place update ( "no key" test wording (
Summary bullets describing The live two-Xcode run — still open on this host: one Xcode, no passwordless sudo. The body now carries three live transcripts on the production route against the real root-owned link and real On your last paragraph: agreed, and nothing here depends on the link existing — a host that lacks it takes the Gate: |
|
Round 4 in Per-client report retention ( Gate: Smoke Tests is red for everyone, not just here. At That does bear on your live-run requirement, so to be explicit about what is and is not on the table here: the iOS lane did run green on this branch at |
…select dir `toolchainFingerprintCacheKey` keyed the memo on `DEVELOPER_DIR` alone, so every default `xcode-select` selection shared one entry. A daemon that answered a cache decision before someone ran `sudo xcode-select -s` kept answering with the Xcode the host had left, and because every hit re-set the entry, a busy daemon served it indefinitely rather than for one TTL (#3300). - Resolve the default selection per read and key on it, keeping a client's `DEVELOPER_DIR` choice as before. - Run that resolution under the probe clock and cancellation, capped below the probes it precedes. A read that cannot resolve its selection skips the memo: a key shared by every unresolved selection would let one host selection answer for the next. - Measure the TTL from the read that stored an entry; a hit no longer extends it. - Keep the report path probe-free by looking entries up under the dir the read that stored one resolved. Related: #3449, whose Xcode-too-old reports should name the toolchain a decision actually read.
…solved A default-selection read that hit the memo returned before updating the report pointer, so after `xcode-select` moved A to B and back to A, a failure report named B for an A-backed runner. Route the read and the hit through one memo lookup so both record the dir the read resolved, and say so in that pointer's comment. Also drop "or skip" from the value-probe guard's comment: that guard only ever throws. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
The recorded selection outlives the entry it names: the memo's TTL is measured from the read that stored the entry, so a report can look it up after that entry is gone. Say that, and pin the case with a test that a report then names no Xcode rather than another selection's. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
The reviewer's xcodes case: a tool swaps the Xcode bundle behind a stable path, so `xcode-select -p` answers the same string and the key never moves. Resolve the host's selection link to the dir it really names, and follow the same path for a client's DEVELOPER_DIR so one toolchain lands on one entry. The link is read first, so a warm read costs no spawn; `xcode-select -p` is the fallback. Restore TTL renewal on a hit, which #3300 asked to keep: the key now moves with the selection, so a hit is evidence the entry still answers for this host. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…he dir A hit renews its entry, so a key that sees only the dir pins a stale fingerprint for as long as a daemon stays busy when an update replaces the bundle in place: an installer or App Store update at /Applications/Xcode.app keeps the path. Add the inode and mtime of the version file xcodebuild reads to the key, so the replaced bundle answers under a new key and the old entry expires once nothing renews it. The failure report now reads only the memo. It reused the key halves a real read built instead of resolving and stating the selection itself, which is what lets a hit renew at all: a report has no budget to spend and no deadline to answer to. Cancellation is observed after the key's two filesystem reads, so a warm hit cannot hide an abort. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
The reviewer's nit: it was exported only so the suite could match it. It belongs with the other Apple toolchain probe constant both probers read, where it can be named without that. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…eport One global record meant the last client-named DEVELOPER_DIR read erased what an earlier client needed to report on, even while that client's fingerprint was still cached. A daemon serves request-scoped selections concurrently, so retain the answer per name instead. It is a TTL memo, so a name whose reads stopped drops out on the same clock as the entry it names. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
b3f7e65 to
d33b804
Compare
|
Closing out your 16:39 list at Done: Not done here: the live |
Summary
toolchainFingerprintCacheKeykeyed the toolchain fingerprint memo onDEVELOPER_DIRalone, so every defaultxcode-selectselection shared one entry. A daemon that answered a cache decision before someone ransudo xcode-select -skept answering with the Xcode the host had left. Fixes #3300/var/db/xcode_select_link(or the client'sDEVELOPER_DIR) resolved throughrealpath, so a version manager swapping the bundle behind a stable path, or a client naming a symlinked Xcode, lands on the right entry.xcode-select -p(trimmed) is the fallback when the link cannot be read; a selection neither can name leaves the read with no key, so it skips the memo rather than sharing one.inoand integermtimeMsof<bundle>/Contents/version.plist, the filexcodebuild -versionreads. An update that replaces the bundle in place keeps the path, and a hit renews its entry, so without this the replaced build would be served for as long as the daemon stayed busy.DEVELOPER_DIRs concurrently and one global record would let the last read erase what an earlier client needs to report on. Cancellation is observed after the key's two filesystem reads, so a warm hit cannot hide an abort.5 files (2 production, 3 test). Related: #3449, whose Xcode-too-old reports should name the toolchain a decision actually read; not implemented here.
Cost of the new key resolution
Measured at
b3f7e6562here over 20 reads each, warm memo:realpathof/var/db/xcode_select_linkstatSyncof the bundle version filexcode-select -pspawn (the fallback only)computeRunnerSourceFingerprint(same call, already unbounded sync fs)resolveExpectedRunnerCacheMetadata, warmA warm read spawns nothing, which is also what makes renewal affordable: the key costs 1.9% of the call it belongs to, and the
xcode-select -pit replaces on that path costs two orders of magnitude more than the two reads that replaced it.Validation
pnpm check:affected --run --head d33b8049e→passed,exactCommit: true,checkoutChanged: false, receipt.tmp/validation/run-O0GjyD/receipt.json. Coverage, swift-runner and replay lanes are GitHub-authoritative and not claimed here.Rebased onto
4c1c78696;git range-diff 40b16020b..b3f7e6562 4c1c78696..d33b8049eshows all seven commits unchanged, so the evidence below keeps its original SHA attribution. Upstream touched none of the five files this PR changes.pnpm exec vitest run --project apple-runner <probe+metadata suites>:4c1c78696d33b8049eMutations, each planted in the source at
b3f7e6562(content-identical here) and measured against that suite in this checkout: keying on the dir as named instead of itsrealpath(20 failures), dropping the selection-link read (5), probingxcode-selectbefore reading the link (5), dropping the bundle identity from the key (2), removing TTL renewal (1), removing the cancellation check after the key reads (1), sending the failure report back throughrealpath(1), collapsing client answers into one slot (1), and keying a client'sDEVELOPER_DIRunresolved (1).All
Smoke Testslanes pass atd33b8049e— iOS run, plus Linux, Android and macOS, and every other check at the head is green. This is the lane that reaches the changed route on real toolchain state: the job's ownprepare ios-runnerreturned"cache": "exact"with"buildMs": 0(the toolchain fingerprint resolved and matched a cached build), then"connectMs": 3387and"healthCheckMs": 20064against a live runner reporting"currentUptimeMs": 1653725— so a runner process was up in the simulator, and01-settings.adreplayedopen/appstate/clickwith a runner session prewarmed ("runnerPrewarmKind":"session", 29.3 s). The key came from the host's default selection:DEVELOPER_DIRappears in none of the step env dumps in that log, so the read goes through/var/db/xcode_select_link(falling back toxcode-select -p) exactly as in the fix, and the builds resolve to/Applications/Xcode_26.6.app. The earlier smoke failures were upstream —e24dc4568calledlinux.gapafter4db1b7d67removed the helper, which crashed the coverage declarations at import on every PR, and#3740fixed it.Live run
This host has one Xcode (
/Applications/Xcode-27.1.0.app) and no passwordless sudo, sosudo xcode-select -sis not available here — the two-Xcode switch is still open with @thymikee. Everything below runs the production route (resolveExpectedRunnerCacheMetadata→requireRunnerToolchainFingerprint) against the real root-owned/var/db/xcode_select_linkand realxcodebuild/xcrunoutput. A second toolchain is an APFS clone of the Xcode withProductBuildVersionedited, so the substitution is only in how the selection is moved, never in what the probes read. All three "after" transcripts were re-captured atb3f7e6562; each "before" is the same script at the head that lacked the fix.Warm, and unchanged on a repeated read (real host selection, no substitution at all):
The reviewer's xcodes case —
DEVELOPER_DIRnames one stable path and the symlink behind it is swapped for another working Xcode. "Before" is head3e61534, which you reviewed. TheDEVELOPER_DIRstring is identical before and after in both columns; only what the key uses differs.An in-place bundle replacement at an unchanged path, steady hits across the swap — this is what the bundle identity buys, and "before" is head
2953a77, which keyed on the dir alone:Each substitution is an honest limit: they move the selection through a symlink or replace the bundle marker, not through
sudo xcode-select -s, so the root-owned link itself is exercised only by unit tests against a scripted link plus the fact that the read is the samerealpath. A two-Xcode host with sudo would close that end to end.Review threads
All seven Cubic threads are resolved and answered: the report pointer on a hit, the "throw or skip" and two overstated comments, renewal against an in-place bundle replacement (
r4297381441), the fs-bound reasoning onr4297381453, the missing-dir wording, and per-client retention of the reported answer (r4297748734).🤖 Generated with Claude Code