Skip to content

build -help needs to be more helpful #33167

@BruceForstall

Description

@BruceForstall

Running build -help displays help for building the repo, but it needs to be improved. Currently, it displays:

Common settings:
  -subset                   Build a subset, print available subsets with -subset help
  -subsetCategory           Build a subsetCategory, print available subsetCategories with -subset help
  -vs                       Open the solution with VS for Test Explorer support. Path or solution name (ie -vs Microsoft.CSharp)
  -os                       Build operating system: Windows_NT or Unix
  -arch                     Build platform: x86, x64, arm or arm64
  -configuration            Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)
  -runtimeConfiguration     Runtime build configuration: Debug, Release or [CoreCLR]Checked
  -librariesConfiguration   Libraries build configuration: Debug or Release
  -verbosity                MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)
  -binaryLog                Output binary log (short: -bl)
  -help                     Print help and exit (short: -h)

Actions (defaults to -restore -build):
  -restore                Restore dependencies (short: -r)
  -build                  Build all source projects (short: -b)
  -buildtests             Build all test projects
  -rebuild                Rebuild all source projects
  -test                   Build and run tests (short: -t)
  -pack                   Package build outputs into NuGet packages
  -sign                   Sign build outputs
  -publish                Publish artifacts (e.g. symbols)
  -clean                  Clean the solution

Libraries settings:
  -framework              Build framework: netcoreapp5.0 or net472 (short: -f)
  -coverage               Collect code coverage when testing
  -testscope              Scope tests, allowed values: innerloop, outerloop, all
  -allconfigurations      Build packages for all build configurations

Command-line arguments not listed above are passed thru to msbuild.
The above arguments can be shortened as much as to be unambiguous (e.g. -con for configuration, -t for test, etc.).

Suggestions:

  1. Options should state what the default is (what would be used if nothing is specified on this machine, in this environment). E.g., OS, arch/configuration, runtimeConfiguration, librariesConfiguration, etc.
  2. There should be examples at the end with various suggested command-lines for common usages.
  3. There should be a better description of what a "subset" is and what a "subsetCategory" is, and how they differ.
  4. Also, can you specify one subsetCategory with one subset, and another subsetCategory with a different subset?
  5. nit: the option list should be better ordered. E.g., start with "-help", then "-subsetCategory" (next most important?), then subset, then os/arch/configuration, etc.
  6. nit: in "... passed thru to ...", replace "thru" with "through".

When I run build -subset help, it shows:

  Accepted Subset values:
  - RegenerateReadmeTable [only runs on demand]
      Regenerates the table of asset links in the README.md file.
  - Libraries|All
      The .NET libraries comprising the shared framework.
  - CoreClr|Runtime
      The CoreCLR .NET runtime.
  - CoreClr|LinuxDac
      The cross-OS Windows->libc-based Linux DAC. Skipped on x86.
  - CoreClr|AlpineDac [only runs on demand]
      The cross-OS Windows->musl-libc-based Linux DAC. Skipped on x86.
  - CoreClr|CoreLib
      The managed System.Private.CoreLib library for CoreCLR.
  - CoreClr|NativeCoreLib
      Run crossgen on System.Private.CoreLib library for CoreCLR.
  - CoreClr|Tools
      Managed tools that support CoreCLR development and testing.
  - CoreClr|Packages
      The projects that produce NuGet packages for the CoreCLR runtime, crossgen, and IL tools.
  - Mono|All
      The Mono .NET runtime.
  - Installer|All
      The .NET Core hosts, hosting libraries, bundles, and installers. Includes these projects' tests.
  - Installer|CoreHost
      The .NET Core hosts.
  - Installer|Managed
      The managed .NET hosting projects. This includes PlatformAbstractions, DependencyModel, and HostModel.
  - Installer|DepProj
      The dependency projects. These gather shared framework files and run crossgen on them to turn them into ready-to-run (R2R) assemblies for the current platform.
  - Installer|PkgProj
      The packaging projects. These produce NETCoreApp assets: NuGet packages, installers, zips, and Linux packages.
  - Installer|Bundle
      The shared framework bundle installer projects. Produces .exe installers for Windows.
  - Installer|Installers
      Generates additional installers. This produces the shared frameworks and their installers.
  - Installer|Test
      The test projects. Note that building this doesn't execute tests: you must also pass the '-test' argument.

F:\gh\runtime2\eng\Build.props(53,5): error : Choose a subset to use, or do not specify a subset to perform the full build. [F:\NugetCache\microsoft.dotnet.arcade.sdk\5.0.0-beta.20153.1\tools\Build.proj]

Build FAILED.

F:\gh\runtime2\eng\Build.props(53,5): error : Choose a subset to use, or do not specify a subset to perform the full build. [F:\NugetCache\microsoft.dotnet.arcade.sdk\5.0.0-beta.20153.1\tools\Build.proj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.38
(NETCORE_ENGINEERING_TELEMETRY=Category) Build failed.

Suggestions:

  1. I'm asking for help. It shouldn't display all the "error" / "Build FAILED" / "Warning(s)" / "Error(s)" / "Time Elapsed" / telemetry stuff. And the build shouldn't be considered failed!
  2. I don't understand the syntax. What does "CoreClr|Packages" mean? Is CoreClr|Packages the name of a subset? Or is Packages the name of a subset only applicable to CoreClr? If the latter, is CoreClr the subsetCategory?
  3. Are the subsets and subsetCategories case sensitive?
  4. Changes to CoreCLR workflow #32991 seems to indicate that you can specify multiple subsets by concatenating them with dashes in between (e.g., runtime-tools). This is quite weird, and not described anywhere. I would generally expect to be able to do -subset runtime tools or -subset runtime -subset tools instead.

Finally, CoreClr should be consistently cased CoreCLR.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions