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

Disable incremental linking on MSVC #11552

Conversation

HertzDevil
Copy link
Contributor

Incremental linking does not make sense for temporary executables (crystal eval, run, spec, play, specs that invoke the compiler program), because a full link is performed if the output is missing, and Crystal always deletes those executables after finishing; all we get is a padded executable, an .ilk file that never gets used, and this warning message:

C:\Users\RUNNER~1\AppData\Local\Temp\cr-spec-08887e17\warnings\crystal-spec-output.exe not found or not built by the last incremental link; performing full link

Even for crystal build, MSVC performs a full link whenever the link command line changes. The way Crystal programs are written can cause frequent changes to the command line, so incremental linking is now disabled by default. It can still be explicitly enabled with --link=flags=/INCREMENTAL (MSVC generates no warnings if multiple conflicting /INCREMENTAL options are specified, the last one takes effect).

@straight-shoota straight-shoota added this to the 1.3.0 milestone Dec 8, 2021
@straight-shoota straight-shoota merged commit a21ec60 into crystal-lang:master Dec 9, 2021
@HertzDevil HertzDevil deleted the feature/msvc-incremental-link branch December 10, 2021 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:windows Windows support based on the MSVC toolchain topic:compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants