Skip to content

Consume cDac package and other cleanup #5482

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mikem8361
Copy link

Create a InstallNativePackages.proj that downloads the native diasymreader and cdac packages

Add InstallNativePackages to native-prereqs.proj

Move the native binary copies out of the build.sh/build-native.cmd scripts to the appropriate managed project

Move the rest of the binary copying from the cmake files to the managed projects

Switch the Windows native builds to use ninja. Add the -msbuild/-ninja build-native.cmd options.

@mikem8361 mikem8361 requested a review from hoyosjs May 13, 2025 19:01
@mikem8361 mikem8361 self-assigned this May 13, 2025
@mikem8361 mikem8361 requested a review from a team as a code owner May 13, 2025 19:01
@mikem8361
Copy link
Author

@hoyosjs I'll still except and apply any feedback you have for this PR.

@mikem8361
Copy link
Author

mikem8361 commented May 19, 2025

I can't see the failure details anymore. How do other outside dev's figure out the failure details?

Mike McLaughlin added 2 commits May 29, 2025 09:38
Create a InstallNativePackages.proj that downloads the native diasymreader and cdac packages

Add InstallNativePackages to native-prereqs.proj

Move the native binary copies out of the build.sh/build-native.cmd scripts to the appropriate managed project

Move the rest of the binary copying from the cmake files to the managed projects

Switch the Windows native builds to use ninja. Add the -msbuild/-ninja build-native.cmd options.
@@ -5,6 +5,9 @@
cmake_minimum_required(VERSION 3.15)

cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default.
if(CLR_CMAKE_HOST_WIN32)
cmake_policy(SET CMP0177 NEW) # install() paths are normalized
Copy link
Member

Choose a reason for hiding this comment

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

nit: Any reason no to normalize everywhere

Copy link
Author

Choose a reason for hiding this comment

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

This is just to stop the warning on Windows. It is fine on other build platforms

Copy link
Member

Choose a reason for hiding this comment

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

I've seen it in newer linux versions of the containers.

@hoyosjs hoyosjs closed this Jun 18, 2025
@hoyosjs hoyosjs reopened this Jun 18, 2025
<PropertyGroup Condition="'$(TargetRid)' == ''">
<TargetRidOS>$(TargetOS)</TargetRidOS>
<TargetRidOS Condition="'$(TargetOS)' == 'Windows_NT'">win</TargetRidOS>
<TargetRid>$(TargetRidOS)-$(TargetArch)</TargetRid>
Copy link
Member

Choose a reason for hiding this comment

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

Won't this give us linux-x64 on musl? I remember mike having to use this for a case, but not sure if it's doing what's expected.

Copy link
Member

Choose a reason for hiding this comment

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

This won't apparently break obviously since it gets funneled down from buildnative. This does mean something like dotnet build <project> won't work in linux-musl

Copy link
Author

Choose a reason for hiding this comment

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

TargetRid is set by the build native script so yes dotnet build <project> doesn't work. This does assume everything is built with our build.sh/build.ps1 scripts.

Comment on lines +8 to +10
if(CLR_CMAKE_HOST_WIN32)
cmake_policy(SET CMP0177 NEW) # install() paths are normalized
endif(CLR_CMAKE_HOST_WIN32)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(CLR_CMAKE_HOST_WIN32)
cmake_policy(SET CMP0177 NEW) # install() paths are normalized
endif(CLR_CMAKE_HOST_WIN32)
if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW) # install() paths are normalized
endif(POLICY CMP0177)

@@ -257,7 +247,9 @@ if [[ "$__InstallRuntimes" == 1 || "$__PrivateBuild" == 1 ]]; then
/t:InstallTestRuntimes \
Copy link
Member

Choose a reason for hiding this comment

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

We should log an issue - deleting .dotnet-test every build feels unnecessary for dev inner loop.

Copy link
Author

Choose a reason for hiding this comment

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

I don't think the InstallTestRuntimes target deletes .dotnet-test every time.

Copy link
Member

Choose a reason for hiding this comment

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

Line 244 of this script does

<!--
Copies all the native binaries to a rid-specific directory under the output and publish paths.
-->
<Target Name="InstallNativeFiles" AfterTargets="Build">
Copy link
Member

Choose a reason for hiding this comment

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

This likely should be pulled out to sos-packaging.targets. Another question is - what's using them from the publish sub directory? It's not a regular publish since this would break given it's just depending on build. This also means incrementality might be broken - After/Before always run.

@@ -43,6 +43,30 @@
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>f5705c8f4c5079bba77bae8698ba1583bde0388c</Sha>
</Dependency>
<Dependency Name="runtime.win-x64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.5.25261.1">
<Uri>https://github.com/dotnet/runtime</Uri>
Copy link
Member

Choose a reason for hiding this comment

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

We should move these references to point to the VMR and take the latest

@@ -14,6 +14,10 @@
<AssemblyName>.NET Diagnostics</AssemblyName>
</PropertyGroup>

<Target Name="BuildPrereqs"
BeforeTargets="Build"
DependsOnTargets="GenerateRuntimeVersionFile;InstallNativePackages" />
Copy link
Member

Choose a reason for hiding this comment

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

May be cleaner to redefine build after the import of the notargets at the end of the file.

<!--
Copies all the native binaries to a rid-specific directory under the output and publish paths.
-->
<Target Name="InstallNativeFiles" AfterTargets="Build">
Copy link
Member

Choose a reason for hiding this comment

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

Can we please make these be

Suggested change
<Target Name="InstallNativeFiles" AfterTargets="Build">
<Target Name="InstallNativeFiles" AfterTargets="AfterBuild">

At least this solves the build incrementality issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants