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

Update windows build machines #65798

Closed
wants to merge 7 commits into from

Conversation

agocke
Copy link
Member

@agocke agocke commented Feb 23, 2022

Two changes: removes vs2019 in favor of vs2022

Removes 19H1 in favor of 21H1, as 19H1 is being expired.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@@ -54,7 +54,7 @@ jobs:
# If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are in eng/common.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops

@ghost
Copy link

ghost commented Feb 24, 2022

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

Issue Details

Two changes: removes vs2019 in favor of vs2022

Removes 19H1 in favor of 21H1, as 19H1 is being expired.

Author: agocke
Assignees: agocke
Labels:

area-Infrastructure

Milestone: -

@AndyAyersMS
Copy link
Member

Seems like updating to VS2022 wasn't sufficient? The build error is still there in the Build Cross OS Linux DAC for Windows task

** Visual Studio 2022 Developer Command Prompt v17.0.6
...
[1/441] Building C object pal\src\libunwind\src\CMakeFiles\libunwind_xdac.dir\aarch64\Gtrace.c.obj
FAILED: pal/src/libunwind/src/CMakeFiles/libunwind_xdac.dir/aarch64/Gtrace.c.obj 
C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1430~1.307\bin\Hostx86\x64\cl.exe  /nologo -DBUILDENV_CHECKED=1 -DCROSS_COMPILE -DDEBUG -DDISABLE_CONTRACTS -DHAVE_CONFIG_H=1 -DHAVE_UNW_GET_ACCESSORS -DHAVE___THREAD=0 -DHOST_64BIT -DHOST_AMD64 -DHOST_WINDOWS -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_STRING=\"\" -DTARGET_64BIT -DTARGET_ARM64 -DTARGET_LINUX -DTARGET_UNIX -DUNW_REMOTE_ONLY -DURTBLDENV_FRIENDLY=Checked -D_CRT_SECURE_NO_WARNINGS -D_DBG -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_Thread_local="" -D__aarch64__ -D__linux__ -Ipal\src\libunwind\src -ID:\a\_work\1\s\src\coreclr\pal\src\libunwind\src -ID:\a\_work\1\s\src\native -ID:\a\_work\1\s\src\coreclr\pal\src\libunwind\include\tdep -ID:\a\_work\1\s\src\coreclr\pal\src\libunwind\include -Ipal\src\libunwind\include\tdep -Ipal\src\libunwind\include -ID:\a\_work\1\s\src\coreclr\pal\src\libunwind\include\win /DWIN32 /D_WINDOWS  /guard:cf /guard:ehcont -MTd   /O2 /nologo /W3 /WX /Oi /Oy- /Gm- /Zp8 /Gy /GS /fp:precise /FC /MP /Zm200 /Zc:strictStrings /Zc:wchar_t /Zc:inline /Zc:forScope /wd4065 /wd4100 /wd4127 /wd4189 /wd4200 /wd4201 /wd4245 /wd4291 /wd4456 /wd4457 /wd4458 /wd4733 /wd4838 /wd4960 /wd4961 /wd5105 /we4007 /we4013 /we4102 /we4551 /we4700 /we4640 /we4806 /w34092 /w34121 /w34125 /w34130 /w34132 /w34212 /w34530 /w35038 /w44177 /Zi /ZH:SHA_256 /source-charset:utf-8 /TC /permissive- -wd4068 -wd4146 -wd4244 -wd4267 -wd4334 -wd4311 -wd4475 -wd4477 /showIncludes /Fopal\src\libunwind\src\CMakeFiles\libunwind_xdac.dir\aarch64\Gtrace.c.obj /Fdpal\src\libunwind\src\CMakeFiles\libunwind_xdac.dir\ /FS -c D:\a\_work\1\s\src\coreclr\pal\src\libunwind\src\aarch64\Gtrace.c
D:\a\_work\1\s\src\coreclr\pal\src\libunwind\include\libunwind-aarch64.h(198): error C2061: syntax error: identifier 'alignas'
D:\a\_work\1\s\src\coreclr\pal\src\libunwind\include\libunwind-aarch64.h(199): error C2059: syntax error: '}'
D:\a\_work\1\s\src\coreclr\pal\src\libunwind\include\libunwind-aarch64.h(215): error C2079: 'uc_mcontext' uses undefined struct 'unw_sigcontext'

@AndyAyersMS
Copy link
Member

Problematic line is:

	alignas(16) uint8_t __reserved[(66 * 8)];

We're including the right header <stdalign.h> so not clear what is wrong yet. Will need to look at preprocessor output.

@agocke
Copy link
Member Author

agocke commented Feb 24, 2022

I tried to repro this failure locally and had no luck on my win10 machine with vs2022 P1. The compiler on my machine is older though, so it might just be in an even more recent preview.

@jkotas
Copy link
Member

jkotas commented Feb 24, 2022

We're including the right header <stdalign.h> so not clear what is wrong yet.

stdalign.h comes from Windows SDK (e.g. C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt). Maybe we are using a bad Windows SDK version on CI machines?

@AndyAyersMS
Copy link
Member

My local build is fine too.

CI log shows CMake was able to find <stdalign.h> but not clear which version.

-- Looking for include file stdalign.h
-- Looking for include file stdalign.h - found

@AndyAyersMS
Copy link
Member

Also possibly relevant: #56811.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 24, 2022

We're including the right header <stdalign.h> so not clear what is wrong yet.

stdalign.h comes from Windows SDK (e.g. C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt). Maybe we are using a bad Windows SDK version on CI machines?

There was an image rollout yesterday that caused other issues with WinSDK, so entirely possible.

@agocke
Copy link
Member Author

agocke commented Feb 24, 2022

Looks like this is happening in main as well: https://dev.azure.com/dnceng/public/_build/results?buildId=1629951&view=results

Probably a Windows SDK update issue

@janvorli
Copy link
Member

The stdalign.h that's included there should be one that we generate if we don't find one. I could see in a ci failure that we have not found one on the system. So we should have generated a fake one and included it. For some reason, the CI build didn't find it. My local build also doesn't find it, generates one and it works.

@janvorli
Copy link
Member

Ah, I can see something - on my machine, the stdalign.h was not found. However, in the CI, the stdalign.h was found (contrary to what I've said before), however in both cases the "HAVE_STDALIGN_ALIGNAS - Failed". So what happens is that the stdalign.h that's new in the SDK doesn't have the alignas in it, so when we generate the stdalign.h, the one from the SDK gets included and the alignas is missing.

@AndyAyersMS
Copy link
Member

You might take a look at #56811 because there is some cmake policy to ensure the cmake scouting and build use the same options and such.

@agocke
Copy link
Member Author

agocke commented Feb 24, 2022

@janvorli So you'd be comfortable with a fix where we add this to fakestdalign.h? It sounds like this might be failing in servicing as well, so we'd have to port that change back quite a ways.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 24, 2022

should the fake check be changed from header exists to a check source compiles?

@janvorli
Copy link
Member

@janvorli So you'd be comfortable with a fix where we add this to fakestdalign.h?

I guess I've not explained it properly. The fakestdalign.h.in contains the alignas definition, we generate the stdalign.h from it, but since the stdalign.h is now also in the SDK, the SDK one is included first. And that one doesn't have the alignas in it (I guess, it seems to be the only explanation)

@agocke
Copy link
Member Author

agocke commented Feb 24, 2022

I see, so we won't generate it at all, if one is present already? Or at least we won't include the one we generate?

@hoyosjs
Copy link
Member

hoyosjs commented Feb 24, 2022

I see, so we won't generate it at all, if one is present already?

We don't generate if there's an stdalign header, that doesn't guarantee the function exists.

@agocke
Copy link
Member Author

agocke commented Feb 24, 2022

Gotcha. Is there any way to not include the system one and use our own?

@hoyosjs
Copy link
Member

hoyosjs commented Feb 24, 2022

My thinking is we should have a check_source_compiles instead of header exists. If it doesn't compile, then generate the header to have the def.

@janvorli
Copy link
Member

I don't think any of these would work. Since the SDK one doesn't have the alignas defined and we need one.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 24, 2022

Haven't we been faking it this whole time though?

@janvorli
Copy link
Member

So I think the way is to define the alignas macro in the CMakeLists.txt as compiler define in case it was not found.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 25, 2022

And even worse: CI is using the one dynamically obtainedL D:\a_work\1\s\native-tools\bin\cmake.exe -> the one in global.json

@jkotas
Copy link
Member

jkotas commented Feb 25, 2022

Delete the global.json entry for cmake and just use the one that comes with VS? No workarounds for old cmake necessary.

@agocke
Copy link
Member Author

agocke commented Feb 25, 2022

Are the ARM64 machines running VS? Notably this is only happening on ARM, so I wonder if that's why they have a different CMake version.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 25, 2022

Yes - the global.json one was creating the issues and I just repro'd. The native-dependencies install feature in arcade is being deprecated anyway, so maybe we should just remove native deps from there?

@agocke
Copy link
Member Author

agocke commented Feb 25, 2022

Yes - the global.json one was creating the issues and I just repro'd. The native-dependencies install feature in arcade is being deprecated anyway, so maybe we should just remove native deps from there?

That sounds fine to me. We'll just have to confirm that the ARM machines have an up to date version ready to go.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 25, 2022

Delete the global.json entry for cmake and just use the one that comes with VS? No workarounds for old cmake necessary.

Looks like Jan got to it before I did :)

Are the ARM64 machines running VS? Notably this is only happening on ARM, so I wonder if that's why they have a different CMake version.

No, we always build on Windows x64, same hosts and image/tooling. It's more likely that there's plenty defines in the library that change the use of alignas depending on the architecture targeted.

@am11
Copy link
Member

am11 commented Feb 25, 2022

Ah, it was not the issue. Now /std:c11 is showing up in that line from logs, but the compilation still failed in the CI.

@AndyAyersMS
Copy link
Member

Seems like progress though -- now we have too many definitions instead of too few:

D:\a\_work\1\s\artifacts\obj\coreclr\Linux.arm64.Checked\crossgen\pal\src\libunwind\include\config.h(26): error C2220: the following warning is treated as an error
D:\a\_work\1\s\artifacts\obj\coreclr\Linux.arm64.Checked\crossgen\pal\src\libunwind\include\config.h(26): warning C4005: 'alignas': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\stdalign.h(21): note: see previous definition of 'alignas'

@hoyosjs
Copy link
Member

hoyosjs commented Feb 25, 2022

So the builds passed with that, but there's a lot of tests failing. Not sure if it's the change of queue (so a compiler version change) or the change in cmake logic. I think it's best to split the two changes to unblock other PRs

@am11
Copy link
Member

am11 commented Feb 25, 2022

For wasm build failure, I think it can be fixed by adding this line:

<_MonoCMakeBuildCommand Condition="'$(TargetsBrowser)' == 'true' and '$(HostOS)' == 'windows'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; &amp;&amp; $(_MonoCMakeBuildCommand)</_MonoCMakeBuildCommand>

after this one:

<_MonoCMakeBuildCommand Condition="'$(TargetsBrowser)' != 'true' and '$(HostOS)' == 'windows'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; $(_CompilerTargetArch) &amp;&amp; cd /D &quot;$(MonoObjDir)&quot; &amp;&amp; @(_MonoBuildEnv, ' ') $(_MonoCMakeBuildCommand)</_MonoCMakeBuildCommand>

The effective _MonoCMakeBuildCommand on wasm was expecting that cmake is in PATH (global.json mechanism made sure of that which was deleted in last commit), but elsewhere in this file, we are not relying on that assumption and calling init-vs-env to ensure needed prerequisites are present.

cc @lambdageek


x64 failure is something to do with change in .yml files:

.packages\microsoft.dotnet.helix.sdk\7.0.0-beta.22122.3\tools\Microsoft.DotNet.Helix.Sdk.MonoQueue.targets(46,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) Helix API does not contain an entry for Windows.10.Amd64.Server21H1.ES.Open

Should it be Windows.Amd64.Server2022.Open? that one seems to be available.

@agocke
Copy link
Member Author

agocke commented Feb 25, 2022

Still working through queue updates -- looks like there's no replacement for the ES queues yet, so I'll just end up reverting those changes. I think the PR to take through first is #65901

@akoeplinger
Copy link
Member

The Windows.10.Amd64.Server2022.ES.Open queue should be available now

@danmoseley
Copy link
Member

Rebased so that hopefully we can merge this.

@danmoseley
Copy link
Member

@hoyosjs any reason we shouldn't merge this (if green)?

@hoyosjs
Copy link
Member

hoyosjs commented Apr 16, 2022

It will conflict with the arcade update. I'm happy to say merge this and then we will resolve conflicts.

@hoyosjs
Copy link
Member

hoyosjs commented Apr 16, 2022

Actually - this one needs to be in the monthly rollouts. It drops support for vs 2019.

@danmoseley
Copy link
Member

Right, but my interpretation of comments on the other one is that VS2022 / Dev17.4 is required to change the CL errors to warnings.

@hoyosjs
Copy link
Member

hoyosjs commented Apr 16, 2022

We will probably have to fold this one into that one, but yeah

@hoyosjs
Copy link
Member

hoyosjs commented Apr 16, 2022

I've folded all these changes onto that one. I'll close this one.

@hoyosjs hoyosjs closed this Apr 16, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants