Commit 1603acd
committed
feat: implement full Bazel bzlmod parity features
This commit implements all major features needed for full parity with
Bazel's bzlmod implementation:
**Phase 1: Lockfile Support (P0)**
- Add lockfile/resolution.go with FromResolution() and Compare()
- Compute SHA256 hashes of MODULE.bazel files
- Track yanked versions in lockfile
- Add LockfileMode option (Off, Update, Error, Refresh)
**Phase 2: source.json Parsing (P1)**
- Add local_path source type to registry/types.go
- Add IsLocalPath() method to Source struct
- Add source_test.go with comprehensive tests
**Phase 3: Bazel Compatibility Validation (P1)**
- Add bazel_compat.go with constraint parsing
- Support >=, <=, <, >, - (exclusion) operators
- Add BazelCompatibilityMode option (Off, Warn, Error)
- Validate modules against configured Bazel version
**Phase 4: Vendor Directory Full Implementation (P2)**
- Add registry_vendor.go with vendor registry
- Synthesize metadata from directory structure
- Support local_path source.json for vendored modules
- Chain vendor registry before remote registries
**Phase 5: Registry Mirrors (P2)**
- Parse bazel_registry.json for mirror URLs
- Add fetchWithMirrors() with fallback logic
- Skip 404 errors but try mirrors for server errors
**Phase 6: max_compatibility_level Strategy Enumeration (P3)**
- Add computePossibleResolutionResultsForOneDepSpec()
- Add enumerateStrategies() for cartesian product
- Find all valid versions per DepSpec for MVS
**Phase 7: Multi-Round Nodep Discovery (P3)**
- Add NodepDependencies field to ModuleInfo
- Add IsNodepDep field to Dependency
- Track unfulfilled nodep edges across rounds
- Continue discovery until no new nodeps can be fulfilled
All tests pass. Reference: Bazel bzlmod implementation in
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/1 parent 64aae6c commit 1603acd
File tree
17 files changed
+3490
-149
lines changed- lockfile
- registry
- selection
17 files changed
+3490
-149
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
0 commit comments