Skip to content

Improve jitutils - #103

Merged
BruceForstall merged 18 commits into
dotnet:masterfrom
BruceForstall:Defaults
Apr 14, 2017
Merged

BruceForstall merged 18 commits into
dotnet:masterfrom
BruceForstall:Defaults

Conversation

@BruceForstall

Copy link
Copy Markdown
Contributor

Short summary:

  1. Improved usage model for jit-diff, especially, add support for much simpler
    command lines using better defaults. Read the rewritten diffs.md
    for details.
  2. Improved jit-diff parallelism when diffing the test tree. (Previously,
    dasm generation within a recursive directory walk was not parallel.)
  3. Changed jit-diff argument parsing to output the usage message on (most)
    errors (namely, the errors we validate, not the errors the argument
    library validates. It would be nice to do both.).
  4. Fixed many crashing bugs

Details:

Using jit-diff is cumbersome due to the need to specify so many
long paths. These can be specified in the config.json file in
the directory pointed to by the JIT_UTILS_ROOT environment
variable, but that is inflexible.

This change introduces an alternate way to specify all the required
data for jit-diff, by detecting or specifying the dotnet/coreclr
repo root, and automatically finding all the paths that are required.

The defaults can be altered by using the new --base_root, --diff_root,
--arch, and --build arguments, or their respective config.json settings.

See the rewritten diffs.md document for much more detail and various
examples of using this.

Also:

  1. To generate asm diffs for the test tree, specify the new "--tests"
    argument, as well as the "--test_root" argument (if "--test_root" can't
    be determined using the defaults).
  2. jit-diff now automatically runs jit-analyze. It now has a "--noanalyze"
    option to prevent this.
  3. jit-diff now takes an optional "--gcinfo" argument (which it passes
    through to jit-dasm) to specify emitting GC info into the generated dasm
    files.
  4. jit-format automatically detects the repo root, if run with the
    current directory within the dotnet/coreclr repo. So, the "--core_root"
    argument is no longer required, if the repo root can be found.
  5. Rewrote "getting started" document to account for new defaults,
    and other changes.
  6. Move all cijobs documentation to cijobs.md.
  7. Remove --tag option from jit-dasm: simply pass the --output path you desire.
  8. Support diff'ing System.Private.CoreLib.dll or the frameworks assemblies, in addition to
    the benchmarks or the full test tree. I regularized this, and added a lot of missing
    argument checking. I also renamed the arguments since "only" is incorrect. So, now
    there is --corelib, --frameworks, --tests, and --benchmarks.
  9. Removed jit-diff install --last_successful option because it didn't work.
  10. Removed the two old sample json files (that didn't work), and replace them with
    a sample config.json file that does.

@BruceForstall

Copy link
Copy Markdown
Contributor Author

@russellhadley @JosephTremoulet @dotnet/jit-contrib PTAL

Comment thread doc/config.md Outdated
"base": "checked_osx-1526",
"diff": "/Users/russellhadley/Work/dotnet/coreclr/bin/Product/OSX.x64.Checked",
"analyze": "true",
"frameworksonly": "true",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no longer an option called frameworksonly, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise for analyze

Comment thread doc/config.md
### Installing new tools

The jit-diff command `install` will download and install a new tool to the default location
and update the config.json so it can be found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't the commit message say you removed this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; install still exists. Honestly, though, I've never used it (successfully).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used install successfully - this is a time saver for me so I'm keen to keep it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nobody has suggested removing it.

Comment thread doc/diffs.md Outdated
Only one of `--tests` or `--benchmarks` can be specified.

If `--tests` or `--benchmarks` is specified, you must also specify `--test_root` so the tool knows
where to find the test tree you wish to use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does --test_root not have a default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does (that was a late change). I'll update the wording.

Comment thread doc/diffs.md Outdated

```
c:\gh\coreclr> jit-diff diff -o c:\diffs -t 5 -a -f --core_root c:\gh\coreclr\bin\tests\Windows_NT.x86.checked\Tests\Core_Root -b e:\gh\coreclr2\bin\Product\Windows_NT.x86.checked -d c:\gh\coreclr\bin\Product\Windows_NT.x86.checked
c:\gh\coreclr> jit-diff diff --output c:\diffs --corelib --core_root c:\gh\coreclr\bin\tests\Windows_NT.x64.checked\Tests\Core_Root --base e:\gh\coreclr2\bin\Product\Windows_NT.x64.checked --diff c:\gh\coreclr\bin\Product\Windows_NT.x64.checked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use release for core_root

Comment thread doc/diffs.md Outdated
* If jit-diff is invoked with the current directory within the dotnet/coreclr repo, then the root of
this repo serves to find the diff compiler and `CORE_ROOT` directory. (Note that we have no reasonable
default for determining what the baseline toolset or repo is. This is specified with the `--base_root` argument.)
* The default output directory is `<repo_root>\diffs` (in this case, c:\gh\coreclr\diffs).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of spewing output into the source tree. Does coreclr's .gitignore ignore this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could change .gitignore. Or, you could pass --output or set it in a config.json.

Do you have an alternative suggestion for a default?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My inclination is to make --output a required parameter. Failing that, I don't see what to do other than put diffs in .gitignore or maybe default to obj/diffs or bin/diffs if one of those is appropriate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of (by default) putting them in bin/diffs; that directory is already .gitignore'd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to have any required parameters if possible.

Comment thread src/jit-diff/jit-diff.cs Outdated
if ((_platformPath == null) || (_basePath == null) || (_diffPath == null) || ((_testPath == null) && needTestTree))
{
// Try all combinations of build and architecture to find one that has both a Core_Root
// and, if necessary, base and diff builds and tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core_root and test_root should only ever default to release. If the person running the tool hasn't built the release tree, better to tell them they need to than have them run diffs on a different build flavor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree. I never use release. And the tool does tell you when it uses a default, what it is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the tool does tell you when it uses a default, what it is.

Sure, but that will be buried by the output spew, hence the desire for a prompt before spewing.

Comment thread src/jit-diff/jit-diff.cs Outdated
{
Console.WriteLine("No platform mapping!");
_moniker = "bogus";
buildList = new List<string> { "checked", "debug" };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaulting build flavors for any of these seems dicey. I for one almost always have out-of-date trees built of one flavor or another. I'd go so far as to say we should print out what we're picking and prompt for user input before continuing (maybe with an explicit --quiet flag to opt out).

Comment thread src/jit-diff/jit-diff.cs Outdated

if ((_platformPath == null) && (_diffRoot != null))
{
tryPlatformPath = Path.Combine(_diffRoot, "bin", "tests", buildDirName, "Tests", "Core_Root");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Linux, I've always pointed --core_root to the overlay directory I created. I think you've mentioned in the docs above that running runtests.sh GenerateLayoutOnly will populate this Core_Root with the right set of stuff that this will work on Linux, but wanted to make sure I'm getting that right -- is that what you're saying/expecting, that this formula works on all supported platforms assuming that the dev has done a GenerateLayoutOnly runtests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my expectation.

Comment thread src/jit-diff/jit-diff.cs Outdated
StartDasmWork(args);
}

// Returns a count of the number of failures.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Comment thread src/jit-format/jit-format.cs Outdated
}
}

private string GetRepoRoot()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't have a jitutils.utility.dll...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to just have a shared utils.cs file statically linked in. But yes, there is too much code duplication now.

Comment thread doc/diffs.md

To simplify this more, create a dotnet/coreclr repo clone that you will always use for baselines.
Create a configuration file that specifies your baseline root directory, specifying a `base_root`
default. See the document [configuring defaults](config.md) for details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also grab baseline jits via cijobs. Additionally there are dasm results for baselines that can be grabbed even speeding this up more. I think we should make the default path more inline with reusing what's already been built/computed in the cloud.

Comment thread doc/config.md
### Installing new tools

The jit-diff command `install` will download and install a new tool to the default location
and update the config.json so it can be found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used install successfully - this is a time saver for me so I'm keen to keep it.

Comment thread doc/diffs.md

The defaults are:
* If jit-diff is invoked with the current directory within the dotnet/coreclr repo, then the root of
this repo serves to find the diff compiler and `CORE_ROOT` directory. (Note that we have no reasonable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to add a wrinkle here, I typically run from outside the repo structure and provide a standalone output dir with tools in it.

Comment thread doc/diffs.md
* The default output directory is `<repo_root>\diffs` (in this case, c:\gh\coreclr\diffs).
* The default diff architecture is x64. If this isn't found, x86 is tried.
* The default diff build flavor is checked. If this isn't found, debug is tried.
* By default, diffs are done using System.Private.CoreLib.dll. (That is, `--corelib` is the default.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for separate.

Comment thread doc/diffs.md
This supports a scenario like the following:

* Build base CoreCLR
* Produce baseline diffs by invoking the tool with '--base'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm still leery about putting non config file defaults baked into the tool. Just in the 4 people that have commented we've seen enough variation to make this a hard nut to crack. I'm worried that we're inviting forking the tools to support different peoples defaults.

@BruceForstall

Copy link
Copy Markdown
Contributor Author

@JosephTremoulet @russellhadley I've updated jit-diff with new argument rules, as discussed in the PR comments. I've updated all the help, as well as adding a bunch of examples to the tool usage message. E.g., you must now specify --base to generate baselines, --diff to generate diffs. If these aren't given arguments (full paths), defaults are found. Also, --core_run, --crossgen, and --test_root default to release builds, if available.

PTAL.

Also, I would appreciate it if you also pulled this down and tried it on your scenarios to ensure that it works for those, which are different from mine.

cc @dotnet/jit-contrib

@russellhadley

Copy link
Copy Markdown
Contributor

I just noticed the -lastSuccessful flag being removed. What happened? It broke once before when the Jenkins REST API output changed. Was it that again? (I find it convenient to grab the last successful build as a baseline and then branch from there for working since I'm in a good state then by construction)

@russellhadley

Copy link
Copy Markdown
Contributor

I figured out the mystery with why install doesn't work. The dotnet moniker for Windows changed and no longer matches the directory name I was looking for in what Jenkins produces for the job. There's some missing defensive code that needs to get added. This can be fixed by using the new GetBuildOS method, but this highlights that there's duplication between the SetRID logic and GetBuildOS that should be reconciled.

@russellhadley

Copy link
Copy Markdown
Contributor

I've fixed the install command and installed my base tool set and have everything set in the config file but I'm having a lot of trouble running the baseline set:

[D:\dotnet]
 10:12:25 > jit-diff diff --base --core_root D:\dotnet\coreclr\bin\tests\Windows_NT.x64.Checked\Tests\Core_Root
Default diff path D:\dotnet\coreclin\Product\Windows_NT.x64.Checked not found! Investigate config file entry.
Environment variable JIT_UTILS_ROOT found - configuration loaded.
Error: didn't find --crossgen default
Beginning diff of System.Private.CoreLib.dll, framework assemblies
crossgen not found at D:\dotnet\output\tools\checked_windows_nt-1337\Product\Windows_NT.x64.Checked\crossgen.exe

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at ManagedCodeGen.jitdiff.DiffTool.StartDasmWorkOne(List`1 commandArgs, String tagBaseDiff, String clrPath, AssemblyI
nfo assemblyInfo)
   at ManagedCodeGen.jitdiff.DiffTool.StartDasmWorkBaseDiff(List`1 commandArgs, List`1 assemblyWorkList)
   at ManagedCodeGen.jitdiff.DiffTool.RunDasmTool(List`1 commandArgs, List`1 assemblyWorkList)
   at ManagedCodeGen.jitdiff.DiffTool.DiffCommand(Config config)
   at ManagedCodeGen.jitdiff.Main(String[] args)
[D:\dotnet]
 10:13:28 > ls D:\dotnet\output\tools\checked_windows_nt-1337\Product\Windows_NT.x64.Checked\crossgen.exe


    Directory: D:\dotnet\output\tools\checked_windows_nt-1337\Product\Windows_NT.x64.Checked


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         4/4/2017   7:39 AM        4547584 crossgen.exe

@russellhadley

Copy link
Copy Markdown
Contributor

More details
I'm running out side of my enlistment directory (I don't like keeping my output in my source repos)
(I PR'd your private fork with the fix for install so you should be able to repro this)

And here's my config file:

{
  "asmdiff": {
    "default": {
      "base" : "checked_windows_nt-1337",
      "diff" : "D:\\dotnet\\coreclr\bin\\Product\\Windows_NT.x64.Checked",
      "frameworks": "true",
      "output": "d:\\dotnet\\output"
    },
    "tools": [
      {
        "tag": "checked_windows_nt-1337",
        "path": "D:\\dotnet\\output\\tools\\checked_windows_nt-1337\\Product\\Windows_NT.x64.Checked"
      }
    ]
  },
  "format": {
    "default": {
      "arch": "x64",
      "build": "Checked",
      "os": "Windows_NT",
      "coreclr": "C:\\dotnet\\coreclr",
      "verbose": "true",
      "fix": "true",
      "untidy": "false"
    }
  }
}

@JosephTremoulet JosephTremoulet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the updates. I have some fairly minor inline comments. Also wanted to (re-)mention a few higher-level things, none of which I think need any further changes in this PR, but which I'm curious your (and others') opinion on and if we should file follow-up issues:

  • I worry about warnings getting buried by the output spew. I had suggested earlier a prompt after the warnings and before generating dasm, but there are a variety of other options, like squelching the output spew, or sending it to a log file instead of the console, or repeating any warnings at the end of the run...
  • I worry about the strategy of iterating through architectures and build flavors until we can find one that has enough built artifacts. It would work fine for devs who typically only have one flavor built, but I know in my case I typically have only one or two flavors recently built, and have stale artifacts of the other flavors, and I'd guess I'm not alone in that. Printing the defaults we've found (and warning if it's non-release compilands) is great, but still seems easy to overlook and then waste time/effort tracking down diffs or lack of diffs due to running the wrong compiler. I'd love to build in a bit more protection against that, but I don't have any great ideas. We could check if there are multiple arch/flavor combinations that have everything built, and warn if there are multiple? Or warn if the selected default doesn't have the latest timestamp? Or default to the one with the latest timestamp instead of the first one found?
  • We should do something to share code that's copied across different jitutils.

Comment thread doc/diffs.md Outdated
build the repo, publish the resulting binaries to a common "bin" directory, and place them on the path.
This can be run to set up the developer in one shot.

To build jitutils not using the bootstrap script, run: `build.{cmd,sh}`. By

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to have cli (with minimum version xxx.yyy) installed and run dotnet restore before you can run build.{cmd,sh}.

Comment thread doc/diffs.md Outdated
2. `--corelib` -- generate diffs using System.Private.CoreLib.dll.
3. `--core_root` -- specify the `CORE_ROOT` directory (the "test layout"). Used to specify to crossgen
where the platform assemblies are. Also, used as the directory where framework assemblies such as
System.Private.CoreLib.dll can be found for the purpose of using them to generate dasm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's been said that System.Private.CoreLib.dll is special and actually gets pulled from wherever the running crossgen.exe is. Maybe change the example to System.Runtime.dll or something.

Comment thread doc/diffs.md Outdated
The defaults are:
* If jit-diff is invoked with the current directory within the dotnet/coreclr repo, then the root of
this repo serves to find the diff compiler and `CORE_ROOT` directory. (Note that we have no reasonable
default for determining what the baseline toolset or repo is. This is specified with the `--base_root` argument.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specified with the --base_root argument

or by providing a full path to the --base argument.

Comment thread src/jit-diff/jit-diff.cs Outdated
syntax.DefineOption("c|corelib", ref _corelib, "Diff System.Private.CoreLib.dll.");
syntax.DefineOption("f|frameworks", ref _frameworks, "Diff frameworks.");
syntax.DefineOption("benchmarks", ref _benchmarks, "Diff core benchmarks. Must pass --test_root.");
syntax.DefineOption("tests", ref _tests, "Diff all tests. Must pass --test_root.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to pass --test_root for these if it can be defaulted.

Comment thread src/jit-diff/jit-diff.cs Outdated
// using git.
//
// NOTE: we shouldn't do this unless it will be used, that is, if there are some
// arguments that are currently unspecified and need this to compute their default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you get rid of this NOTE comment now that you're computing needDiffRoot?

Comment thread src/jit-diff/jit-diff.cs Outdated

if (_build == null)
{
buildList = new List<string> { "release", "checked", "debug" };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re: casing

Comment thread src/jit-diff/jit-diff.cs
break;
}

if (!needCoreRoot && !needCrossgen && !needBasePath && !needDiffPath && !needTestTree)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can find an appropriate basePath and diffPath on x64 but can't find one of coreRoot/crossgen/testTree on x64, or similarly if you can find coreRoot and crossgen and testTree on x64 but can't find one of basePath/diffPath, and you can find all 5 on x86, it looks like this logic would lock in the set it finds on x64 and then just find the others on x86 and then try to run using defaults with mismatched architectures.

Comment thread src/jit-diff/jit-diff.cs Outdated

if (_benchmarks && (_testPath == null))
{
DisplayErrorMessage("--benchmarks requires specifying --test_root as well");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--test_root or --diff_root or running in the coreclr tree

Comment thread src/jit-diff/jit-diff.cs Outdated
if (_tests && (_testPath == null))
{
_syntaxResult.ReportError("Specify --output <path>");
DisplayErrorMessage("--tests requires specifying --test_root as well");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re: default test_root

Comment thread src/jit-diff/jit-diff.cs Outdated
if (!_corelib && !_frameworks && !_benchmarks && !_tests)
{
_syntaxResult.ReportError("Can't find --output path.");
// Setting --corelib as the default

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this to SetDefaults()?

@JosephTremoulet

Copy link
Copy Markdown
Contributor

Forgot to mention: I did pull down and try out the latest changes, and yes they do work fine in my typical workflow.

BruceForstall and others added 15 commits April 12, 2017 23:03
Short summary:

1. Improved usage model for jit-diff, especially, add support for much simpler
   command lines using better defaults. Read the rewritten diffs.md
   for details.
2. Improved jit-diff parallelism when diffing the test tree. (Previously,
   dasm generation within a recursive directory walk was not parallel.)
3. Changed jit-diff argument parsing to output the usage message on (most)
   errors (namely, the errors we validate, not the errors the argument
   library validates. It would be nice to do both.).
4. Fixed many crashing bugs

Details:

Using jit-diff is cumbersome due to the need to specify so many
long paths. These can be specified in the config.json file in
the directory pointed to by the `JIT_UTILS_ROOT` environment
variable, but that is inflexible.

This change introduces an alternate way to specify all the required
data for jit-diff, by detecting or specifying the dotnet/coreclr
repo root, and automatically finding all the paths that are required.

The defaults can be altered by using the new `--base_root`, `--diff_root`,
`--arch`, and `--build` arguments, or their respective config.json settings.

See the rewritten diffs.md document for much more detail and various
examples of using this.

Also:
1. To generate asm diffs for the test tree, specify the new "--tests"
argument, as well as the "--test_root" argument (if "--test_root" can't
be determined using the defaults).
2. jit-diff now automatically runs jit-analyze. It now has a "--noanalyze"
option to prevent this.
3. jit-diff now takes an optional "--gcinfo" argument (which it passes
through to jit-dasm) to specify emitting GC info into the generated dasm
files.
4. jit-format automatically detects the repo root, if run with the
current directory within the dotnet/coreclr repo. So, the "--core_root"
argument is no longer required, if the repo root can be found.
5. Rewrote "getting started" document to account for new defaults,
and other changes.
6. Move all cijobs documentation to cijobs.md.
7. Remove `--tag` option from `jit-dasm`: simply pass the `--output` path you desire.
8. Support diff'ing System.Private.CoreLib.dll or the frameworks assemblies, in addition to
   the benchmarks or the full test tree. I regularized this, and added a lot of missing
   argument checking. I also renamed the arguments since "only" is incorrect. So, now
   there is `--corelib`, `--frameworks`, `--tests`, and `--benchmarks`.
9. Removed `jit-diff install --last_successful` option because it didn't work.
10. Removed the two old sample json files (that didn't work), and replace them with
    a sample config.json file that does.
You now must specify `--base` to generate baselines,
and `--diff` to generate diffs. If you specify these
without also specifying a path, defaults for these
arguments are found.
If there were no prior installed tools we would run into a
null exception.  Add code for the case where the install is the
first one.
Previously, the `--output` parameter was used as the actual
directory where the data would be placed. Now, a subdirectory
with pattern `<job name>-<build number>` is created within
the output directory. Thus, `--output` is now a "base" directory
for cijobs copy output.
Also:
1. Add some useful warning messages to `jit-diff list`.
2. Fix `jit-diff install --last_successful`
Created a new `src/util` directory to put code common to all tools.
Created a util.cs there with a "Utility" class. Moved several
functions there that were already copied across various tools.

In jit-diff, created new diff.cs, install.cs, and uninstall.cs files
to split out the code specific to those commands into their own files.
@BruceForstall

Copy link
Copy Markdown
Contributor Author

I've updated the changes with to reflect code review feedback, as well as:

  • Fixed many more crashing issues.
  • Fixed jit-diff install --last_successful so it works.
  • Added jit-diff uninstall
  • Refactored the code: created a shared src/util/util.cs file and put some common functions there. Also split jit-diff.cs: added diff.cs, install.cs, uninstall.cs to contain code specific to those commands.

@russellhadley @JosephTremoulet PTAL
cc @dotnet/jit-contrib

@BruceForstall

Copy link
Copy Markdown
Contributor Author

About the only thing I didn't address were Joe's two top-level concerns: (1) worry about errors getting lost in the output spew. I think it would be easy to capture all the error/warning messages and replay them at the end. Future work. (2) worry about the strategy of iterating arch/build to find defaults.

@JosephTremoulet

Copy link
Copy Markdown
Contributor
  • The change to cijobs copy --output behavior complicates using it (with -c) in scripts; it used to be the case that the calling script would know exactly where the output was going to go, but now it would have to figure out the job number. Not sure what to do about it:
    • We could have separate --output (old behavior) and --outputRoot (new behavior) parameters
    • We could have the directory tag match the inputs (so use the commit hash when called with -c)
    • You or I could just deal with having it work the way we don't like (I know that for me that would involve having calling scripts search the output directory or parse cijobs' stdout; I don't know what it would involve for you).
  • I often have to run cijobs copy a few times before it succeeds, due to network flakiness. If it's now an error to specify an existing --output directory, I'd have to delete the directory between retries. So I'd rather that be a warning, or an error suppressible with a flag like --force, or have cijobs copy detect failure and delete the directory if the copy fails.

Aside from that, LGTM, thanks.

@BruceForstall

Copy link
Copy Markdown
Contributor Author

I thought about the cijobs output path, but hoped the change wouldn't cause problems. Of course, I was wrong :-) I actually thought it might have been a bug, since the "tag" (final directory name component) was already being constructed, but never used. I'll probably need to add --outputRoot since jit-diff requires that behavior.

I can make the cijobs copy existing output file check a warning, no problem. When I had that happen, cijobs crashed; I think in the unzip phase. Maybe I can look more carefully at what caused the crash.

This is used by "jit-diff install" to allow cijobs to create an
appropriately named output directory based on job name and build
number.
1. Stop finding a default for crossgen. There already is a reasonable
   default being computed.
2. Fix a File/Directory not found confusion bug.
3. Require --base for generating baselines, and --diff for generating
   diffs, even if there is a "base" and/or "diff" specified in the
   config.json file.
@BruceForstall

Copy link
Copy Markdown
Contributor Author

@dotnet/jit-contrib @dotnet/arm64-contrib @dotnet/arm32-contrib I am planning to merge this change soon. Note that the command-line for jit-diff changes somewhat drastically with this change (although mostly in a backwards-compatible way). If you have any questions, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants