Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

MSBuildSdkResolver: resolve symlink for 'dotnet' binary - #7126

Merged
livarcocc merged 2 commits into
dotnet:masterfrom
akoeplinger:fix-linux-dotnet-symlink
Jul 12, 2017
Merged

livarcocc merged 2 commits into
dotnet:masterfrom
akoeplinger:fix-linux-dotnet-symlink

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

On Linux the dotnet installed by the dotnet-sdk packages is a symlink (/usr/bin/dotnet -> ../share/dotnet/dotnet).

We need to resolve the symlink so we're passing the path to the actual .NET Core installation to libhostfxr.

Fixes https://github.com/dotnet/cli/issues/7125

@dnfclas

dnfclas commented Jul 11, 2017

Copy link
Copy Markdown

@akoeplinger,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@livarcocc

Copy link
Copy Markdown

@nguerrera PTAL

{
internal static readonly bool RunningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

internal static string realpath (string path)

This comment was marked as spam.


internal static string realpath (string path)
{
var buffer = new StringBuilder(4096); // PATH_MAX from linux/limits.h

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@akoeplinger
akoeplinger force-pushed the fix-linux-dotnet-symlink branch from 1ff48fd to 5379832 Compare July 11, 2017 21:10
@livarcocc

Copy link
Copy Markdown

@dotnet-bot Test RHEL7.2 x64 Release Build

On Linux the dotnet installed by the dotnet packages is a
symlink (/usr/bin/dotnet -> ../share/dotnet/dotnet).

We need to resolve the symlink so we're passing the path to
the actual .NET Core installation to libhostfxr.

Fixes https://github.com/dotnet/cli/issues/7125
The .NET Standard build ships with Mono/msbuild.
@akoeplinger
akoeplinger force-pushed the fix-linux-dotnet-symlink branch from 5379832 to 600946c Compare July 12, 2017 14:37
@livarcocc livarcocc added this to the 2.1.0 milestone Jul 12, 2017
@livarcocc
livarcocc merged commit aacd49f into dotnet:master Jul 12, 2017
@akoeplinger
akoeplinger deleted the fix-linux-dotnet-symlink branch July 12, 2017 19:30
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.

Microsoft.DotNet.MSBuildSdkResolver doesn't resolve "dotnet" symlink on Linux

4 participants