Skip to content

Improve jit-format - #318

Merged
BruceForstall merged 1 commit into
dotnet:masterfrom
BruceForstall:ImproveFormat
Mar 8, 2021
Merged

BruceForstall merged 1 commit into
dotnet:masterfrom
BruceForstall:ImproveFormat

Conversation

@BruceForstall

Copy link
Copy Markdown
Contributor
  1. Currently, if you run jit-format but aren't already using
    ninja, it does a full ninja build of the dotnet/runtime repo.
    Change the invocation of build-runtime.cmd to use the
    -configureonly -ninja args instead of usenmakemakefiles so
    only the cmake configure part of the build is run, which generates
    the compile_commands.json that the format tool needs. After this
    goes in, we can remove the obsolete usenmakemakefiles switch
    from build-runtime.cmd, as it is only there to support jit-format.

  2. jit-format invokes dotnet --info to figure out the OS. But
    this doesn't work when invoking the executable dotnet (as opposed
    to the script wrapper dotnet.cmd/sh) when inside the runtime repo,
    as it doesn't report as much information as we want. So, for simplicity,
    just invoke the command in some location (like the Windows system
    directory, or Unix root directory) that shouldn't be a runtime repo
    clone, so shouldn't have this problem.

Note that this fix should also get applied to jit-diff (actually,
it should get refactored into util.cs and shared).

1. Currently, if you run `jit-format` but aren't already using
ninja, it does a full ninja build of the dotnet/runtime repo.
Change the invocation of `build-runtime.cmd` to use the
`-configureonly -ninja` args instead of `usenmakemakefiles` so
only the cmake configure part of the build is run, which generates
the `compile_commands.json` that the format tool needs. After this
goes in, we can remove the obsolete `usenmakemakefiles` switch
from `build-runtime.cmd`, as it is only there to support `jit-format`.

2. `jit-format` invokes `dotnet --info` to figure out the OS. But
this doesn't work when invoking the executable dotnet (as opposed
to the script wrapper dotnet.cmd/sh) when inside the runtime repo,
as it doesn't report as much information as we want. So, for simplicity,
just invoke the command in some location (like the Windows system
directory, or Unix root directory) that shouldn't be a runtime repo
clone, so shouldn't have this problem.

Note that this fix should also get applied to `jit-diff` (actually,
it should get refactored into util.cs and shared).
@BruceForstall

Copy link
Copy Markdown
Contributor Author

@dotnet/jit-contrib PTAL

@kunalspathak kunalspathak 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 fixing the ninja command.

@BruceForstall
BruceForstall merged commit 294d502 into dotnet:master Mar 8, 2021
@BruceForstall
BruceForstall deleted the ImproveFormat branch March 8, 2021 18:04
BruceForstall added a commit to BruceForstall/runtime that referenced this pull request Mar 8, 2021
BruceForstall added a commit to dotnet/runtime that referenced this pull request Mar 9, 2021
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.

3 participants