Skip to content
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

Platform Specifications Should Match Casing Among All Build Scripts #81141

Closed
ivdiazsa opened this issue Jan 25, 2023 · 3 comments · Fixed by #85357
Closed

Platform Specifications Should Match Casing Among All Build Scripts #81141

ivdiazsa opened this issue Jan 25, 2023 · 3 comments · Fixed by #85357
Assignees
Milestone

Comments

@ivdiazsa
Copy link
Member

Description

Recently, a conversation about making all platform ID's in build scripts lowercase was revived in PR #80164. However, the lack of uniformity can lead to unexpected and wrong behavior to unsuspecting developers passing flags directly to MSBuild when using other scripts, like for example eng/common/build.sh.

Reproduction Steps

See this example:

  1. Build CLR and Libs:
./build.sh -s clr+libs -c Release
  1. Generate the test layout and build some tests:
./src/tests/build.sh -x64 -release -generatelayoutonly
./src/tests/build.sh -x64 -release -test:JIT/Methodical/Methodical_d2.csproj
  1. Generate the Merged Payloads for Helix locally:
./eng/common/msbuild.sh src/tests/Common/helixpublishwitharcade.proj -maxcpucount -bl -p:TargetArchitecture=x64 -p:TargetOS=Linux -p:TargetOSSubgroup= -p:Configuration=Release

Expected behavior

The Merged Payloads are generated in the same folder as the test builds.

Actual behavior

After running the last command, checking in under artifacts/tests/coreclr, there will be two variants of the same results folder:

  • Linux.x64.Release
  • linux.x64.Release

The test builds will be under linux and the Merged Payloads will be under Linux. Consequently, the Merged Payloads will be empty since no tests were found under that path.

Regression?

Yes, but according to the discussions in #80164 and other issues linked there, the lowercase behavior added in that PR is the one that the scripts ought to adopt.

Known Workarounds

Pass -p:TargetOS=linux instead of -p:TargetOS=Linux.

Configuration

No response

Other information

While this is not breaking by any means, at least for the time being, it can be very deceiving how many configuration options are case-insensitive (or are converted to a certain case behind curtains), and then suddenly one becomes case-sensitive. This confusion becomes more apparent when we consider the platform string is expected to be lower case, and all MSBuild properties are Pascal Case.

@ivdiazsa ivdiazsa added this to the 8.0.0 milestone Jan 25, 2023
@ivdiazsa ivdiazsa self-assigned this Jan 25, 2023
@ghost
Copy link

ghost commented Jan 25, 2023

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Recently, a conversation about making all platform ID's in build scripts lowercase was revived in PR #80164. However, the lack of uniformity can lead to unexpected and wrong behavior to unsuspecting developers passing flags directly to MSBuild when using other scripts, like for example eng/common/build.sh.

Reproduction Steps

See this example:

  1. Build CLR and Libs:
./build.sh -s clr+libs -c Release
  1. Generate the test layout and build some tests:
./src/tests/build.sh -x64 -release -generatelayoutonly
./src/tests/build.sh -x64 -release -test:JIT/Methodical/Methodical_d2.csproj
  1. Generate the Merged Payloads for Helix locally:
./eng/common/msbuild.sh src/tests/Common/helixpublishwitharcade.proj -maxcpucount -bl -p:TargetArchitecture=x64 -p:TargetOS=Linux -p:TargetOSSubgroup= -p:Configuration=Release

Expected behavior

The Merged Payloads are generated in the same folder as the test builds.

Actual behavior

After running the last command, checking in under artifacts/tests/coreclr, there will be two variants of the same results folder:

  • Linux.x64.Release
  • linux.x64.Release

The test builds will be under linux and the Merged Payloads will be under Linux. Consequently, the Merged Payloads will be empty since no tests were found under that path.

Regression?

Yes, but according to the discussions in #80164 and other issues linked there, the lowercase behavior added in that PR is the one that the scripts ought to adopt.

Known Workarounds

Pass -p:TargetOS=linux instead of -p:TargetOS=Linux.

Configuration

No response

Other information

While this is not breaking by any means, at least for the time being, it can be very deceiving how many configuration options are case-insensitive (or are converted to a certain case behind curtains), and then suddenly one becomes case-sensitive. This confusion becomes more apparent when we consider the platform string is expected to be lower case, and all MSBuild properties are Pascal Case.

Author: ivdiazsa
Assignees: ivdiazsa
Labels:

area-Infrastructure

Milestone: 8.0.0

@ViktorHofer
Copy link
Member

ViktorHofer commented Jan 25, 2023

Yes, but according to the discussions in #80164 and other issues linked there, the lowercase behavior added in that PR is the one that the scripts ought to adopt.

I tried to cover all possible cases and scripts in that PR but based on the huge number of files using the TargetOS property, I might have missed a place. @ivdiazsa as you assigned yourself, I assume you will send a fix?

Note that we have validation in MSBuild that makes sure that the TargetOS value is lowercased:

<Target Name="ValidateTargetOSLowercase"
Condition="!$(TargetOS.Equals($(TargetOS.ToLower()), StringComparison.InvariantCulture))">
<Error Text="The passed-in TargetOS property value '$(TargetOS)' must be lowercase." />
</Target>

Presumably the runtime tests don't import the repo infrastructure?

@ivdiazsa
Copy link
Member Author

I don't currently have a fix ready but I assigned myself because I'm willing to work on it. However, if you or anyone else has a fix ready, feel free to submit it.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 25, 2023
akoeplinger pushed a commit that referenced this issue Apr 26, 2023
Fixes #81141. In PR #80164, the build scripts were updated to always require and/or convert the MSBuild `TargetOS` property to lowercase. However, the _helixpublishwitharcade.proj_ file was not included in these efforts, which led to some confusing behavior and misplaced files, as described in issue #81141. This PR addresses and fixes that.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants