Repository navigation
Closed
Description
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:
- 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.
- There should be examples at the end with various suggested command-lines for common usages.
- There should be a better description of what a "subset" is and what a "subsetCategory" is, and how they differ.
- Also, can you specify one subsetCategory with one subset, and another subsetCategory with a different subset?
- 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.
- 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:
- 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!
- I don't understand the syntax. What does "CoreClr|Packages" mean? Is
CoreClr|Packagesthe name of a subset? Or isPackagesthe name of a subset only applicable toCoreClr? If the latter, isCoreClrthe subsetCategory? - Are the subsets and subsetCategories case sensitive?
- 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 toolsor-subset runtime -subset toolsinstead.
Finally, CoreClr should be consistently cased CoreCLR.
Reacted by Viktor Hofer, Dan Moseley, Kunal Pathak, Miha Zupan and Aaron Franke
Activity
BruceForstall commentedon Mar 4, 2020
@jkoritzinsky @dotnet/runtime-infrastructure
ViktorHofer commentedon Mar 4, 2020
I agree with your suggestions. We should also improve the subset system and try to merge the subset and subsetcategory parameters which were necessary back when we merge three different repos together but are less important now as we consolidate more code.
danmoseley commentedon Mar 26, 2020
As discussed offline in Teams, my impression is that it may be better to make the system less complex (eg., perhaps combine the subset and subsetCategory concepts) rather than paper over the complexity with online help and documentation. If it's confusing several members of our own team, it's likely to be causing even more confusion to our contributors.
ivdiazsa commentedon May 28, 2020
Several points have been improved, such as removing
subsetCategoryand changing the pipe notation to a dot. However, there are other points that could be improved upon:-subset help.I can work on these improvements and extend the first two to
build.shas well. I have an observation though, regarding the last point. The subset help is printed directly by MSBuild and its command built inbuild.ps1needs to include the-buildflag. Otherwise, it just shows aBuild succeededmessage but does not print the subsets' descriptions. I could do away with the error message, but I'm not sure if it's possible to remove the "Elapsed Time" metrics.@BruceForstall @danmosemsft
safern commentedon May 28, 2020
I don't think so because
-subset helpis generated from MSBuild. Maybe there is a flag to tell MSBuild to not print these metrics?danmoseley commentedon May 28, 2020
You can suppress "Build Succeeded", the warning/errors count, and the elapsed time by passing "NOSUMMARY" eg
/clp:nosummaryYou can't suppress any of those individually:
https://github.com/microsoft/msbuild/blob/b0d72851842af6f6b50ad62e6e2077790ee5de29/src/Build/Logging/ParallelLogger/ParallelConsoleLogger.cs#L266-L325