Skip to content

Include the SDK tarball in poison checks #48550

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 2 commits into
base: main
Choose a base branch
from

Conversation

NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic NikolaMilosavljevic commented Apr 17, 2025

Fixes: dotnet/source-build#5052

We used to scan the sdk before, but this was regressed by some change in build infra. This PR adds the required DependsOnTarget attribute, that would ensure that SDK is present in the assets dir.

As we do not need to scan other tarballs in the assets dir, I've updated the pattern to only select the SDK tarball. We do not need to scan symbols tarballs. By explicitly including the SDK, the existing check will ensure that there are no regressions in the future.

This PR also updates the poison baseline to account for those discovered in the SDK. Tracking issue for fixing poisons: dotnet/source-build#5057

@Copilot Copilot AI review requested due to automatic review settings April 17, 2025 17:21
@NikolaMilosavljevic NikolaMilosavljevic requested review from a team as code owners April 17, 2025 17:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/SourceBuild/content/eng/finish-source-only.proj: Language not supported

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Apr 17, 2025
@NikolaMilosavljevic NikolaMilosavljevic changed the title Include SDK in poison checks Include the SDK tarball in poison checks Apr 17, 2025
<AssetToCheck Include="$(ArtifactsAssetsDir)*$(ArchiveExtension)" />
<AssetToCheck Remove="$(ArtifactsAssetsDir)$(SourceBuiltArtifactsTarballName)*" />
<!-- Include dotnet-sdk-*.tar.gz -->
<AssetToCheck Include="$(ArtifactsAssetsDir)dotnet-sdk-*$(ArchiveExtension)" />
Copy link
Member

@ViktorHofer ViktorHofer Apr 17, 2025

Choose a reason for hiding this comment

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

Do we need to use the (hardlink) copy instead of just $(SdkTarballPath)? The copy only exists as a convenience for SB partners:

<!-- Copy SDK archive to assets root as source-only build partners expect the file to be there. -->

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 model preserves an option to add more asset files in the future.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I'm following. The current include only matches on the SDK archive itself, not on other files.

Copy link
Member Author

@NikolaMilosavljevic NikolaMilosavljevic Apr 17, 2025

Choose a reason for hiding this comment

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

To clarify. Currently, this will only match the SDK. The intent is to preserve a possibility to expand AssetToCheck in the future, with additional files in source-build preferred root assets dir. Since we already copy (hard-link) the SDK to this directory, I'm keeping it consistent to reference the SDK from the same dir, using a pattern.

Copy link
Member

Choose a reason for hiding this comment

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

Does this list indicate that the product has a ton of poisoned artifacts? (i.e. SBRP)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not likely, as some of those are ref. assemblies and the rest are in netfx folders that aren't usable in source build.

I am investigating those issues at the moment. Will create a tracking issue as well.

<AssetToCheck Include="$(ArtifactsAssetsDir)*$(ArchiveExtension)" />
<AssetToCheck Remove="$(ArtifactsAssetsDir)$(SourceBuiltArtifactsTarballName)*" />
<!-- Include dotnet-sdk-*.tar.gz -->
<AssetToCheck Include="$(ArtifactsAssetsDir)dotnet-sdk-*$(ArchiveExtension)" />
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding an Error Task that throws when AssetToCheck is empty so that this doesn't regress easily again.

Copy link
Member Author

Choose a reason for hiding this comment

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

We already have it:

<Error Condition="'@(AssetToCheck)' == ''" Text="No assets will be poison checked - this is unexpected!" />

It wasn't failing before due to us collecting 2 symbols tarballs, so AssetToCheck wasn't empty.

Copy link
Member

Choose a reason for hiding this comment

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

Right. You could change this to verify that the sdk archive is included.

Copy link
Member

Choose a reason for hiding this comment

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

Example:

<SdkArchive Include="..." />
<Error Condition="'@(SdkArchive)' == ''" Text="eRROR" />
<AssetToCheck Include="@(SdkArchive)" />

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll add that. It doesn't hurt to have this specific check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will get rid of AssetToCheck items and only have SdkArchive - we can add additional asset files if we need them in the future. Being explicit makes sense here. I will continue to obtain the SDK archive from source-build specific location.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with 3cd22d9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poison infra is not scanning the SDK tarball
3 participants