Description
openedon Oct 21, 2020
#1820 tried to exclude R2RDump from source-build, but it still got restored and its dependencies were still prebuilts.
I suspect that the new static restore might not be evaluating the projects the same way as they used to, preventing the ExcludeFromSourceBuild
property from working. I haven't looked very far into it, but I wonder if maybe the problem is that it isn't checking DotNetBuildFromSource
in the environment and we need to pass it in as a command, since RestoreTaskEx
is called something like this (newlines for clarity):
"/src/.dotnet/dotnet"
"/src/.dotnet/sdk/5.0.100-preview.8.20417.9/NuGet.Build.Tasks.Console.dll"
"CleanupAssetsForUnsupportedProjects=True;
NoCache=True;
Recursive=True"
"/src/.dotnet/sdk/5.0.100-preview.8.20417.9/MSBuild.dll"
"/src/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/Build.proj"
"ContinuousIntegrationBuild=true;
Configuration=Release;
RepoRoot=/src/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/;
Rebuild=false;
Test=false;
Pack=false;
IntegrationTest=false;
PerformanceTest=false;
RuntimeConfiguration=Release;
Subset=clr.tools+clr.runtime+clr.corelib+clr.nativecorelib+clr.packages;
TargetArchitecture=x64;
CMakeArgs=;
MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0;
PackagesDir=/src/packages/restored/;
PackageRid=centos.7-x64;
NoPgoOptimize=true;
KeepNativeSymbols=true;
RuntimeOS=centos.7;
DotNetPackageVersionPropsPath=/src/artifacts/obj/x64/Release/PackageVersions.props;
DotNetRestoreSourcePropsPath=/src/artifacts/obj/x64/Release/RestoreSources.props;
VersionsPropsPath=/src/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/eng/Versions.props;
DisableWarnForInvalidRestoreProjects=true;
__BuildPhase=SolutionRestore;
_NETCORE_ENGINEERING_TELEMETRY=Restore;
MSBuildRestoreSessionId=4d351d66-a832-485b-8465-698ff0f49b17;
RestoreUseStaticGraphEvaluation=true;
ExcludeRestorePackageImports=true"
It should have access the the env vars, though, so that might be a red herring.
It might just be that RestoreTaskEx
uses a completely new execution flow and doesn't care when Arcade tries to blank out the usual restore Targets.
Perhaps a way around this is to add to CollectPackageReferences
and remove out all package refs? (I believe RestoreTaskEx
will specifically evaluate this target because it's where a lot of custom refs happen.)
The current surefire workaround is to stop using ExcludeFromSourceBuild
for now and instead make more heavy-handed and perhaps unmergeable patches.
Related-seeming issues:
- Determine why ExcludeFromSourceBuild and test project exclusion has problems in SDK Determine why ExcludeFromSourceBuild and test project exclusion has problems in SDK #1717
- Arcade ExcludeFromSourceBuild and auto-exclusion issues Arcade ExcludeFromSourceBuild and auto-exclusion issues #1736
Metadata
Assignees
Labels
Type
Projects
Status
Backlog