You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: Get rid of "checked" build flavor #31852
checked build flavor is a foreign concept that takes a lot of explaining and causes unnecessary complexity.
The checked build flavor (ie build with asserts and optimizations on) is left-over from razzle (the original Windows OS build environment). I believe most project still on razzle (including Windows OS) got rid of it and have just debug (that is built with optimizations on by default) and release.
If developers want to compile the code with C/C++ optimizations off to get better debugging experience, they can pass an extra argument to the build script to turn off the optimizations. It is conceptually no different from e.g. a build script switch to use a different C/C++ compiler for the build.
Should we adopt this for CoreCLR build?
Reacted by Stephen Toub, Jared Parsons, hopperpl, Adeel Mujahid, Alex Perovich, Aleksey Kliger (λgeek) and Viktor Hofer
I always use debug build and use checked only in cases where I need to get slightly better perf, like when running coreclr tests suite. On Linux, debugging coreclr with any optimizations is pretty painful. While on Windows you can easily debug even release build, on Linux you get virtually no locals, no parameter values etc. Even checked is quite bad on Linux.
So if we made debug == checked, I would need to have a command line option in the build scripts that would allow me to disable optimizations. But I agree that separate checked / debug flavors are probably not necessary from all the other points of view.
Reacted by Adeel Mujahid, Bruce Forstall, Tanner Gooding, Egor Chesakov, Sergey Andreenko and Juan Hoyos
I’m with @janvorli on this; I always use Debug. I only use checked when reproing test failures so I match what CI is doing. As long as there’s an option to disable optimizations in debug, I’ll be satisfied.
Reacted by Santiago Fernandez Madero, Adeel Mujahid and Steve MacLean
What is the advantage of removing checked? If you want unoptimized binaries with the best debugging experience, you'll need to use a new option, which might confuse your builds. E.g., it might be more confusing in your artifacts directory to know what is optimized and what is not.
I run Debug when debugging, but Checked when running tests. With the new proposal, I would need to go back-and-forth, rebuilding with and without the new flag into the same artifacts location (presumably) to be able to do this. That seems very wasteful.
Reacted by Eugene Rozenfeld, Egor Chesakov, Carol Eidt, Clinton Ingram, Brian Sullivan and David Maas
I totally agree with what @BruceForstall says about wanting to understand the advantages (and the trade-offs). I use Checked most of the time, but will occasionally build Debug when optimization gets in my way. Whatever we do it needs to be friction-free to accommodate varying requirements.
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.
Activity
stephentoub commentedon Feb 6, 2020
If I'm understanding correctly, this isn't exactly removing checked; rather it's getting rid of debug and renaming checked to debug, is that right?
jkotas commentedon Feb 6, 2020
Yes, that's right.
stephentoub commentedon Feb 6, 2020
Sounds good to me, but I also almost never build coreclr as debug, only checked and release.
janvorli commentedon Feb 6, 2020
I always use debug build and use checked only in cases where I need to get slightly better perf, like when running coreclr tests suite. On Linux, debugging coreclr with any optimizations is pretty painful. While on Windows you can easily debug even release build, on Linux you get virtually no locals, no parameter values etc. Even checked is quite bad on Linux.
So if we made debug == checked, I would need to have a command line option in the build scripts that would allow me to disable optimizations. But I agree that separate checked / debug flavors are probably not necessary from all the other points of view.
jkotas commentedon Feb 6, 2020
Yes, a command line option to turn off optimizations for C/C++ would be part of the plan.
ViktorHofer commentedon Feb 6, 2020
If we do this we should also clean-up the checked conditions in System.Private.CoreLib in mono:
runtime/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj
Lines 90 to 92 in 1a1a541
I assume that we align configurations so that they are doing the same thing on Mono and CoreClr.
jkoritzinsky commentedon Feb 6, 2020
I’m with @janvorli on this; I always use Debug. I only use checked when reproing test failures so I match what CI is doing. As long as there’s an option to disable optimizations in debug, I’ll be satisfied.
BruceForstall commentedon Feb 6, 2020
What is the advantage of removing checked? If you want unoptimized binaries with the best debugging experience, you'll need to use a new option, which might confuse your builds. E.g., it might be more confusing in your
artifactsdirectory to know what is optimized and what is not.I run Debug when debugging, but Checked when running tests. With the new proposal, I would need to go back-and-forth, rebuilding with and without the new flag into the same
artifactslocation (presumably) to be able to do this. That seems very wasteful.BruceForstall commentedon Feb 6, 2020
@dotnet/jit-contrib
CarolEidt commentedon Feb 6, 2020
I totally agree with what @BruceForstall says about wanting to understand the advantages (and the trade-offs). I use Checked most of the time, but will occasionally build Debug when optimization gets in my way. Whatever we do it needs to be friction-free to accommodate varying requirements.
12 remaining items
jkotas commentedon May 7, 2020
It was not.
briansull commentedon May 7, 2020
@dotnet/jit-contrib The JIT team is a heavy user of Checked builds.
GrabYourPitchforks commentedon May 7, 2020
Problem was on our end. Thanks for the confirmation. :)
dotnet-policy-service commentedon Jan 16, 2025
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of our issue cleanup automation.
dotnet-policy-service commentedon Jan 31, 2025
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.