Skip to content

[release/8.0-staging] Remove reference / redistribution of externally provided packages in MSBuild tasks #113404

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

Merged

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Mar 12, 2025

Customer Impact

MSBuild tasks building in dotnet/runtime were referencing MSBuild packages and other nuget packages provided by MSBuild.
Some of these packages were out-of-date which triggered false-positive component-governance warnings. None of the tasks should ship these packages.
Some of the packages were from a different release band and were shipping in the product - resulting in us shipping unserviceable out-of-support binaries.
Reference all MSBuild provided packages as reference only and do not ship them.

Regression

No.

Testing

Build / unit testing. Binary / build artifact inspection. Applying private fix to VS 17.10 and testing publish of blazor app.

Risk

Low - changes here shouldn't cause much impact to shipping binaries - an exception was the WasmAppBuilder which was previously using 7.0 reflection libraries. It required changes to be compatible with the 8.0 libraries. We also had VS fix bindingRedirects for this library to match what's in MSBuild and ensure it can safely load tasks with the same libraries.

@Copilot Copilot AI review requested due to automatic review settings March 12, 2025 00:45
@ericstj ericstj requested review from sbomer and radical as code owners March 12, 2025 00:45
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 18 out of 18 changed files in this pull request and generated no comments.

@ghost ghost added the area-Build-mono label Mar 12, 2025
@ericstj ericstj requested review from steveisok and a team March 12, 2025 00:45
@ericstj
Copy link
Member Author

ericstj commented Mar 13, 2025

Seems like those WasmBuild failures might be related. Need to see what they look like.

@ericstj
Copy link
Member Author

ericstj commented Mar 13, 2025

@ilonatommy @lewing could you have a look at the wasm failures to tell me if they look like they are caused by this? I did modify some build tasks. Those test are doing builds, but I looked at logs and don't see any obvious assembly load failures which is what my change might cause.

@ilonatommy
Copy link
Member

ilonatommy commented Mar 13, 2025

these pinvoke failures with /p:EmccLinkOptimizationFlag=-O0 with AOT happen on net8 out of this PR, should be marked as known issue
(edit: the are caught by #104827, no new issue needed.)

SatelliteAssembliesTests are marked as known issue.

but these happen only on this PR.

Parameter types of pinvoke callback method 'System.Void SomeFunction1(System.Int32())' needs to be blittable

like in #92380.

I don't see a direct connection.

@ericstj
Copy link
Member Author

ericstj commented Mar 17, 2025

These tests are still failing on rerun so it does look like this change somehow caused it. I'm pulling down the tests locally to try a repro and see what's happening. It looks almost like it's not resolving the types correctly so it keeps them in System.Int32 form without recognizing they are value types that are blittable.

@ericstj
Copy link
Member Author

ericstj commented Mar 17, 2025

So it seems to be caused by removing System.Reflection.MetadataLoadContext.dll from Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.15\tasks\net8.0. This is odd because the version that was shipping there before was the 7.0.0 version. I would have expected the task to be fine to load the version that ships with the SDK under dotnet\sdk\<version>\System.Reflection.MetadataLoadContext.dll.

To further test this, once adding back the local copy of Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.15\tasks\net8.0\System.Reflection.MetadataLoadContext.dll and seeing the tests pass, I replaced that copy with the 8.0 copy from the SDK and they failed again. So this tells me that these tests will break when run with the latest S.R.MLC.

This is bad because the 7.0.0 version is no longer built nor supported.

@ericstj
Copy link
Member Author

ericstj commented Mar 17, 2025

@maraf @akoeplinger @lewing -- seems that you might have helped fix this previously in #97640 -- it may be related to S.R.MLC 8.0 supporting function pointers.

What should we backport to make these tests work correctly on the 8.0 S.R.MLC that's in the product (and allow us to remove the 7.0 version which is out of support).

@lewing
Copy link
Member

lewing commented Mar 18, 2025

The problem is that the code expects that path to throw and so it sees unexpected things when it doesn't. The code in 8 would take more extensive fixes to work properly in all the cases it will see now. I need to think about the best way to fix this.

@ericstj
Copy link
Member Author

ericstj commented Mar 24, 2025

It looks like Build Analysis is green now, do we take it? With the current content does it constitute a product change we need to take to tactics, or still infrastructure tell mode? @lewing

@akoeplinger
Copy link
Member

With the current content does it constitute a product change we need to take to tactics, or still infrastructure tell mode?

In theory the WasmAppBuilder changes should behave the same as before but it feels no longer like an infra change to me.

@ericstj
Copy link
Member Author

ericstj commented Mar 26, 2025

@akoeplinger / @lewing - can you please have a look at the servicing template added and make it correctly represent the changes / risk / testing to WasmAppBuilder? After that we can take it to tactics.

@ericstj ericstj mentioned this pull request Mar 26, 2025
@ericstj ericstj changed the title Use PackageDownloadAndReference for tasks [release/8.0-staging] Remove reference / redistribution of externally provided packages in MSBuild tasks Mar 31, 2025
@ericstj ericstj added the Servicing-consider Issue for next servicing release review label Apr 1, 2025
@carlossanlop
Copy link
Contributor

carlossanlop commented Apr 2, 2025

Ping @akoeplinger @lewing. The servicing branches are about to open.

Friendly reminder that code complete is on April 14th for the May Release. If you'd like to get this change included in that release, please get a Tactics approval and merge this PR before that date.

@akoeplinger
Copy link
Member

ah sorry, I replied to Eric on Teams. It looks good to me.

Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

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

LGTM for ILLink.Tasks

@rbhanda rbhanda added this to the 9.0.5 milestone Apr 3, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 3, 2025
@ericstj ericstj merged commit e480259 into dotnet:release/8.0-staging Apr 9, 2025
193 of 197 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2025
@leecow leecow modified the milestones: 9.0.5, 8.0.16 May 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Build-mono Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy