Skip to content

Proposal: Get rid of "checked" build flavor #31852

Closed

Description

@jkotas

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?

Activity

  1. added
    untriaged
    on Feb 6, 2020
  2. added
    area-Infrastructure-coreclr
    and removed
    untriaged
    on Feb 6, 2020
  3. stephentoub commented on Feb 6, 2020

    @stephentoub
    Member

    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?

  4. jkotas commented on Feb 6, 2020

    @jkotas
    MemberAuthor

    Yes, that's right.

  5. stephentoub commented on Feb 6, 2020

    @stephentoub
    Member

    Sounds good to me, but I also almost never build coreclr as debug, only checked and release.

  6. janvorli commented on Feb 6, 2020

    @janvorli
    Member

    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.

  7. jkotas commented on Feb 6, 2020

    @jkotas
    MemberAuthor

    Yes, a command line option to turn off optimizations for C/C++ would be part of the plan.

  8. ViktorHofer commented on Feb 6, 2020

    @ViktorHofer
    Member

    If we do this we should also clean-up the checked conditions in System.Private.CoreLib in mono:

    <PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
    <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Debug'">false</Optimize>
    <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Checked'">true</Optimize>

    I assume that we align configurations so that they are doing the same thing on Mono and CoreClr.

  9. jkoritzinsky commented on Feb 6, 2020

    @jkoritzinsky
    Member

    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.

  10. BruceForstall commented on Feb 6, 2020

    @BruceForstall
    Contributor

    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.

  11. BruceForstall commented on Feb 6, 2020

    @BruceForstall
    Contributor

    @dotnet/jit-contrib

  12. CarolEidt commented on Feb 6, 2020

    @CarolEidt
    Contributor

    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.

  13. 12 remaining items

  14. jkotas commented on May 7, 2020

    @jkotas
    MemberAuthor

    It was not.

  15. briansull commented on May 7, 2020

    @briansull
    Contributor

    @dotnet/jit-contrib The JIT team is a heavy user of Checked builds.

  16. GrabYourPitchforks commented on May 7, 2020

    @GrabYourPitchforks
    Member

    Problem was on our end. Thanks for the confirmation. :)

  17. added this to the Future milestone on Jul 17, 2020
  18. dotnet-policy-service commented on Jan 16, 2025

    @dotnet-policy-service
    Contributor

    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.

  19. added
    backlog-cleanup-candidate
    on Jan 16, 2025
  20. dotnet-policy-service commented on Jan 31, 2025

    @dotnet-policy-service
    Contributor

    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.

  21. removed this from the Future milestone on Jan 31, 2025
  22. locked and limited conversation to collaborators on Mar 2, 2025
  23. removed
    backlog-cleanup-candidate
    on Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-coreclr

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions