Repository navigation
Conversation
An install put KGENCompilerRTShared.dll in lib/, along with every other shared library, because the default path is lib/ plus whatever the platform calls a shared library. Nothing on Windows can load a DLL from there. The compiler itself was fine, because it hands the loader an absolute path it read out of its own configuration. A program that mojo build produced has no configuration to read. It imports the DLL by name, and the Windows loader looks in the directory the program started from, then the system directories, then along PATH, and never in a sibling of the program's own directory. So the program died with 0xC0000135 and no message and the only fix a user had was to copy the file out of lib/ by hand. sharedLibPath now asks the name rather than the host: a .dll goes in bin/ and everything else stays in lib/. Import libraries are not affected and stay in lib/, since a linker reads those at a path it is handed and does not go looking. Verified on a Windows host against a staged install with nothing in lib/ but the import library and std.mojoc, and with MODULAR_HOME, MODULAR_MOJO_MAX_PACKAGE_ROOT and MODULAR_MOJO_MAX_IMPORT_PATH all unset. Fixes #331.
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.
Fixes #331.
An install put
KGENCompilerRTShared.dllinlib/, along with every other shared library, because the default path islib/plus whatever the platform calls a shared library. Nothing on Windows can load a DLL from there.The compiler itself was fine, because it hands the loader an absolute path it read out of its own configuration. A program that
mojo buildproduced has no configuration to read. It imports the DLL by name, and the Windows loader looks in the directory the program started from, then the system directories, then along PATH, and never in a sibling of the program's own directory. There is no rpath to say otherwise. So the program died with 0xC0000135 and no message, and the only fix a user had was to copy the file out oflib/by hand.sharedLibPathnow asks the name rather than the host. A.dllgoes inbin/and everything else stays inlib/, which keeps it one question with one answer and leaves Linux and macOS exactly where they were. Import libraries are not affected and stay inlib/, since a linker reads those at a path it is handed and does not go looking.bin/is also already where the two other runtime DLLs go in the release archive, for the same reason, so this makes the three of them agree.Verified on a Windows host against a staged install that has nothing in
lib/but the import library andstd.mojoc, and withMODULAR_HOME,MODULAR_MOJO_MAX_PACKAGE_ROOTandMODULAR_MOJO_MAX_IMPORT_PATHall unset:That last one is the case that did not work before. The directory holds only the source and the exe the compiler just produced.
Stacked on #330, so the diff here is the one commit once that lands.
Part of #319.