Repository navigation
Commit ff506fe
Validate the plugin contract before rewriting anything
A plugin whose SUBSTITUTIONS is not a mapping passed through unnoticed:
`key in substitutions` is a substring test on a string and a membership test on
any container, so nothing matched and the build emitted the unmodified CUDA
lists into a ROCm wheel, at exit 0. Injecting SUBSTITUTIONS = "not a dict"
produced a requires.txt carrying cucim-cu12, cucim-cu13 and nvidia-ml-py
alongside the rocm requirement.
That is precisely the failure VendorPluginError exists to prevent. It only
covered plugins that fail to import, not plugins that import cleanly and are
then malformed.
_load now checks the contract after importing -- SUBSTITUTIONS is a Mapping,
extras_for and extra_requirements are callable -- and raises VendorPluginError
otherwise. All four injected faults (SyntaxError, raise at import, raise while
computing the requirement, malformed table) now fail the ROCm build while CPU
and NVIDIA metadata stay byte-identical to dev.
Signed-off-by: Prateek Chokse <prateek.chokse@amd.com>
Co-authored-by: Vikas C Sajjan <Vikas.CSajjan@amd.com>
Co-authored-by: Soumitra Chatterjee <Soumitra.Chatterjee@amd.com>
Co-authored-by: Nilaykumar K Patel <NilaykumarKantibhai.Patel@amd.com>
Co-authored-by: Anik Chaudhuri <Anik.Chaudhuri@amd.com>1 parent 732a952 commit ff506fe
2 files changed
Lines changed: 49 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
217 | 231 | | |
218 | 232 | | |
219 | 233 | | |
220 | | - | |
| 234 | + | |
221 | 235 | | |
222 | 236 | | |
| 237 | + | |
| 238 | + | |
223 | 239 | | |
224 | 240 | | |
225 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
| |||
0 commit comments