Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: https://docs.microsoft.com/dotnet/core/tools/dotnet-install-script

The use-dot-net.yaml template is leaving behind old installations of
.NET 5:

$ dotnet --list-sdks
3.1.201 [/Users/builder/.dotnet/sdk]
5.0.100-preview.6.20265.2 [/Users/builder/.dotnet/sdk]
5.0.100-preview.7.20307.3 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20365.11 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20411.10 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20414.5 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20426.3 [/Users/builder/.dotnet/sdk]
5.0.100-rc.2.20458.11 [/Users/builder/.dotnet/sdk]

We are currently using dotnet-install.sh or dotnet-install.ps1 to
install nightly builds of .NET 5. These scripts basically download a
.zip file and extract them.

I added a new remove_dotnet parameter to delete the dotnet
directory completely. This will ensure we only have the versions of
.NET Core 3.x and .NET 5 specified in our build definition.

Usage would look like:

- template: yaml-templates/use-dot-net.yaml
  parameters:
    version: $(DotNetCorePreviewVersion)
    remove_dotnet: true
- template: yaml-templates/use-dot-net.yaml
  parameters:
    version: $(DotNetCoreVersion)

Simply deleting the directories is similar to what this script is
doing here:

https://github.com/dotnet/sdk/blob/feae865a0614026d72ed9a9558d0111e5fcd5765/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh#L35

Context: https://docs.microsoft.com/dotnet/core/tools/dotnet-install-script

The `use-dot-net.yaml` template is leaving behind old installations of
.NET 5:

    $ dotnet --list-sdks
    3.1.201 [/Users/builder/.dotnet/sdk]
    5.0.100-preview.6.20265.2 [/Users/builder/.dotnet/sdk]
    5.0.100-preview.7.20307.3 [/Users/builder/.dotnet/sdk]
    5.0.100-rc.1.20365.11 [/Users/builder/.dotnet/sdk]
    5.0.100-rc.1.20411.10 [/Users/builder/.dotnet/sdk]
    5.0.100-rc.1.20414.5 [/Users/builder/.dotnet/sdk]
    5.0.100-rc.1.20426.3 [/Users/builder/.dotnet/sdk]
    5.0.100-rc.2.20458.11 [/Users/builder/.dotnet/sdk]

We are currently using `dotnet-install.sh` or `dotnet-install.ps1` to
install nightly builds of .NET 5. These scripts basically download a
`.zip` file and extract them.

I added a new `remove_dotnet` parameter to delete the `dotnet`
directory completely. This will ensure we only have the versions of
.NET Core 3.x and .NET 5 specified in our build definition.

Usage would look like:

    - template: yaml-templates/use-dot-net.yaml
      parameters:
        version: $(DotNetCorePreviewVersion)
        remove_dotnet: true
    - template: yaml-templates/use-dot-net.yaml
      parameters:
        version: $(DotNetCoreVersion)

Simply deleting the directories is similar to what this script is
doing here:

https://github.com/dotnet/sdk/blob/feae865a0614026d72ed9a9558d0111e5fcd5765/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh#L35
@jonpryor jonpryor merged commit 3a067cc into dotnet:master Sep 10, 2020
@jonathanpeppers jonathanpeppers deleted the dotnet-install-cleanup branch September 10, 2020 21:03
jonpryor pushed a commit that referenced this pull request Sep 17, 2020
Context: https://docs.microsoft.com/dotnet/core/tools/dotnet-install-script

The `use-dot-net.yaml` template is leaving behind old installations
of .NET 5:

	$ dotnet --list-sdks
	3.1.201 [/Users/builder/.dotnet/sdk]
	5.0.100-preview.6.20265.2 [/Users/builder/.dotnet/sdk]
	5.0.100-preview.7.20307.3 [/Users/builder/.dotnet/sdk]
	5.0.100-rc.1.20365.11 [/Users/builder/.dotnet/sdk]
	5.0.100-rc.1.20411.10 [/Users/builder/.dotnet/sdk]
	5.0.100-rc.1.20414.5 [/Users/builder/.dotnet/sdk]
	5.0.100-rc.1.20426.3 [/Users/builder/.dotnet/sdk]
	5.0.100-rc.2.20458.11 [/Users/builder/.dotnet/sdk]

We are currently using `dotnet-install.sh` or `dotnet-install.ps1` to
install nightly builds of .NET 5.  These scripts basically download a
`.zip` file and extract them.

I added a new `remove_dotnet` parameter to delete the `dotnet`
directory completely. This will ensure we only have the versions of
.NET Core 3.x and .NET 5 specified in our build definition.

Usage would look like:

	- template: yaml-templates/use-dot-net.yaml
	  parameters:
	    version: $(DotNetCorePreviewVersion)
	    remove_dotnet: true
	- template: yaml-templates/use-dot-net.yaml
	  parameters:
	    version: $(DotNetCoreVersion)

Simply deleting the directories is similar to what the
[`dotnet-uninstall-pkgs.sh`][0] script does.

[0]: https://github.com/dotnet/sdk/blob/feae865a0614026d72ed9a9558d0111e5fcd5765/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh#L35
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants