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

openSUSE - upgrade using 'zypper up' command upgrades 3.1 host to 6.0 and removes 'dotnet' command #61849

Closed
NikolaMilosavljevic opened this issue Nov 19, 2021 · 5 comments · Fixed by #62455

Comments

@NikolaMilosavljevic
Copy link
Member

Dotnet-host package is built with version-agnostic package name, which causes an issue when upgrading, for instance 3.1 host to latest. 6.0 host will be installed and 'dotnet' command will be missing.

rpm -q --queryformat "name: %{NAME}, version: %{VERSION}" https://packages.microsoft.com/sles/15/prod/dotnet-host-6.0.0-x64.rpm
warning: https://packages.microsoft.com/sles/15/prod/dotnet-host-6.0.0-x64.rpm: Header V4 RSA/SHA256 Signature, key ID be1229cf: NOKEY
name: dotnet-host, version: 6.0.0

Dotnet-host package is intentionally built as version-agnostic, see relevant infra:

<VersionInstallerName>false</VersionInstallerName>

https://github.com/dotnet/arcade/blob/97463777ee9a8445d4a4c5911ede0f0cd71fa8aa/src/Microsoft.DotNet.Build.Tasks.Installers/build/installer.singlerid.targets#L99

Upgrading to latest host version should not remove 'dotnet' command.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 19, 2021
@NikolaMilosavljevic
Copy link
Member Author

I've confirmed this issue on openSUSE and other RPM-based distros (i.e. CentOS). It is a regression.

In .NET 3.1 and 5.0 we were creating a dotnet symlink in /usr/bin:

<Exec Command="ln -sf &quot;/$(UsrShareDotnetPath)dotnet&quot; &quot;$(rpmLayoutUsrBinDir)dotnet&quot;" />

In 6.0 after infra refactoring we had a bug where we weren't setting any symlinks. Later we fixed it to create symlink in an after-install.sh script:

ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

However, new symlink is created in /usr/local/bin. To get dotnet command working, one needs to open a new shell window:

It's unclear why we ended up with /usr/local/bin instead of /usr/bin.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 6, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 7, 2021
@NikolaMilosavljevic
Copy link
Member Author

The workaround is to create a symlink using the following command:

ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet

@NikolaMilosavljevic NikolaMilosavljevic removed the untriaged New issue has not been triaged by the area owner label Dec 8, 2021
@am11
Copy link
Member

am11 commented Dec 8, 2021

It's unclear why we ended up with /usr/local/bin instead of /usr/bin.

The installer can cleanup the existing symlinks in both known locations and create the new one.

@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Dec 16, 2021
@dcermak
Copy link

dcermak commented Jan 12, 2022

Dotnet-host package is intentionally built as version-agnostic, see relevant infra:

Why is that the case? From an outsider's PoV it doesn't make a lot of sense to have everything versioned except for the main package which will just freely upgrade to the latest .Net version.

@NikolaMilosavljevic
Copy link
Member Author

The original issue was fixed in January.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants