FAILURE MAP
← Case archive

FA-9171 / Build systems / Open access

Link command assembly: Search path arguments are collapsed · case 01

Search path arguments are collapsed.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation substitutes ['-L' + name] for ['-L', name], so search path arguments are collapsed.

VERIFIED REPAIR

Respect the model contract requiring separate search path arguments.

Unsuccessful approach: The attempted repair substitutes [name]. Fixture 2 still yields ['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '/lib a', '/lib b', '-o', 'my app'] instead of ['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app'].

Case contract

Emit object arguments first, then each archive in declared order preserving repeats, then frameworks as paired flags, then search directories as paired flags, then the output pair.

Why this case matters

An offline model of link command assembly, suitable for testing build and release tooling without external services.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(objects, archives, frameworks, directories, output):
    result = list(objects)
    result += list(archives)
    result += [part for name in frameworks for part in ['-framework', name]]
    result += [part for name in directories for part in ['-L' + name]]
    result += ['-o', output]
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], [], [], [], 'app'), ['-o', 'app'])
check('fixture 2', solve(['b.o', 'a.o'], ['x.a', 'y.a', 'x.a'], ['Core', 'UI'], ['/lib a', '/lib b'], 'my app'), ['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app'])
check('fixture 3', solve(['a.o'], ['b.a'], [], [], 'x'), ['a.o', 'b.a', '-o', 'x'])
check('fixture 4', solve([], [], ['Core'], [], 'x'), ['-framework', 'Core', '-o', 'x'])
check('fixture 5', solve([], [], [], ['space dir'], 'x'), ['-L', 'space dir', '-o', 'x'])
check('fixture 6', solve(['z.o'], [], ['A'], ['D'], 'z'), ['z.o', '-framework', 'A', '-L', 'D', '-o', 'z'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['-o', 'app']['-o', 'app']Passed
fixture 2['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L/lib a', '-L/lib b', '-o', 'my app']['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app']Failed
fixture 3['a.o', 'b.a', '-o', 'x']['a.o', 'b.a', '-o', 'x']Passed
fixture 4['-framework', 'Core', '-o', 'x']['-framework', 'Core', '-o', 'x']Passed
fixture 5['-Lspace dir', '-o', 'x']['-L', 'space dir', '-o', 'x']Failed
fixture 6['z.o', '-framework', 'A', '-LD', '-o', 'z']['z.o', '-framework', 'A', '-L', 'D', '-o', 'z']Failed

SHA-256 / 027cea680383d9686441f36ecd1a956f283f8b18f421223eceda31cc76717832

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(objects, archives, frameworks, directories, output):
    result = list(objects)
    result += list(archives)
    result += [part for name in frameworks for part in ['-framework', name]]
    result += [part for name in directories for part in [name]]
    result += ['-o', output]
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], [], [], [], 'app'), ['-o', 'app'])
check('fixture 2', solve(['b.o', 'a.o'], ['x.a', 'y.a', 'x.a'], ['Core', 'UI'], ['/lib a', '/lib b'], 'my app'), ['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app'])
check('fixture 3', solve(['a.o'], ['b.a'], [], [], 'x'), ['a.o', 'b.a', '-o', 'x'])
check('fixture 4', solve([], [], ['Core'], [], 'x'), ['-framework', 'Core', '-o', 'x'])
check('fixture 5', solve([], [], [], ['space dir'], 'x'), ['-L', 'space dir', '-o', 'x'])
check('fixture 6', solve(['z.o'], [], ['A'], ['D'], 'z'), ['z.o', '-framework', 'A', '-L', 'D', '-o', 'z'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['-o', 'app']['-o', 'app']Passed
fixture 2['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '/lib a', '/lib b', '-o', 'my app']['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app']Failed
fixture 3['a.o', 'b.a', '-o', 'x']['a.o', 'b.a', '-o', 'x']Passed
fixture 4['-framework', 'Core', '-o', 'x']['-framework', 'Core', '-o', 'x']Passed
fixture 5['space dir', '-o', 'x']['-L', 'space dir', '-o', 'x']Failed
fixture 6['z.o', '-framework', 'A', 'D', '-o', 'z']['z.o', '-framework', 'A', '-L', 'D', '-o', 'z']Failed

SHA-256 / 1752d25e50f2b127c2687b75d5ee037e03ba040b3961a03346c1efdb5c56dbd9

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(objects, archives, frameworks, directories, output):
    result = list(objects)
    result += list(archives)
    result += [part for name in frameworks for part in ['-framework', name]]
    result += [part for name in directories for part in ['-L', name]]
    result += ['-o', output]
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], [], [], [], 'app'), ['-o', 'app'])
check('fixture 2', solve(['b.o', 'a.o'], ['x.a', 'y.a', 'x.a'], ['Core', 'UI'], ['/lib a', '/lib b'], 'my app'), ['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app'])
check('fixture 3', solve(['a.o'], ['b.a'], [], [], 'x'), ['a.o', 'b.a', '-o', 'x'])
check('fixture 4', solve([], [], ['Core'], [], 'x'), ['-framework', 'Core', '-o', 'x'])
check('fixture 5', solve([], [], [], ['space dir'], 'x'), ['-L', 'space dir', '-o', 'x'])
check('fixture 6', solve(['z.o'], [], ['A'], ['D'], 'z'), ['z.o', '-framework', 'A', '-L', 'D', '-o', 'z'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['-o', 'app']['-o', 'app']Passed
fixture 2['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app']['b.o', 'a.o', 'x.a', 'y.a', 'x.a', '-framework', 'Core', '-framework', 'UI', '-L', '/lib a', '-L', '/lib b', '-o', 'my app']Passed
fixture 3['a.o', 'b.a', '-o', 'x']['a.o', 'b.a', '-o', 'x']Passed
fixture 4['-framework', 'Core', '-o', 'x']['-framework', 'Core', '-o', 'x']Passed
fixture 5['-L', 'space dir', '-o', 'x']['-L', 'space dir', '-o', 'x']Passed
fixture 6['z.o', '-framework', 'A', '-L', 'D', '-o', 'z']['z.o', '-framework', 'A', '-L', 'D', '-o', 'z']Passed

SHA-256 / 869b197b8f76034181fdc3150a3c5c2f072c8a769c951c1ac0b5afb977224fc5

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:27.688371+00:00.

Case digest / 2ffa43a1c2db78fd21b4063404672cfcad792b5a2c9b769b58152c7741394d06