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

Investigate ExcludeFromSourceBuild not working in dotnet/runtime #1825

Open
dagood opened this issue Oct 21, 2020 · 1 comment
Open

Investigate ExcludeFromSourceBuild not working in dotnet/runtime #1825

dagood opened this issue Oct 21, 2020 · 1 comment
Labels
area-infra Source-build infrastructure and reporting area-patch-removal Removing patches for contributing repos from source-build

Comments

@dagood
Copy link
Member

dagood commented 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:

@dagood dagood added area-patch-removal Removing patches for contributing repos from source-build area-infra Source-build infrastructure and reporting labels Oct 21, 2020
@dagood
Copy link
Member Author

dagood commented Dec 23, 2020

I spotted in a dotnet/runtime PR that it appears to actually be possible to generate static restore binlogs! We can probably use that to nail down the root cause here. dotnet/runtime#46270

+    <GenerateRestoreUseStaticGraphEvaluationBinlog>true</GenerateRestoreUseStaticGraphEvaluationBinlog>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infra Source-build infrastructure and reporting area-patch-removal Removing patches for contributing repos from source-build
Projects
Status: Backlog
Development

No branches or pull requests

3 participants