Skip to content

Commit 6fc6723

Browse files
committed
Merge FEATURE-ci-windows-stage-fixture: Correct native MSYS fixture handoffs
2 parents 337f616 + b4c2a94 commit 6fc6723

2 files changed

Lines changed: 85 additions & 5 deletions

File tree

‎scripts/test-v3-stage-install.py‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""Exercise configured staging recipes and real Automake/libtool installation."""
33
import os
44
from pathlib import Path
5+
import platform
56
import shlex
67
import shutil
78
import subprocess
@@ -23,6 +24,13 @@ def setUpClass(cls):
2324
cls.build = Path(cls.temporary.name).resolve()
2425
cls.environment = {key: value for key, value in os.environ.items()
2526
if key not in ('MAKEFLAGS', 'MFLAGS', 'MAKELEVEL')}
27+
cls.shell = 'sh'
28+
if platform.system() == 'Windows':
29+
# Bypass Windows system-shell lookup and use the selected MSYS tools.
30+
shell = shutil.which('bash', path=cls.environment.get('PATH', ''))
31+
if not shell:
32+
raise RuntimeError('bash is unavailable on the selected PATH')
33+
cls.shell = str(Path(shell).resolve())
2634
for tool in ('install', 'ranlib'):
2735
boundary = cls.build / f'native-{tool}-boundary.sh'
2836
boundary.write_text(
@@ -33,12 +41,12 @@ def setUpClass(cls):
3341
f' /*[a-zA-Z]:/*) echo "native {tool} rejects embedded drive: $destination" >&2; exit 1 ;;\n'
3442
'esac\n'
3543
f'printf "%s\\n" "$destination" >> {tool}-destinations.log\n'
36-
f'exec {shlex.quote(Path(shutil.which(tool)).as_posix())} "$@"\n')
44+
f'exec {shlex.quote(cls.shell_path(Path(shutil.which(tool))))} "$@"\n')
3745
boundary.chmod(0o755)
3846
result = subprocess.run(
39-
['sh', (SOURCE / 'configure').as_posix(), '--disable-v3-tls',
47+
[cls.shell, cls.shell_path(SOURCE / 'configure'), '--disable-v3-tls',
4048
'--disable-examples', '--prefix=D:/ci/prefix',
41-
'RANLIB=' + (cls.build / 'native-ranlib-boundary.sh').as_posix()], cwd=cls.build,
49+
'RANLIB=' + cls.shell_path(cls.build / 'native-ranlib-boundary.sh')], cwd=cls.build,
4250
env=cls.environment, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
4351
if result.returncode:
4452
raise RuntimeError(result.stdout)
@@ -53,12 +61,21 @@ def setUpClass(cls):
5361
['--mode=compile'] + compiler + ['-c', 'stagefixture.cpp', '-o', 'stagefixture.lo'],
5462
['--mode=link'] + compiler + ['-o', 'libstagefixture.la', 'stagefixture.lo',
5563
'-rpath', '/stagefixture', '-no-undefined']]:
56-
result = subprocess.run(['sh', '../libtool', '--tag=CXX'] + arguments,
64+
result = subprocess.run([cls.shell, '../libtool', '--tag=CXX'] + arguments,
5765
cwd=cls.build / 'src', env=cls.environment, stdout=subprocess.PIPE,
5866
stderr=subprocess.STDOUT, text=True)
5967
if result.returncode:
6068
raise RuntimeError(result.stdout)
6169

70+
@classmethod
71+
def shell_path(cls, path):
72+
if platform.system() != 'Windows':
73+
return path.as_posix()
74+
# Autoconf's ':'-separated source search requires MSYS drive notation.
75+
return subprocess.check_output(
76+
[cls.shell, '-c', 'cygpath -u "$1"', 'stage-path', path.as_posix()],
77+
cwd=cls.build, env=cls.environment, text=True).strip()
78+
6279
def setUp(self):
6380
for name in ('.hygiene-stage', '.install-stage', '.shared-check-stage', 'missing-stage'):
6481
shutil.rmtree(self.build / name, ignore_errors=True)
@@ -70,7 +87,7 @@ def make(self, target, *variables, shared=False):
7087
# Only the fixture archive replaces the unrelated protocol engines.
7188
command = [MAKE, '--no-print-directory', target,
7289
'lib_LTLIBRARIES=libstagefixture.la', 'noinst_LTLIBRARIES=', 'noinst_PROGRAMS=',
73-
'INSTALL=' + self.installer.as_posix()]
90+
'INSTALL=' + self.shell_path(self.installer)]
7491
if shared:
7592
# Only check-local's staged-install body is under test here.
7693
text = (SOURCE / 'Makefile.am').read_text()
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# FEATURE-ci-windows-stage-fixture: execute the real staging fixture through MSYS
2+
3+
Status: Complete (local) — validated and finalized into v3; native Windows confirmation pending.
4+
Base: local `v3` at `337f6161be9897e590fa5155658582f3dca7cd34`.
5+
6+
Native Windows job `120582231736` fails the new staged-install fixture during
7+
configure setup, before any tests run. Bootstrap installed the auxiliary files;
8+
the fixture handed an unqualified shell a native drive-bearing source path.
9+
Autoconf splits auxiliary-file search directories on `:`, so configure needs an
10+
MSYS source path. The configured `D:/ci/prefix` remains the staging test subject.
11+
12+
Action items:
13+
14+
- [x] Read primary checkout CLAUDE.md/AGENTS.md, saved plan, literal journal,
15+
retained native failure log, complete fixture and existing production adapter.
16+
- [x] Create the Groundwork task worktree from exact local v3, preserving other work.
17+
- [x] Use the absolute PATH-selected bash on Windows for configure, path conversion
18+
and both real libtool invocations; fail if the selected PATH has no bash.
19+
- [x] Convert source-script and installer/ranlib executable handoffs with actual
20+
`cygpath -u` in the selected shell. Keep `--prefix=D:/ci/prefix` unchanged.
21+
- [x] Preserve all eight real configured Makefile/libtool/installed-header cases
22+
and all original negative assertions without skips or mock configure.
23+
- [x] Run the real eight-case local regression and source-bound executed boundary
24+
proof; check syntax, unchanged test bodies/production sources and diff whitespace.
25+
- [x] Caller: full required Groundwork validation and finalization into v3.
26+
- [x] Caller: composed conventions review of `c0cfdabc..final-task-HEAD` against
27+
primary checkout CLAUDE.md; carry other cleared profiles unless disturbed.
28+
- [ ] CI / v3 PR: fresh native Windows checkout/archive installed matrices.
29+
30+
Local evidence:
31+
32+
- Native RED: retained raw job log shows `cannot find required auxiliary files:
33+
compile ltmain.sh config.guess config.sub missing install-sh`, `Ran 0 tests`.
34+
- `./bootstrap` passes with existing .PHONY / AC_OUTPUT warnings.
35+
- `python3 scripts/test-v3-stage-install.py -v`: all 8 tests pass in 19.040s.
36+
- A bounded Linux counterfactual invokes actual configure through bash with a
37+
colon-bearing source alias and reproduces the auxiliary-file error. A controlled
38+
conversion-output boundary then executes the fixture's Windows branch, real
39+
configure, libtool compile/link, recursive installs and installed production
40+
header checks: all 8 cases pass in 18.199s. Recorded argv uses absolute
41+
`/usr/bin/bash`, the converted source alias and unchanged `--prefix=D:/ci/prefix`.
42+
Linux has no MSYS cygpath; only its output is controlled in this probe. This
43+
proves local argument handoff and real fixture behavior, not native Windows.
44+
- Python AST syntax, all eight original test-method ASTs and `git diff --check`
45+
pass. Production Makefile.am, src/Makefile.am and installed-consumer driver are
46+
byte-for-byte unchanged. CLAUDE.md documents C++ cpplint, which does not apply
47+
to this Python-only change; no Python lint command is documented.
48+
49+
The initial local boundary probe used a POSIX source alias containing spaces;
50+
configure rejected its unsafe srcdir. The corrected probe uses hyphenated source
51+
aliases and retains the failed setup log. No product change addressed that probe
52+
setup. Exact commands, source SHA-256 bindings, argv receipts, tool versions and
53+
limits are in the primary checkout's literal journal
54+
`.debug/ci-windows-stage-fixture-qf96yslm/journal.md` and `implementation/`.
55+
No full baseline, runtime/provider/dependency change, old platform diagnostic,
56+
CI retry/cancellation, validation loop, merge or publication ran. Native Windows
57+
checks remain incomplete and CI/v3-PR owned under AGENTS.md.
58+
59+
Groundwork validation passed at `929324c216ff713e5232773589d82dfddfb37af5`
60+
(1 iteration, 0 fixed, 0 unworked): seven fresh approvals plus justified spec and
61+
architecture carries cover all applicable profiles. The conventions approval
62+
covers all CI repair changes since c0 against primary checkout CLAUDE.md.
63+
Corrected native Windows execution remains incomplete and CI/v3-PR owned.

0 commit comments

Comments
 (0)