dlang / dub

Package and build management system for D
MIT License
673 stars 230 forks source link

dub test fails with "Error: unable to read module `has`" #2970

Open LunaTheFoxgirl opened 2 days ago

LunaTheFoxgirl commented 2 days ago

System information

Bug Description

When attempting to run the unittests for numem, which uses silly. I get an error about has not existing. There is no such module in any of my code.

How to reproduce?

Clone https://github.com/Inochi2D/numem, and run dub test

Expected Behavior

Unit tests run.

Logs

    Fetching silly 1.1.1 (getting selected version)
             Generating test runner configuration 'numem-test-unittest' for 'unittest' (library).
    Starting Performing "unittest" build using /opt/hostedtoolcache/dc/ldc2-1.39.0/x64/ldc2-1.39.0-linux-x86_64/bin/ldc2 for x86_64.
    Building numem ~main: building configuration [numem-test-unittest]
../../../.dub/cache/numem/~main/code/numem-test-unittest-unittest-d0ov_3u780tPX-97nrtTZQ/dub_test_root.d(28,15): Error: unable to read module `has`
../../../.dub/cache/numem/~main/code/numem-test-unittest-unittest-d0ov_3u780tPX-97nrtTZQ/dub_test_root.d(28,15):        Expected 'has.d' or 'has/package.d' in one of the following import paths:
import path[0] = source/
import path[1] = ../../../.dub/cache/numem/~main/code/numem-test-unittest-unittest-d0ov_3u780tPX-97nrtTZQ
import path[2] = ../../../.dub/packages/silly/1.1.1/silly
import path[3] = /opt/hostedtoolcache/dc/ldc2-1.39.0/x64/ldc2-1.39.0-linux-x86_64/bin/../import
Error /opt/hostedtoolcache/dc/ldc2-1.39.0/x64/ldc2-1.39.0-linux-x86_64/bin/ldc2 failed with exit code 1.
Geod24 commented 1 day ago

Most likely a bug in https://github.com/dlang/dub/blob/a1d23d0773874939bc7c5c5209fd925288abe9ab/source/dub/internal/utils.d#L549-L597