Repository navigation
Improve jit-format - #318
Merged
Merged
Conversation
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).
Contributor
Author
|
@dotnet/jit-contrib PTAL |
kunalspathak
approved these changes
Mar 8, 2021
kunalspathak
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing the ninja command.
sandreenko
approved these changes
Mar 8, 2021
BruceForstall
added a commit
to BruceForstall/runtime
that referenced
this pull request
Mar 8, 2021
After dotnet/jitutils#318, we no longer need this option.
BruceForstall
added a commit
to dotnet/runtime
that referenced
this pull request
Mar 9, 2021
After dotnet/jitutils#318, we no longer need this option.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, if you run
jit-formatbut aren't already usingninja, it does a full ninja build of the dotnet/runtime repo.
Change the invocation of
build-runtime.cmdto use the-configureonly -ninjaargs instead ofusenmakemakefilessoonly the cmake configure part of the build is run, which generates
the
compile_commands.jsonthat the format tool needs. After thisgoes in, we can remove the obsolete
usenmakemakefilesswitchfrom
build-runtime.cmd, as it is only there to supportjit-format.jit-formatinvokesdotnet --infoto figure out the OS. Butthis 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).