Commit 31d8c8a
authored
Fix NoneType exception for interface dependencies. (#3563)
Before this change any dependency with `CcInfo` which did not contain
static or dynamic libraries (e.g. an interface library which has it's
own fields for storing the underlying files) would result in the
following error:
```
ERROR: /Users/user/Code/rules_rust/test/unit/cc_info/BUILD.bazel:4:19: in rust_shared_library rule //test/unit/cc_info:rust_dylib_with_interface_lib_dep:
Traceback (most recent call last):
File "/Users/user/Code/rules_rust/rust/private/rust.bzl", line 126, column 32, in _rust_shared_library_impl
return _rust_library_common(ctx, "cdylib")
File "/Users/user/Code/rules_rust/rust/private/rust.bzl", line 190, column 32, in _rust_library_common
return rustc_compile_action(
File "/Users/user/Code/rules_rust/rust/private/rustc.bzl", line 1541, column 41, in rustc_compile_action
dynamic_libraries = ctx.runfiles(files = [
Error in runfiles: at index 0 of files, got element of type NoneType, want File
```
This pull request fixes this exception.1 parent 526b33d commit 31d8c8a
2 files changed
Lines changed: 131 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1552 | 1552 | | |
1553 | 1553 | | |
1554 | 1554 | | |
1555 | | - | |
| 1555 | + | |
1556 | 1556 | | |
1557 | 1557 | | |
1558 | 1558 | | |
| |||
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
1691 | 1699 | | |
1692 | 1700 | | |
1693 | 1701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 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 | + | |
| 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 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
118 | 180 | | |
119 | 181 | | |
120 | 182 | | |
| |||
136 | 198 | | |
137 | 199 | | |
138 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
139 | 217 | | |
140 | 218 | | |
141 | 219 | | |
| |||
185 | 263 | | |
186 | 264 | | |
187 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
188 | 280 | | |
189 | 281 | | |
190 | 282 | | |
191 | 283 | | |
192 | 284 | | |
193 | 285 | | |
194 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
195 | 301 | | |
196 | 302 | | |
197 | 303 | | |
| |||
220 | 326 | | |
221 | 327 | | |
222 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
223 | 341 | | |
224 | 342 | | |
225 | 343 | | |
| |||
239 | 357 | | |
240 | 358 | | |
241 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
242 | 363 | | |
243 | 364 | | |
0 commit comments