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

Support absolute paths in CRYSTAL_INTERPRETER_LOADER_INFO #14147

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Dec 28, 2023

This PR retrieves the actual paths for the DLLs loaded using an unqualified name (mainly system DLLs), as well as the current process handles. Using Crystal::Loader directly on Windows will now give something like this:

Crystal::Loader loaded libraries:
      C:\Users\nicet\AppData\Local\crystal\cache\gc.dll
      C:\Users\nicet\AppData\Local\crystal\cache\pcre2-8.dll
      C:\Users\nicet\AppData\Local\crystal\cache\libiconv.dll
      C:\WINDOWS\System32\KERNEL32.DLL
      C:\Users\nicet\AppData\Local\crystal\cache\crystal-run-test.exe.tmp.exe

Running the interpreter will give:

Crystal::Loader loaded libraries:
      C:\crystal\pcre2-8.dll
      C:\crystal\gc.dll
      C:\crystal\libiconv.dll
      C:\WINDOWS\System32\ADVAPI32.dll
      C:\WINDOWS\System32\SHELL32.dll
      C:\WINDOWS\System32\ole32.dll
      C:\WINDOWS\System32\WS2_32.dll
      C:\WINDOWS\System32\KERNEL32.DLL
      C:\WINDOWS\System32\ucrtbase.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-convert-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-environment-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-filesystem-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-heap-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-locale-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-math-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-multibyte-l1-1-0.dll
      C:\WINDOWS\System32\ucrtbase.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-runtime-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-stdio-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-string-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-time-l1-1-0.dll
      C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\api-ms-win-crt-utility-l1-1-0.dll
      C:\Users\nicet\crystal\crystal\.build\crystal.exe

@straight-shoota straight-shoota added this to the 1.11.0 milestone Dec 31, 2023
@straight-shoota straight-shoota merged commit 6bfc90d into crystal-lang:master Jan 1, 2024
56 checks passed
@HertzDevil HertzDevil deleted the feature/crystal-interpreter-loader-info branch January 2, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants