Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Jan 17, 2020

  • on OSX, we get the version from the path
    • we return the version of currently running mono, as the first
      result
      • followed by mono with versions from mono --version=number
  • on linux/windows, we try to get the version from mono --version=number
    • if that fails, then we return the instance with 0.0.0.0

- on OSX, we get the version from the path
	- we return the version of currently running mono, as the first
	result
- on linux/windows, we try to get the version from `mono --version`
	- if that fails, then we return the instance with `0.0.0.0`
@radical radical requested review from AndyGerlicher, a2 and rainersigwald and removed request for a2 January 17, 2020 02:07
@radical
Copy link
Member Author

radical commented Jan 17, 2020

/cc @akoeplinger

yield break;
}

foreach(var dirPath in Directory.EnumerateDirectories(s_monoOSXBasePath))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really needs this? mono --version=number should work fine on OSX.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to using mono --version=number. On OSX, doing this for all the versions found.

if (_isRunningOnMono == null)
{
// There could be potentially expensive TypeResolve events, so cache IsMono.
// Also, VS does not host Mono runtimes, so turn IsMono off when msbuild is running under VS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you're just talking about VS on Windows right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@radical
Copy link
Member Author

radical commented Feb 4, 2020

@rainersigwald ping

@radical
Copy link
Member Author

radical commented Mar 11, 2020

@rainersigwald while I have your attention, ping ;)

radical and others added 3 commits December 10, 2020 13:52
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
@Forgind Forgind added this to the December 2020 milestone Dec 11, 2020
Copy link
Contributor

@Forgind Forgind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind moving the changes to find mono into a separate class/file?

@Forgind
Copy link
Contributor

Forgind commented Jan 4, 2021

Also, per #115 (comment), would you mind pulling in that PR and adding the check?

@radical radical requested a review from Forgind January 5, 2021 19:50
Copy link
Contributor

@Forgind Forgind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remember #82 (comment), but I think this is good!


// The path has a valid mono, but we can't find the version
// so, let's return the instance at least but with version 0.0.0
ver = new Version(0, 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this is better or it's better to not return it. Users could find it separately and register it anyway. @rainersigwald, thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge? Or are we waiting for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to wait for @rainersigwald's signoff. Also, would you mind adding the if-not-mono check discussed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, and fixed a bug introduced in the nuget PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably ok, let's just listen for feedback.

radical and others added 2 commits January 5, 2021 23:16
Co-authored-by: Forgind <Forgind@users.noreply.github.com>
Forgind and others added 4 commits January 6, 2021 13:19
Adds an overload to permit supplying additional paths in which to search for MSBuild assemblies beyond the default.

Uses this new overload to add the search path for NuGet assemblies for when in a VS install.

The latter fixes microsoft#86.
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Thanks for your patience on this!


// The path has a valid mono, but we can't find the version
// so, let's return the instance at least but with version 0.0.0
ver = new Version(0, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably ok, let's just listen for feedback.

- use RuntimeInformation.IsOSPlatform to detect OSX
@radical
Copy link
Member Author

radical commented Jan 8, 2021

Does <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" /> look correct?

</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is unfortunate. I told you to do this! But . . . it's really nice that the Locator package has no dependencies so you can use it basically anywhere. Unfortunately, this type wasn't added to .NET Framework until 4.7.1, so this reference is required to call it in a straightforward way, which makes the package slightly less easy to use.

I think we can call it via reflection instead to avoid that hard requirement--if the type/method is not available, it's not macOS!

@Forgind Forgind closed this Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants