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

Include STL/CRT libs and headers with LKG to eliminate yvals_core.h static_assert build errors on mismatch #4933

Merged
merged 15 commits into from
Dec 6, 2024

Conversation

Scottj1s
Copy link
Member

@Scottj1s Scottj1s commented Dec 3, 2024

When PR pipeline build agents take a Visual Studio update, the STL/CRT headers can become out of sync with the LKG toolset, causing this build error:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\yvals_core.h(902,1): Error C2338: static_assert failed: 'error STL1001: Unexpected compiler version, expected MSVC 19.41 or newer.'

This PR:

  • Ensures that the LKG and STL/CRT are a matched set (with workarounds, http://task.ms/55390787, http://task.ms/55390838)
  • Publishes binlogs for all operations, restore and build, success or fail (which should be our standard practice)
  • Renames BuildBinaries to BuildFoundation for clarity

Verified that all DLLs in transport package are still Hybrid CRT linked

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 3, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 3, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 3, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 4, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 4, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 4, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 4, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 5, 2024

/azp run

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 6, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s
Copy link
Member Author

Scottj1s commented Dec 6, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Scottj1s Scottj1s changed the title include STL/CRT libs/headers with LKG Include STL/CRT libs and headers with LKG to eliminate yvals_core.h static_assert build errors on mismatch Dec 6, 2024
Comment on lines +11 to +20
<!-- The LKG toolset only supports Platform=win32. To work around, we TreatAsLocalProperty=Platform above to
enable overriding the global (command-line) Platform, explicitly import LKG's custom.props, and restore Platform. -->
<PropertyGroup Condition="'$(Platform)'=='x86'">
<WorkaroundLkgWin32>true</WorkaroundLkgWin32>
<Platform>Win32</Platform>
</PropertyGroup>
<Import Project="custom.props" Condition="Exists('custom.props') and '$(WorkaroundLkgWin32)'=='true'" />
<PropertyGroup Condition="'$(WorkaroundLkgWin32)'=='true'">
<Platform>x86</Platform>
</PropertyGroup>
Copy link
Member Author

Choose a reason for hiding this comment

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

{
if ($AzureBuildStep -ne "all")
{
$env:NUGET_RESTORE_MSBUILD_ARGS = "/binaryLogger:BuildOutput\binlogs\$Label.restore.$Platform.$Configuration.binlog /p:Platform=$Platform /p:Configuration=$Configuration"
Copy link
Member Author

Choose a reason for hiding this comment

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

@Scottj1s Scottj1s requested review from kythant, alexlamtest and JesseCol and removed request for kythant and alexlamtest December 6, 2024 16:35
Comment on lines +7 to +8
<UseInternalMSUniCrtPackage>true</UseInternalMSUniCrtPackage>
<UndockedSettingsLoaded>true</UndockedSettingsLoaded>
Copy link
Member Author

Choose a reason for hiding this comment

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

the MsUCRT package requires explicit acknowledgement (opt in, on top of the yml task properties)

Comment on lines +24 to +26
includeUCRT: true
ucrtFeedPat: $(System.AccessToken)
platform: $(buildPlatform)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the essential change - include the UCRT (STL/CRT libs/headers) along with the tools

Copy link
Contributor

@alexlamtest alexlamtest left a comment

Choose a reason for hiding this comment

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

LGTM

@Scottj1s Scottj1s merged commit 0d7a920 into main Dec 6, 2024
26 checks passed
@Scottj1s Scottj1s deleted the user/sjones/lkg_ucrt branch December 6, 2024 21:34
godlytalias pushed a commit that referenced this pull request Dec 13, 2024
…tatic_assert build errors on mismatch (#4933)

* include STL/CRT libs/headers with LKG

* add platform

* opt into internal UCRT

* opt into undocked settings loaded

* publish binlogs on failure

* use lower case platform for LKG toolset

* treat Platform as local to allow override of x86 to win32 for LKG

* define GUID_NULL, publish binlog on binary build failure

* define GUID_NULL another way

* collect binlogs for nuget restores

* fix restore binlog name

* nuget restore with platform for LKG compat, renamed BuildBinaries to BuildFoundation for clarity

* setting platform to win32 has downstream effects - surgically wrapping LKG imports instead

* import MsUCRT x86 targets explicitly

* removed unnecessary LKG targets overrides
@Scottj1s Scottj1s restored the user/sjones/lkg_ucrt branch December 13, 2024 22:32
@Scottj1s Scottj1s deleted the user/sjones/lkg_ucrt branch December 13, 2024 22:37
Scottj1s added a commit that referenced this pull request Dec 13, 2024
…tatic_assert build errors on mismatch (#4933)

* include STL/CRT libs/headers with LKG

* add platform

* opt into internal UCRT

* opt into undocked settings loaded

* publish binlogs on failure

* use lower case platform for LKG toolset

* treat Platform as local to allow override of x86 to win32 for LKG

* define GUID_NULL, publish binlog on binary build failure

* define GUID_NULL another way

* collect binlogs for nuget restores

* fix restore binlog name

* nuget restore with platform for LKG compat, renamed BuildBinaries to BuildFoundation for clarity

* setting platform to win32 has downstream effects - surgically wrapping LKG imports instead

* import MsUCRT x86 targets explicitly

* removed unnecessary LKG targets overrides
Scottj1s added a commit that referenced this pull request Dec 14, 2024
* Include STL/CRT libs and headers with LKG to eliminate yvals_core.h static_assert build errors on mismatch (#4933)

* include STL/CRT libs/headers with LKG

* add platform

* opt into internal UCRT

* opt into undocked settings loaded

* publish binlogs on failure

* use lower case platform for LKG toolset

* treat Platform as local to allow override of x86 to win32 for LKG

* define GUID_NULL, publish binlog on binary build failure

* define GUID_NULL another way

* collect binlogs for nuget restores

* fix restore binlog name

* nuget restore with platform for LKG compat, renamed BuildBinaries to BuildFoundation for clarity

* setting platform to win32 has downstream effects - surgically wrapping LKG imports instead

* import MsUCRT x86 targets explicitly

* removed unnecessary LKG targets overrides

* Find custom.props in parent dir (#4946)

* Update LkgToolset.props

Fix build break - custom.props in parent directory

* Update LkgToolset.props
codendone pushed a commit that referenced this pull request Jan 10, 2025
…tatic_assert build errors on mismatch (#4933)

* include STL/CRT libs/headers with LKG

* add platform

* opt into internal UCRT

* opt into undocked settings loaded

* publish binlogs on failure

* use lower case platform for LKG toolset

* treat Platform as local to allow override of x86 to win32 for LKG

* define GUID_NULL, publish binlog on binary build failure

* define GUID_NULL another way

* collect binlogs for nuget restores

* fix restore binlog name

* nuget restore with platform for LKG compat, renamed BuildBinaries to BuildFoundation for clarity

* setting platform to win32 has downstream effects - surgically wrapping LKG imports instead

* import MsUCRT x86 targets explicitly

* removed unnecessary LKG targets overrides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants