-
- Summary
SERVER-132885slowed install targets after a shared convenience-tree race was found. This branch keeps publication race-safe while consolidating each `mongo_install_rule` into one install action, validating destination ownership during analysis, and avoiding unnecessary large-file copies.
- Summary
-
- Changes
- `bazel/install_rules/install_rules.bzl`: normalize destinations, assign unique owners, reject exact/prefix/case-insensitive overlaps during analysis, and avoid republishing child install trees from aggregate targets.
- `bazel/install_rules/install_rules.py`: materialize action outputs with hardlinks where safe, preserve stable Bazel output symlinks, stage shared destinations outside the lock, and publish them with transactional renames and rollback.
- `bazel/install_rules/README.md`: document the architecture and safety invariants.
- Added analysis and runtime coverage for collisions, deduplication, symlinks, cross-device fallback, failures, and concurrent publication.
-
- Timing
These are Bazel profile durations for the install action only; compile and analysis time are excluded.
- Timing
| Profile | Install action | Time |
| — | — | ---: |
| A: pre-hermetic container | `MongoInstallRule install-dist-test/bin/mongod` | 3.127 s |
| B: hermetic container change (community) | `MongoInstallRule install-dist-test/bin/mongod` | 7.283 s |
| B: hermetic container change (enterprise, critical path) | `MongoInstallRule src/mongo/db/modules/enterprise/install-dist-test/bin/mongoauditdecrypt` | 35.596 s |
| C: consolidated action before hardlinks | `MongoInstallRule install-dist-test/bin/mongod` | 86.893 s |
| C: consolidated action with hardlinks | `MongoInstallRule install-dist-test/bin/mongod` | 9.903 s |
The hardlink change reduces the comparable C install action by about 89%. A separate explicit shared-install-environment run measured 2.082 s, but the direct sandbox did not refresh the host convenience mount, so 9.903 s is the primary comparable C result.
-
- Safety
Exact, prefix, and case-insensitive destination conflicts fail during analysis. Stable output symlinks are hardlinked without dereferencing; unsafe source or sandbox-local symlinks are copied so published trees cannot dangle. Shared publication holds the lock only for final renames and restores the previous destination if interrupted.
- Safety
-
- Testing
- `bazel --batch test --config=local //bazel/install_rules:install_rules_script_test` (16/16 passing).
- `bazel --batch run lint – //bazel/install_rules:install_rules_script_test` (passing targeted rules-lint, Pyright, and ESLint checks).
- `bazel run format` and `git diff --check` pass.
- Required Evergreen patch: https://spruce.corp.mongodb.com/version/6a7eb26c19db910007db09a7
- is related to
-
SERVER-132885 Add hermetic container support for Bazel builds
-
- Closed
-