Skip to content

Handle mixed Windows path separators in FreeBSD link-plan regression assertions #504

Closed

Description

@LunaStev

Problem and evidence

The Build Windows GNU amd64 job in #502 reports 56 codegen tests passed and one failed: freebsd_link_plans_use_target_sysroot_and_elf_loader.

Failing test log

The emitted plan contains the expected FreeBSD loader and CRT files, but a CRT argument has mixed separators, for example:

D:\...\sysroot\usr/lib\crt1.o

At e204bbebbbede0086fbb670d43a65b9cf38f0231, json_contains_path_components in tests/codegen_regressions.rs:364 only tries all-forward-slash and all-backslash spellings. Neither matches this mixed path after JSON escaping. The assertion fails at line 3166. Reapplying that helper's matching rule to the actual CI JSON reproduces false locally.

Scope

Make path-component assertions work with valid host-produced mixed separators and JSON escaping. Prefer comparing decoded path arguments or normalizing separators in the helper over special-casing the FreeBSD test. Existing dependency-free utilities are sufficient; no new JSON dependency is needed.

Acceptance

  • Focused helper tests cover Unix, escaped Windows and mixed-separator paths.
  • A wrong CRT basename or wrong component sequence still fails; do not weaken the assertion to basename-only matching.
  • The full FreeBSD link-plan regression remains enabled on Windows and checks every target/mode.
  • Run cargo test --locked --test codegen_regressions json_path_matching --jobs 2 and the FreeBSD link-plan test; verify Windows CI.

This is a good first issue in the regression helper, not evidence that FreeBSD linker output needs changing. Distinct from #490, which concerns disabled LLVM backends.

Activity

  1. added
    bug
    good first issue
    needs testing
    cross-platform
    on Sep 7, 2026
  2. LunaStev commented on Sep 10, 2026

    @LunaStev
    MemberAuthor

    Reproduced again after unrelated CI blockers were repaired in PR #569, head 834368d33f2595dfb8db1ef48dc2cd9e6850dade.

    Windows GNU amd64 log

    freebsd_link_plans_use_target_sysroot_and_elf_loader fails at tests/codegen_regressions.rs:3412 in the CRT path-component assertion. The emitted JSON still contains mixed-separator paths with a sysroot\usr/lib\crt1.o shape. The dedicated json_path_matching_accepts_unix_and_escaped_windows_separators test passes in the same job, so its current coverage does not catch this actual mixed path.

    The job reports 62 passing and 2 failing codegen tests; the other failure is an independent MSVC plan assertion. No test was disabled. Please use the exact mixed-path JSON from this log as a regression fixture and retain full component-order checks. Implementation has been paused for today.

  3. added
    ci
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcicross-platformgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions