Commit 540b82c
authored
Fix false duplicate detection for multiple declared built-in pluginss (#2799)
## Summary
Fixes #2790, which prevents users from declaring multiple built-in
plugins:
When devbox computed a unique ID (hash) for a plugin like plugin:nodejs
or plugin:python, it tried to use the fully resolved package name. But
for built-in plugins added via include, the package isn’t resolved yet —
so that name is an empty string.
Two different plugins both hashing the empty string = same hash = devbox
thinks they’re duplicates and throws a “circular or duplicate include”
error.
The fix: if the resolved name is empty, use the raw string ("nodejs",
"python") instead. Different raw strings, different hashes, no false
collision. This change should not affect normal package resolution,
since Devbox already enforces that each entry of the packages array is
unique.
## How was it tested?
Added an additional test
(`TestLoadRecursiveMultipleBuiltinPluginIncludes`) which checks that we
can load 2 explicitly declared built-in plugins without issue.1 parent bbe7a31 commit 540b82c
2 files changed
+43
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| |||
0 commit comments