Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious DUB "Unable to read module" error with bindbc dependency #474

Open
aubade opened this issue Apr 24, 2024 · 0 comments
Open

Spurious DUB "Unable to read module" error with bindbc dependency #474

aubade opened this issue Apr 24, 2024 · 0 comments

Comments

@aubade
Copy link

aubade commented Apr 24, 2024

When I create a project that depends on any bindbc project (This may apply to other dependencies but I have not tested them), it works fine except I get the following error in my "Problems" tab

app.d
- unable to read module 'sdl' DUB [ln 1, Col 8]
- app.d[Ln 1, Col 8]: Expected 'bindbc/sdl.d' or 'bindbc/sdl/package.d' in one of the following import paths:

code-d and serve-d report the following in the output tab:

serve-d standalone v0.8.0-beta.15
Included features: "d", "workspaces"
Built: Fri Apr 19 02:24:32 2024
with compiler LDC v2.107 on linux x86_64
dub, dfmt and dscanner are bundled within (compiled in)
2024-04-24T19:35:30.725 [info] extension.d:533:rootsForProject Root Suggestions: [RootSuggestion("/home/<redacted>/Devel/testcase", true)]
2024-04-24T19:35:30.725 [info] extension.d:564:doStartup registering instance for root RootSuggestion("/home/<redacted>/Devel/testcase", true)
2024-04-24T19:35:30.725 [info] extension.d:759:delayedProjectActivation Initializing instance for root RootSuggestion("/home/<redacted>/Devel/testcase", true)
2024-04-24T19:35:32.342 [info] extension.d:892:delayedProjectActivation Root RootSuggestion("/home/<redacted>/Devel/testcase", true) initialized in 1 sec, 616 ms, 637 μs, and 4 hnsecs
2024-04-24T19:35:32.350 [info] extension.d:997:startDCDServer Imports for /home/<redacted>/Devel/testcase: ["/home/<redacted>/.dub/packages/bindbc-common/0.1.5/bindbc-common/source/", "/home/<redacted>/.dub/packages/bindbc-loader/1.1.5/bindbc-loader/source/", "/home/<redacted>/.dub/packages/bindbc-sdl/1.4.7/bindbc-sdl/source/", "/home/<redacted>/.dub/packages/bindbc-common/0.1.5/bindbc-common/source/", "/home/<redacted>/.dub/packages/bindbc-loader/1.1.5/bindbc-loader/source/", "/home/<redacted>/Devel/testcase/source/", "/home/<redacted>/.dub/packages/bindbc-sdl/1.4.7/bindbc-sdl/source/", "/home/<redacted>/.dub/packages/bindbc-common/0.1.5/bindbc-common/source/", "/home/<redacted>/.dub/packages/bindbc-loader/1.1.5/bindbc-loader/source/"]
2024-04-24T19:35:38.286 [warning] first.d:377:visit Could not locate object.d or object.di
2024-04-24T19:35:38.286 [warning] first.d:474:visit Could not resolve location of module 'bindbc/sdl'
2024-04-24T19:35:38.286 [warning] first.d:474:visit Could not resolve location of module 'std/stdio'
2024-04-24T19:35:42.314 [warning] first.d:377:visit Could not locate object.d or object.di
2024-04-24T19:35:42.314 [warning] first.d:474:visit Could not resolve location of module 'bindbc/sdl'
2024-04-24T19:35:42.314 [warning] first.d:474:visit Could not resolve location of module 'std/stdio'

However, despite reporting this error, the import works fine. Dub is able to build the project perfectly well, and if I hilight the import at the top of the module and select "Go to definition" it goes to the appropriate file. Same for any bindbc symbols in the file itself.

enclosing a minimal testcase; all I did here is create a new dub project with bindbc-sdl as a dependency, and pasted some boilerplate initialization code from their documentation to show the library is working.

testcase.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant