Skip to content

Fix false duplicate detection for multiple declared built-in pluginss#2799

Merged
Lagoja merged 1 commit intomainfrom
jl/test-plugin-hash-fix
Mar 25, 2026
Merged

Fix false duplicate detection for multiple declared built-in pluginss#2799
Lagoja merged 1 commit intomainfrom
jl/test-plugin-hash-fix

Conversation

@Lagoja
Copy link
Collaborator

@Lagoja Lagoja commented Mar 24, 2026

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.

@Lagoja Lagoja requested review from mikeland73 and mohsenari and removed request for mikeland73 March 25, 2026 00:30
@Lagoja Lagoja merged commit 540b82c into main Mar 25, 2026
25 checks passed
@Lagoja Lagoja deleted the jl/test-plugin-hash-fix branch March 25, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Cannot explicitly add multiple built-in plugins

2 participants