Skip to content

Using dotnet SDK from PATH when global_json_has_runtimes #14096

Open
@tmds

Description

@tmds

arcade defaults to want to use the dotnet that is on PATH if it matches the global.json SDK version:

use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}

but that doesn't work when the global.json files has a tools.runtimes section:

arcade/eng/common/tools.sh

Lines 131 to 138 in 3fe889b

# Find the first path on $PATH that contains the dotnet.exe
if [[ "$use_installed_dotnet_cli" == true && $global_json_has_runtimes == false && -z "${DOTNET_INSTALL_DIR:-}" ]]; then
local dotnet_path=`command -v dotnet`
if [[ -n "$dotnet_path" ]]; then
ResolvePath "$dotnet_path"
export DOTNET_INSTALL_DIR=`dirname "$_ResolvePath"`
fi
fi

This is the case for aspnetcore: https://github.com/dotnet/aspnetcore/blob/480683e067ec01616eef758f8b0a4f968bf9fbee/global.json#L7C6-L7C14.

Could we extend this condition so that when DotNetBuildFromSource is set to true that the sdk on path does get used?
Does that make sense?

cc @MichaelSimons @premun

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions