Summary
When projects depend on unit-threaded (e.g. transitively via dlangui), dub upgrade and dub build emit warnings:
Warning Sub package unit-threaded:exception, referenced by unit-threaded:assertions dub.package_.Package must be referenced using the path to its base package
Warning Sub package unit-threaded:from, referenced by unit-threaded:exception dub.package_.Package must be referenced using the path to its base package
...
DUB expects sub-package references to use the path to the dependency's directory rather than the packagename:subpackage form with a path to the root.
Minimal reproduction
- Create a project that depends on a package pulling in unit-threaded (e.g. dlangui).
- Run
dub upgrade or dub build.
Expected
No DUB sub-package warnings.
Actual
Multiple warnings like:
Warning Sub package unit-threaded:exception, referenced by unit-threaded:assertions dub.package_.Package must be referenced using the path to its base package
Proposed fix
Change each sub-package's dub.sdl to use direct path references to sibling sub-packages:
| From |
To |
dependency "unit-threaded:from" path="../.." |
dependency "from" path="../from" |
dependency "unit-threaded:exception" path="../.." |
dependency "exception" path="../exception" |
dependency "unit-threaded:assertions" path="../.." |
dependency "assertions" path="../assertions" |
dependency "unit-threaded:runner" path="../.." |
dependency "runner" path="../runner" |
(And similarly for mocks, property, integration, autorunner, behave.)
This eliminates all warnings. dub build and dub test continue to work as before.
Environment
- DUB 1.41.0 (and likely earlier)
- Windows 11 / PowerShell 7
- unit-threaded 0.7.55 (transitive dependency)
Summary
When projects depend on unit-threaded (e.g. transitively via dlangui),
dub upgradeanddub buildemit warnings:DUB expects sub-package references to use the path to the dependency's directory rather than the
packagename:subpackageform with a path to the root.Minimal reproduction
dub upgradeordub build.Expected
No DUB sub-package warnings.
Actual
Multiple warnings like:
Proposed fix
Change each sub-package's
dub.sdlto use direct path references to sibling sub-packages:dependency "unit-threaded:from" path="../.."dependency "from" path="../from"dependency "unit-threaded:exception" path="../.."dependency "exception" path="../exception"dependency "unit-threaded:assertions" path="../.."dependency "assertions" path="../assertions"dependency "unit-threaded:runner" path="../.."dependency "runner" path="../runner"(And similarly for mocks, property, integration, autorunner, behave.)
This eliminates all warnings.
dub buildanddub testcontinue to work as before.Environment