Fix false duplicate detection for multiple declared built-in pluginss by Lagoja · Pull Request #2799 · jetify-com/devbox

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.