Skip to content

Changes to CoreCLR workflow #32991

Closed
Closed

Description

@jkoritzinsky

PR #31701 is changing the developer workflow for CoreCLR to help increase reliability, reduce local build times, and move us closer to a place where we can better parallelize CI to improve build times.

The largest part of the change is that the build.cmd and build.sh scripts under src/coreclr will be deprecated and later (probably in a few weeks) removed. The src/coreclr/src/build.proj file will also become unused and will be deleted. To build the coreclr product, the supported path will be to build from the root build script.

For those who strongly dislike building with MSBuild, the native runtime build will still be buildable with new build-runtime.cmd and build-runtime.sh scripts in src/coreclr that only build the native runtime build and the cross-arch native build. There will also be separate scripts available for running crossgen on System.Private.CoreLib. All managed builds will be driven exclusively through the Arcade scripting.

The way to control what parts of the CoreCLR build you run will be via the "subsets" infrastructure. See #31701 for specific subset names.

Below are some examples of commands for common workflows:

  • Build CoreCLR runtime, System.Private.CoreLib, crossgen System.Private.CoreLib all in Debug. Build all of Libraries in Release. (Common workflow when syncing)
./build -subsetcategory coreclr-libraries -subset runtime-corelib-nativecorelib-all -c Release -runtimeconfiguration Debug
  • Build CoreCLR runtime
./build -subsetcategory coreclr -subset runtime
  • Build CoreCLR runtime (build-runtime version)
src/coreclr/build-runtime
  • Build CoreCLR runtime and Crossgen2
./build -subsetcategory coreclr -subset runtime-tools

The subsets should give as much fine-grained control as was previously provided within the managed components. The native build scripts continue to have some finer-grained control and the build-runtime scripts are available for those who need it.

Activity

  1. added this to the 5.0 milestone on Feb 28, 2020
  2. added
    untriaged
    on Feb 28, 2020
  3. stephentoub commented on Feb 28, 2020

    @stephentoub
    Member

    @jkoritzinsky, I'm struggling to follow the examples a little. If today I do this:

    src\coreclr\build -release -skiptests

    what does that translate to now? Thanks.

  4. removed
    untriaged
    on Feb 28, 2020
  5. jkoritzinsky commented on Feb 28, 2020

    @jkoritzinsky
    MemberAuthor

    @jkoritzinsky, I'm struggling to follow the examples a little. If today I do this:

    src\coreclr\build -release -skiptests

    what does that translate to now? Thanks.

    That translates to build -subsetcategory coreclr -c Release.

    CoreCLR tests are now only built through the src/coreclr/build-test scripts, not the product build scripts, so there’s no need for a skiptests argument.

  6. jkotas commented on Feb 29, 2020

    @jkotas
    Member

    What is going to be equivalent of src\coreclr\build.cmd linuxmscorlib ?

  7. jkoritzinsky commented on Mar 2, 2020

    @jkoritzinsky
    MemberAuthor

    What is going to be equivalent of src\coreclr\build.cmd linuxmscorlib ?

    The equivalent is ./build -subset corelib -os Linux.

  8. pinned this issue on Mar 3, 2020
  9. changed the title [-]Upcoming changes to CoreCLR workflow[/-] [+]Changes to CoreCLR workflow[/+] on Mar 4, 2020
  10. jkotas commented on Mar 4, 2020

    @jkotas
    Member

    build -subsetcategory coreclr -c Release

    This fails very early for me with:

    Restore completed in 78.15 ms for D:\runtime\src\coreclr\src\tools\crossgen2\crossgen2\crossgen2.csproj. 'py' is not recognized as an internal or external command, operable program or batch file. The filename, directory name, or volume label syntax is incorrect. D:\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj(467,5): error MSB3073: The command ""'py' is not recognized as an internal or external command,;operable program or batch file.;C:\Users\jkotas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe" -B -Wall "D:\runtime\src\coreclr\/src/scripts/genRuntimeEventSources.py" --man "D:\runtime\src\coreclr\/src/vm/ClrEtwAll.man" --intermediate "D:\runtime\artifacts\obj\coreclr\Eventing\x64\Release"" exited with code 123.

    What is the recommended way to deal with the python dependency?

  11. jkoritzinsky commented on Mar 4, 2020

    @jkoritzinsky
    MemberAuthor

    That is a bug in eng/python.targets that didn't show up in testing somehow. I'll go fix that today. The workaround is to set the PYTHON environment variable to point to your python installation.

  12. jkotas commented on Mar 4, 2020

    @jkotas
    Member
  13. BruceForstall commented on Mar 4, 2020

    @BruceForstall
    Contributor

    @jkoritzinsky You suggest using:

    Build CoreCLR runtime, System.Private.CoreLib, crossgen System.Private.CoreLib all in Debug. Build all of Libraries in Release. (Common workflow when syncing)
    ./build -subsetcategory coreclr-libraries -subset runtime-corelib-nativecorelib-all -c Release -runtimeconfiguration Debug

    So, subsetCategory can be concatenated with -? Same with -subset?

    What does the "all" subset refer to? It looks like possibly one or all of:

      - Libraries|All
          The .NET libraries comprising the shared framework.
      - Mono|All
          The Mono .NET runtime.
      - Installer|All
          The .NET Core hosts, hosting libraries, bundles, and installers. Includes these projects' tests.
    

    but maybe because only libraries is specified in -subsetCategory, it only applies to libraries and not Mono or Installer?

    Is there a reason why there is no all for CoreClr?

  14. 4 remaining items

  15. sdmaclea commented on Mar 7, 2020

    @sdmaclea
    Contributor

    @jkoritzinsky The deprecation warning message in CoreCLR makes little sense. It says to use build-native.sh which only exists in libraries. I suspect it should say build-runtime.sh? Also building docs seem to be out of date.

  16. jkoritzinsky commented on Mar 7, 2020

    @jkoritzinsky
    MemberAuthor

    Yep that’s a typo from when I was renaming. I was going to name the files build-native but then changed my mind. Can you point me to the specific docs that are out of date? I thought I updated them.

  17. briansull commented on Mar 9, 2020

    @briansull
    Contributor

    Can you tell me what the very first command to use is to build everything after a clean sync?

    For Checked?

  18. jkoritzinsky commented on Mar 9, 2020

    @jkoritzinsky
    MemberAuthor

    @sandreenko I have not seen any errors like that locally.

    @briansull If you want to only build coreclr and libraries: ./build -subsetcategory coreclr-libraries -runtimeconfiguration checked -c release
    If you want to build the whole repo (including Mono and Installer): ./build -runtimeconfiguration checked -c release

  19. briansull commented on Mar 9, 2020

    @briansull
    Contributor

    Do I ever need to build Mono and the Installer, to do development on coreclr?

  20. briansull commented on Mar 9, 2020

    @briansull
    Contributor

    I will try using:
    ./build -subsetcategory coreclr-libraries -runtimeconfiguration checked -c release
    on my branch new clean up to date enlistment and report back.

    My build was successful!!

  21. jkoritzinsky commented on Mar 9, 2020

    @jkoritzinsky
    MemberAuthor

    It's very unlikely you would need to build Mono and the installer, but I wanted to give that command as well just to cover my bases.

  22. sdmaclea commented on Mar 9, 2020

    @sdmaclea
    Contributor

    Can you point me to the specific docs that are out of date?

    I was looking at the cross compilation and Linux coreclr instructions. They seemed to still be referring to the build.sh script in src/coreclr.

    Also a lot of your noted in the top post seem to have not made it to docs. Seems that is why there is traffic on this issue.... It is not clear where the build recipes are documented for developer scenarios...

  23. jkoritzinsky commented on Mar 9, 2020

    @jkoritzinsky
    MemberAuthor

    I think #33325 updates most of the docs. I'll make sure to add the commands above to a new "commonly used CoreCLR build commands" doc so they're easy to find.

  24. sdmaclea commented on Mar 9, 2020

    @sdmaclea
    Contributor

    I was going to name the files build-native but then changed my mind

    I found the build-runtime name counter intuitive. I was looking to build the DAC which is a native component, but is not the runtime. So I would have preferred, buuild-native for the non-runtime components...

  25. jkoritzinsky commented on Mar 10, 2020

    @jkoritzinsky
    MemberAuthor

    The reason I chose build-runtime was so the script matched the subset name. Basically so the command build -subsetcategory coreclr -subset runtime was equivalent to src/coreclr/build-runtime. I realize now that that may not have been the thing to aim for (or that the subset should also be named “native”)

  26. ViktorHofer commented on Mar 19, 2020

    @ViktorHofer
    Member

    Unpinning (3 weeks pinned should be sufficient) to make room for new announcements.

  27. unpinned this issue on Mar 19, 2020
  28. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
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-coreclrdiscussion

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions