Skip to content

Conversation

keveleigh
Copy link
Contributor

@keveleigh keveleigh commented Apr 25, 2019

Overview

Reported on Slack: opening the MRTK caused issues on non-Windows platforms (in this case, Mac).
This PR fixes most of them, but I'll need to get my hands on a Mac to repro the glTF-specific ones.

The fix: I moved the methods required by the interfaces outside of the Windows-platform #ifs, where possible, or created a second version for non-Windows platforms where not possible.

Report: https://holodevelopers.slack.com/archives/C2H4HT858/p1556141818234600

image
image

@keveleigh keveleigh requested a review from david-c-kline April 25, 2019 19:09
@keveleigh
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@keveleigh keveleigh requested a review from wiwei April 25, 2019 19:09
}

#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
/// <inheritdoc />

Choose a reason for hiding this comment

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

I would scope these tighter, inside the function; at least to avoid two function declarations, as when the signature changes we will hit this issue again if the second is forgotten to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was how I had it originally, to match the SpeechInputProvider, but I couldn't think of another way to resolve this warning without just defining a non-async version in the other function declaration:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I suppose I could define a no-op await or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to tighten the scope.

@andreiborodin
Copy link

In general, I like to scope the #if to as tight as possible, this way it eliminates issues when we change an API of another class that this class uses. Although in this case the majority of devs are on Windows, and we shouldn't have the issue, still a good practice.

Copy link

@andreiborodin andreiborodin left a comment

Choose a reason for hiding this comment

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

:shipit:

@StephenHodgson
Copy link
Contributor

I fixed this in my fork by making a base class for the dictation providers.

Then made the interface methods virtual and overrode them in the platform specific implementations.

Copy link
Contributor

@wiwei wiwei left a comment

Choose a reason for hiding this comment

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

:shipit:

@keveleigh
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@wiwei
Copy link
Contributor

wiwei commented Apr 25, 2019

By the way, was this verified directly on mac hardware or using that win->osx compiling extension thing?

@keveleigh
Copy link
Contributor Author

This one will only repro directly on mac hardware.
I haven't had access to a mac yet, but I reproduced the original issue with #ifs (since those were causing the problem in the first place).

@keveleigh keveleigh merged commit 79f4bd1 into microsoft:mrtk_development Apr 26, 2019
@keveleigh keveleigh deleted the fix-non-windows-platforms branch April 26, 2019 22:52
@keveleigh keveleigh added this to the Mixed Reality Toolkit 1905 milestone Jun 6, 2019
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.

4 participants