Clean up $(RepoRoot)
consistently
#32664
Conversation
- don't override correct values but fix incorrect ones nits: - don't use `$(MSBuildProjectDirectory)` in project files - inconsistent w/ `$(MSBuildThisFileDirectory)` and harder to grok - don't add unnecessary slashes after `$(MSBuildThisFileDirectory)` - clean up Microsoft.AspNetCore.Testing.props - used only from eng/targets/CSharp.Common.props but fallback settings may help
This slightly undoes #32552 and also cleans things up a bit more than I did there. @captainsafia and @SteveSandersonMS this should address #32615. @SteveSandersonMS could you try your scenario while on this branch @BrennanConroy I'm also testing that this fixes the SignalR pipeline problems. See |
@@ -3,7 +3,7 @@ | |||
|
|||
<PropertyGroup> | |||
<!-- $(RepoRoot) is normally set globally and Arcade overrides it to ensure a trailing slash. --> | |||
<RepoRoot Condition=" '$(RepoRoot)' == '' ">$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))</RepoRoot> | |||
<RepoRoot Condition=" '$(RepoRoot)' == '' OR !HasTrailingSlash('$(RepoRoot)') ">$(MSBuildThisFileDirectory)</RepoRoot> |
dougbu
May 14, 2021
Author
Contributor
Note: I was mistaken thinking EnsureTrailingSlash(...)
was needed
dougbu
May 14, 2021
Author
Contributor
@rainersigwald one question: Why is this able to override %RepoRoot%
in @SteveSandersonMS's #32615 scenario (under "Older report")msbuild
files even though they're otherwise treated as global properties
@@ -31,7 +31,7 @@ | |||
<!-- Skip the "inner" test run when we're running DailyTests --> | |||
<Yarn Command="run test:inner --no-color --configuration $(Configuration)" | |||
Condition="'$(DailyTests)' != 'true'" | |||
WorkingDirectory="$(RepoRoot)src/SignalR/clients/ts/FunctionalTests" /> | |||
WorkingDirectory="$(MSBuildThisFileDirectory)" /> |
dougbu
May 14, 2021
Author
Contributor
This was a teensy nit. No reason to describe the path in so much detail when $(MSBuildThisFileDirectory)
is sitting right there…
So far,
|
No need for further checks @SteveSandersonMS. I reproduced #32615 locally in a
|
Just need an approval and the build to complete. Validated fix for #32615 and https://dev.azure.com/dnceng/internal/_build/results?buildId=1138761 went fine. |
c53700b
into
main
Thanks @dougbu and @captainsafia for resolving this! |
@@ -1,9 +1,13 @@ | |||
<Project> | |||
<PropertyGroup> | |||
<RepoRoot | |||
Condition=" '$(RepoRoot)' == '' OR !HasTrailingSlash('$(RepoRoot)') "><RepoRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '..', '..', '..'))</RepoRoot></RepoRoot> |
BrennanConroy
May 14, 2021
Contributor
Is <RepoRoot><RepoRoot>...</RepoRoot></RepoRoot>
a thing or just a typo?
dougbu
May 14, 2021
Author
Contributor
It's a typo and a dumb one -- cut and paste error Condition
is rarely, if ever true
. PR incoming…
- typo introduced in #32664 - see discussion at #32664 (comment)
- typo introduced in #32664 - see discussion at #32664 (comment)
nits:
$(MSBuildProjectDirectory)
in project files$(MSBuildThisFileDirectory)
and harder to grok$(MSBuildThisFileDirectory)