)]}'
{
  "commit": "b1fb23bc41b451aece46f8d24f09e63b312388bb",
  "tree": "97c040d39f00cad666cd24c57ec9a8df98720ccd",
  "parents": [
    "f7751e43022a5ee5844a8b7932e21d43973182f2"
  ],
  "author": {
    "name": "Gleb Kolobkov",
    "email": "gkolobkov@nvidia.com",
    "time": "Tue Jun 30 18:00:59 2026 -0700"
  },
  "committer": {
    "name": "Richard Levasseur",
    "email": "richardlev@gmail.com",
    "time": "Wed Jul 01 23:46:28 2026 +0000"
  },
  "message": "fix: avoid stage1 bootstrap stdlib shadowing (#3854)\n\nThe stage 1 system-python bootstrap imports standard-library modules\nbefore it\nre-execs into the configured runtime. If the target output directory\ncontains\nfiles named like standard-library modules, such as `shutil.py` or\n`types.py`,\nthe bootstrap can import those files instead and fail before user code\nstarts.\n\nThis change removes Python\u0027s unsafe script-directory prepend before\nthose early\nimports, while preserving `sys.path[0]` when Python has already\nsuppressed that\nprepend through `-P`/`PYTHONSAFEPATH` or isolated mode. Stage 2 now uses\nthe same\nisolated-mode guard when removing or recreating the main-directory path.\n\nIt also pins the Windows venv entry point template to LF line endings so\nthe\ncompile-pip CI dirty-worktree check is stable across checkout settings.\n\nBefore this change, a generated target output could shadow bootstrap\nstdlib\nimports, and isolated-mode runs on older Python versions could lose a\nrequired\nstdlib path.\n\nAfter this change, bootstrap stdlib imports resolve from the\ninterpreter\u0027s\nstandard library, isolated mode preserves the interpreter-provided path,\nand the\nline-ending-sensitive CI check stays clean.\n\nTests:\n\n```shell\nbazel test --config\u003dfast-tests \\\n  //tests/bootstrap_impls:stdlib_shadowing_system_python_test\n\nbazel test --config\u003dfast-tests \\\n  //tests/bootstrap_impls:stdlib_shadowing_system_python_test \\\n  //tests/bootstrap_impls:interpreter_args_test \\\n  //tests/bootstrap_impls:sys_path_order_bootstrap_script_test\n```\n\n(cherry picked from commit fbb2ccf4ca4ac5d43f2e4181469b04dc14cfb092)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "79d2dfbc30a903f880f8a67d4f9a1bc2da5114d5",
      "old_mode": 33188,
      "old_path": ".bazelci/presubmit.yml",
      "new_id": "b3e308c7c7adc5471715523145ce86c5a6ac5ba4",
      "new_mode": 33188,
      "new_path": ".bazelci/presubmit.yml"
    },
    {
      "type": "modify",
      "old_id": "bcb6c6ddee1c9a1f0de04f68551ef8ece22c6813",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "6506c8d608ae8dd2f8ff2ed1cb146d8c6ee34ed7",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "38c93ec5b597f01c48d3cfecf609a5af3a6c4055",
      "old_mode": 33188,
      "old_path": "python/private/python_bootstrap_template.txt",
      "new_id": "482918c03844d78009bf0b03ce0e8aa59fdeaff2",
      "new_mode": 33188,
      "new_path": "python/private/python_bootstrap_template.txt"
    },
    {
      "type": "modify",
      "old_id": "b11fc760932b05fcda9356ad125c4b85e8867b3f",
      "old_mode": 33188,
      "old_path": "python/private/stage2_bootstrap_template.py",
      "new_id": "f445ad2b6a70db0f1d38a823d8dfd3ae78efa12e",
      "new_mode": 33188,
      "new_path": "python/private/stage2_bootstrap_template.py"
    },
    {
      "type": "modify",
      "old_id": "ab3148db00b768f20f0376b7afed3ec6b024c038",
      "old_mode": 33188,
      "old_path": "tests/bootstrap_impls/BUILD.bazel",
      "new_id": "89cd682a6acb0309b6d7ebe4cea1ea43c63fef9d",
      "new_mode": 33188,
      "new_path": "tests/bootstrap_impls/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "fc913857db02e3a55097321b660f692f5435ff61",
      "new_mode": 33188,
      "new_path": "tests/bootstrap_impls/stdlib_shadowing_test.py"
    }
  ]
}
