ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1022
    • Affects Version/s: None
    • Component/s: Bazel
    • None
    • Fully Compatible
    • Build OnDeck
    • None
    • None
    • None
    • None
    • None
    • None
    • None

        1. Summary

      Add back Windows support for the Copybara sync tooling and unit tests, so release
      managers can run `bazel run //buildscripts/copybara:generate_evergreen --config=local`
      and the Copybara unit tests from Windows.

      This restores what SERVER-132895 restricted to Linux and fixes the Windows issues
      that motivated it:

      • Remove `target_compatible_with = ["@platforms//os:linux"]` from the
        `generate_evergreen_check` (`buildscripts/copybara/BUILD.bazel`) and
        `test_sync_repo_with_copybara` (`buildscripts/tests/BUILD.bazel`) Bazel targets.
      • Remove the Linux-only `skipUnless` from the `CopybaraTestCase` base class in
        `buildscripts/tests/test_sync_repo_with_copybara.py`.
      • Fix cmd.exe-incompatible shell commands in the unit tests: multi-line `git commit -m`
        messages become separate `-m` flags (cmd.exe splits commands on newlines), and host
        paths in real git commands are quoted with `sync_repo_with_copybara.shell_quote()`
        so Windows temp directories with spaces work.
      • Write all generated Copybara files with `newline="\n"` so Windows runs produce LF
        line endings instead of CRLF diffs: `generate_evergreen.py` writes
        `etc/evergreen_yml_components/copybara/copybara_gen.yml`, `path_rules.py` writes
        `copybara_path_rules.bara.sky`, and `sync_repo_with_copybara.py` writes the fetched
        config bundle, assembled and rewritten `copy.bara.sky`, and synthetic fragments.
      • Document Windows support and the MSVC toolchain prerequisite in
        `buildscripts/copybara/README.md`.

      The Copybara unit tests continue to run in Evergreen only on the Linux copybara sync
      variants (`ubuntu2204-small`); they are not wired into any Windows CI build variant.

        1. Testing
      • `python -m unittest buildscripts.tests.test_sync_repo_with_copybara
        buildscripts.copybara.test_forbidden_text_check` pass locally on Linux.
      • `bazel test //buildscripts/copybara:generate_evergreen_check
        //buildscripts/tests:test_sync_repo_with_copybara` pass locally on Linux.
      • `python buildscripts/copybara/generate_evergreen.py --check` passes.

            Assignee:
            Daniel Moody
            Reporter:
            Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: