INNER CODE UNIT · Python

describe_text_mismatch

uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:547

def describe_text_mismatch(make_root, bazel_root, path):
    """Summarise *how* two text files differ, so a CI log is enough to diagnose.

    Printing only the path leaves the reader unable to tell a line-ending
    difference from a content one without reproducing the build, which on
    Windows means a multi-hour job.
    """
    make_bytes = (make_root / path).read_bytes()
    bazel_bytes = (bazel_root / path).read_bytes()
    make_eol = line_ending_counts(make_bytes)
    bazel_eol = line_ending_counts(bazel_bytes)
    detail = f"Make={len(make_bytes)}B Bazel={len(bazel_bytes)}B"
    if make_eol != bazel_eol:
        detail += (
            " EOL Make(crlf={},lf={},cr={}) Bazel(crlf={},lf={},cr={})"
            .format(*make_eol, *bazel_eol)
        )
    # Same text once endings are normalised means the endings are the only

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…