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 building the interpreter on Windows #12397

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Aug 16, 2022

This PR includes the final bits necessary to enable interpreter builds on Windows MSVC. Requires #12391. To set up:

  • Ensure your pre-existing Crystal installation is new enough by verifying that ffi.lib exists in CRYSTAL_LIBRARY_PATH (it was added after 1.5.0, so you might have to build it yourself or grab it from the CI artifacts).
  • Create the alternate CRYSTAL_LIBRARY_PATH DLL directory with gc.dll and pcre.dll according to the first 3 steps here. Do not set CRYSTAL_LIBRARY_PATH in the terminal that rebuilds the compiler.
  • (Optional) Build also libiconv.dll and the iconv.lib import library:
    • Following these workflow steps, except that this time MultiThreaded becomes MultiThreadedDLL and /p:Configuration=ReleaseStatic becomes /p:Configuration=Release.
    • Copy lib64\libiconv.lib to iconv.lib inside the DLL directory.
    • Copy lib64\libiconv.dll to libiconv.dll inside the DLL directory. Do not rename the DLL - the base name is hardcoded in the import library.
  • Run make -fMakefile.win interpreter=1.
  • In a separate terminal, point CRYSTAL_LIBRARY_PATH to the DLL directory, and also set CRYSTAL_OPTS=-Dpreview_dll. You will have to add -Dwithout_iconv unless you did the optional steps above.
  • Now bin\crystal i should start an interpreter REPL session. set CRYSTAL_INTERPRETER_LOADER_INFO=1 also works on Windows.

The main outstanding issues are tracked in #12396.

src/raise.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.6.0 milestone Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature platform:windows Windows support based on the MSVC toolchain / Win32 API topic:compiler:interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants