-
Notifications
You must be signed in to change notification settings - Fork 133
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
First class support for overriding the arcade SDK version #3785
Comments
In the VMR PoC it was discovered that the SDK kept getting installed even when DOTNET_INSTALL_DIR was already specified. This was because SB was using _InitializeToolset to short circuit arcade and SDK initialization. This is a wider issue discussed in dotnet/source-build#3785. For now, align the behavior of non-Windows with Windows by allowing setting of the _InitializeToolset environment variable (using this to set the global). In addition, align the global variable name with the Nix variants.
MSBUILDADDITIONALSDKRESOLVERSFOLDER, MSBUILDADDITIONALSDKRESOLVERSFOLDER_NET, and MSBUILDADDITIONALSDKRESOLVERSFOLDER_NETFRAMEWORK may be some options here. |
Looks like these might be interesting: // These are overrides that are used to force the resolved SDK tasks and targets to come from a given
// base directory and report a given version to msbuild (which may be null if unknown. One key use case
// for this is to test SDK tasks and targets without deploying them inside the .NET Core SDK.
var msbuildSdksDirFromEnv = _getEnvironmentVariable(EnvironmentVariableNames.DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR);
var netcoreSdkVersionFromEnv = _getEnvironmentVariable(EnvironmentVariableNames.DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER); Looks like DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR can specify a directory where this resolver probes for Looking at the NuGet resolver, I'm not seeing any hooks, other than to disable it: Probably adding some resolver of our own that just probes a path might be the easiest thing to do. Ensure that resolver has a higher Priority than the built in ones to make sure it can take precedence. What might be better is if there was some resolver that had this behavior built in, so we could just specify an additional path to probe for SDKs and it would be preferred. I wonder what @rainersigwald or @dsplaisted might recommend |
|
This is already opened as part of #3781 closing here. |
We need better support for overriding the Arcade SDK version. There are at least two places where the arcade SDK version is used:
The issue here is that you want repos downstream of arcade to use the correct SDK when it shows up in a project file and the correct Tools/Build.proj. Otherwise you only used the arcade SDK partially. The way this works on Linux right now is that we unpack the arcade SDK to an explicit dir, and then set an environment variable
_InitializeToolset
to the Build.proj that is the build entry point. This appears to be because the bash behavior variable scoping will pick up environment variables ambiently. In powershell though, we scope most of these variables to global. This means that setting an outside envvar won't work. It will restore the wrong arcade and use the wrong entry point.This brings up a couple problems overall:
I think ideally, we would cover the build project case by offering a standard environment variable to control the arcade version (overriding global.json) alone. That would then cause the correct restore to happen and the project to launch.
Ideally this could be combined with a real solution for overriding the msbuild SDKs from msbuild's standpoint so that we could also avoid manually extracting msbuild SDK packages in SB/VB mode.
The text was updated successfully, but these errors were encountered: