-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Clean up $(RepoRoot)
consistently
#32664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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❔ If things work (and they should 😺), I'll add #32615 to the commit description when I merge. @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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I was mistaken thinking EnsureTrailingSlash(...)
was needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rainersigwald one question: Why is this able to override %RepoRoot%
in @SteveSandersonMS's #32615 scenario (under "Older report")❔ Are environment variables able to be overridden in msbuild
files even though they're otherwise treated as global properties❔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variables are treated as normal properties, not global properties, so they're mutable, they just have an initial value at the very beginning of evaluation.
@@ -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)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is <RepoRoot><RepoRoot>...</RepoRoot></RepoRoot>
a thing or just a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dougbu I'm also wondering about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a typo and a dumb one -- cut and paste error Condition
is rarely, if ever true
. PR incoming…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #32680
- 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)