Fix false duplicate detection for multiple declared built-in pluginss#2799
Merged
Fix false duplicate detection for multiple declared built-in pluginss#2799
Conversation
…t-in plugin includes
mikeland73
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.