Skip to content

Commit 61a4647

Browse files
committed
FEATURE-ci-darwin-focused-diagnostics: isolate native debugger loader environment
Keep compiler, inspection and Apple LLDB on the host loader environment while passing complete selected build/install, provider and LLVM library paths only to each inferior. Record inferior environment separately and contain runtime tracing there. Six focused real-subprocess workflow boundary probes pass after failing on the original setup. Actionlint, five shell syntax checks, embedded Python syntax and diff checks pass. Native execution remains pending; the first attempt executed none of the six selected programs.
1 parent 8f97226 commit 61a4647

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
(root / 'receipt.json').write_text(json.dumps(receipt, indent=2) + '\n')
9494
9595
96+
def host_environment(env):
97+
# Apple tools must not load the selected test runtime or inherit its tracing.
98+
return {key: value for key, value in env.items() if key not in
99+
('DYLD_LIBRARY_PATH', 'LHS_DARWIN_HEADER_TRACE', 'LHS_DARWIN_STORAGE_TRACE')}
100+
101+
96102
def command(argv, cwd, env, timeout=1200, required=True):
97103
row = dict(argv=[str(arg) for arg in argv], cwd=str(cwd), timeout_seconds=timeout,
98104
environment={key: env.get(key) for key in ('CC', 'CXX', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS', 'SDKROOT',
@@ -167,10 +173,11 @@ jobs:
167173
inferior_environment.append('LHS_DARWIN_STORAGE_TRACE=1')
168174
if env.get('LHS_DARWIN_HEADER_TRACE'):
169175
inferior_environment.append('LHS_DARWIN_HEADER_TRACE=1')
176+
case['inferior_environment'] = dict(entry.split('=', 1) for entry in inferior_environment)
170177
commands.write_text('settings set target.disable-aslr false\nsettings set target.env-vars ' +
171178
shlex.join(inferior_environment) + '\nscript exec(compile(open(' +
172179
repr(str(debug_script)) + ').read(), ' + repr(str(debug_script)) + ", 'exec'))\n")
173-
launch_env = dict(env, LHS_DEBUG_RESULT=str(result_path), LHS_DEBUG_CWD=str(cwd))
180+
launch_env = dict(host_environment(env), LHS_DEBUG_RESULT=str(result_path), LHS_DEBUG_CWD=str(cwd))
174181
# xcrun supplies native Apple LLDB/debugserver; the inferior is the real
175182
# selected test binary, with no rerun after an assertion, abort or timeout.
176183
row = command(['xcrun', 'lldb', '--batch', '--source', str(commands), '--', str(executable)],
@@ -184,11 +191,11 @@ jobs:
184191
save()
185192
186193
187-
base_env = dict(os.environ, CC=os.environ['V3_CC'], CXX=os.environ['V3_CXX'], MAKE='gmake',
194+
base_env = dict(host_environment(os.environ), CC=os.environ['V3_CC'], CXX=os.environ['V3_CXX'], MAKE='gmake',
188195
PKG_CONFIG_PATH='', CXXFLAGS='-O0 -g -DLHS_DARWIN_FOCUSED_DIAGNOSTICS')
189196
provider = root / 'prerequisites/provider'
190197
base_env['LDFLAGS'] = '-Wl,-rpath,' + str(provider / 'lib')
191-
base_env['DYLD_LIBRARY_PATH'] = os.pathsep.join([str(provider / 'lib'), os.environ['V3_PACKAGE_TOOLCHAIN'] + '/lib/c++'])
198+
inferior_library_path = os.pathsep.join([str(provider / 'lib'), os.environ['V3_PACKAGE_TOOLCHAIN'] + '/lib/c++'])
192199
try:
193200
save()
194201
if platform.system() != 'Darwin' or os.geteuid() != 0:
@@ -206,7 +213,7 @@ jobs:
206213
env = dict(base_env)
207214
if mode == 'yes':
208215
env.update(V3_TLS_CFLAGS='-I' + str(provider / 'include'),
209-
V3_TLS_LIBS='-L' + str(provider / 'lib') + ' -lssl -lcrypto', LHS_DARWIN_HEADER_TRACE='1')
216+
V3_TLS_LIBS='-L' + str(provider / 'lib') + ' -lssl -lcrypto')
210217
try:
211218
command(['bash', str(source / 'configure'), '--enable-v3-tls=' + mode,
212219
'--disable-examples', '--prefix=' + str(prefix)], build, env)
@@ -224,7 +231,7 @@ jobs:
224231
binary = build / 'test/.libs' / name
225232
if not binary.is_file():
226233
binary = build / 'test' / name
227-
case_env = dict(env, DYLD_LIBRARY_PATH=os.pathsep.join([str(build / 'src/.libs'), env['DYLD_LIBRARY_PATH']]))
234+
case_env = dict(env, DYLD_LIBRARY_PATH=os.pathsep.join([str(build / 'src/.libs'), inferior_library_path]))
228235
if name in ('resource_limits', 'http1_response_outbox'):
229236
case_env['LHS_DARWIN_STORAGE_TRACE'] = '1'
230237
receipt['cases'][name].update(tls='no', linkage='native-target-declared', source_context='git-archive')
@@ -240,10 +247,11 @@ jobs:
240247
[str(prefix / 'lib/libhttpserver.dylib'), '-pthread', '-Wl,-rpath,' + str(prefix / 'lib'),
241248
'-Wl,-map,' + str(binary) + '.map', '-MMD', '-o', str(binary)], consumer, env)
242249
command(['otool', '-L', str(prefix / 'lib/libhttpserver.dylib')], build, env, timeout=30)
243-
case_env = dict(env, DYLD_LIBRARY_PATH=os.pathsep.join([str(prefix / 'lib'), env['DYLD_LIBRARY_PATH']]))
250+
case_env = dict(env, DYLD_LIBRARY_PATH=os.pathsep.join([str(prefix / 'lib'), inferior_library_path]),
251+
LHS_DARWIN_HEADER_TRACE='1')
244252
receipt['cases'][name].update(tls='yes', linkage='installed-shared', source_context='git-archive-private-integration-headers')
245-
command(['file', str(binary)], build, case_env, timeout=30)
246-
command(['otool', '-L', str(binary)], build, case_env, timeout=30)
253+
command(['file', str(binary)], build, env, timeout=30)
254+
command(['otool', '-L', str(binary)], build, env, timeout=30)
247255
run_case(name, binary, build / 'test' if mode == 'no' else source / 'test', case_env)
248256
except Exception as error:
249257
receipt['cases'][name].update(status='incomplete', error=str(error))

‎specs/tasks/FEATURE-ci-darwin-focused-diagnostics.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FEATURE-ci-darwin-focused-diagnostics
22

3-
Status: In Progress — local diagnostic validation passed; the one native batch remains pending.
3+
Status: In Progress — first native attempt failed in launcher setup before all six programs; local environment correction passed focused checks and awaits caller review.
44

55
Base: local `v3` at `a5a72356741300e5da16b94090f0f26a67a2d1f7`.
66
Branch: `task/FEATURE-ci-darwin-focused-diagnostics`.
@@ -15,10 +15,12 @@ This is temporary diagnostic instrumentation. This branch, including its tempora
1515
- [x] Prepare manual-only, read-only native Darwin batch under existing default-branch dispatch-capable `release.yml` filename. The required `tag` is a fixed diagnostic sentinel; it never selects a ref, creates a tag or publishes anything.
1616
- [x] Compile syntax, diagnostic logger smoke checks, workflow/embedded Python/shell syntax, actionlint, changed-file cpplint and diff checks locally; no native tests or full suites in this phase.
1717
- [x] Caller independently validates the diagnostic diff and reviews the workflow before publishing this branch only.
18-
- [ ] Caller dispatches the command below ONCE and retains source-bound receipt, raw logs and LLDB abort frames.
18+
- [x] Caller dispatched the first attempt and retained its source-bound failed setup receipt and raw logs; all six selected programs remain not-executed.
19+
- [x] Correct the workflow host/debugger versus inferior environment boundary and verify it with real local subprocess checks, syntax and actionlint.
20+
- [ ] Caller reviews the narrow setup delta before publishing the correction and continuing the same authorized six-program batch.
1921
- [ ] Caller records actual native results, context differences and causal assessment without reopening closed probes.
2022

21-
Proposed single dispatch after caller review/publication:
23+
Corrected continuation after caller delta review/publication (no selected program execution budget was consumed):
2224

2325
```bash
2426
gh workflow run release.yml --ref task/FEATURE-ci-darwin-focused-diagnostics -f tag=darwin-focused-once-a5a72356
@@ -40,4 +42,10 @@ Groundwork validation `2c3b204286112d4867f6fe7d78b1920e` sealed PASS for
4042
implementation HEAD `6d69f85ab44595a6a25626cd31707327e7e8d2de`: one
4143
iteration, nine independent domain approvals, zero fixes, one unworked finding
4244
persisted by the helper. The helper report is retained without caller reading it.
43-
Native execution is pending; this is diagnostic readiness, not a CI-green claim.
45+
This sealed validation is historical diagnostic readiness; it does not establish successful native setup or execution.
46+
47+
First native attempt `40052229400`, job `120747190075`, source `8f9722656397961dc9b5d1af360552541a6ff398`, failed before bootstrap/build: `xcrun lldb --version` exited `-6` under the workflow's global provider/Homebrew LLVM `DYLD_LIBRARY_PATH`. The retained log reports missing Apple libc++abi symbols, a pure virtual call and mutex fatal error. Artifact `12544022476` SHA-256 `269c9db7bb48f58be881c5aa700cfc74c73605b48969d1334730f3fae82ea31d` was verified; its original receipt remains unchanged at the journal's `first-native-evidence/receipt.json`. All six cases are `not-executed`; no C++ result or cause was established.
48+
49+
The correction removes inferior-only loader/tracing variables from host compiler/build/inspection/debugger environments. It retains the existing selected compiler wrapper and provider linker rpath, and passes the complete build-or-installed-prefix, provider and selected toolchain library path explicitly through LLDB `target.env-vars`. Header/storage tracing stays in the relevant inferior environment. Each case records that target environment separately from the debugger command environment. No C++ instrumentation, test assertion, timeout or runtime decision changed.
50+
51+
Focused proof lives in the primary journal's `setup-repair/test_environment_boundary.py`: the original workflow failed the boundary assertions; all six tests pass against the correction. Tests execute the actual embedded workflow environment construction, `run_case`, generated LLDB settings, inspection call sites and command logging/monitoring with real local Python child processes. Only unavailable `xcrun`/inspection executable argv are adapted to the local environment reporter; there is no simulated LLDB result, Darwin execution, selected program launch or native success claim. They verify clean host/debugger environments, both complete inferior library paths, trace isolation, selected compiler/provider flags and no mutation back into build/metadata environments. All five shell steps and both embedded Python scripts parse; actionlint 1.7.7 and diff whitespace checks pass. Native setup/compile/execution remain unverified locally and require the caller's corrected native continuation after delta review. No full suites, native execution, publication, dispatch, merge or cleanup were performed during this repair.

0 commit comments

Comments
 (0)