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

[msbuild] Provide the correct value for the operating system for tvOS and watchOS to a few tasks. Fixes #6200. #7226

Merged
merged 5 commits into from
Oct 16, 2019

Conversation

rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Oct 14, 2019

The problem with #6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

Also a minor improvement to some related tests so that their execution is not affected by VSfM's environment.

Fixes #6200.

… and watchOS to a few tasks. Fixes xamarin#6200.

The problem with xamarin#6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

Fixes xamarin#6200.
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Oct 14, 2019
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

1 tests failed, 88 tests passed.

Failed tests

  • MTouch tests/NUnit: BuildFailure

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

1 tests failed, 88 tests passed.

Failed tests

  • monotouch-test/watchOS 32-bits - simulator/Debug: Crashed

@rolfbjarne
Copy link
Member Author

Test failure is unrelated

msbuild/Xamarin.MacDev.Tasks.Core/Tasks/MetalTaskBase.cs Outdated Show resolved Hide resolved
@@ -82,6 +84,7 @@ public void CheckToolBinDir (string taskName, string binDirToCheck)
RedirectStandardError = true,
};
psi.EnvironmentVariables.Add ("DEVELOPER_DIR", Configuration.xcode_root);
psi.EnvironmentVariables.Remove ("XCODE_DEVELOPER_DIR_PATH"); // VSfM sets XCODE_DEVELOPER_DIR_PATH, which confuses the command-line tools if it doesn't match xcode-select, so just unset it.
Copy link
Contributor

Choose a reason for hiding this comment

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

that change is not mentioned in the commit message

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't that cause problems in VSM? We need to make sure it resets it if needed or maybe tell the VSM team to not set it at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

This problem occurs when running tests from within VSfM, and those tests inherit VSfM's environment, and this variable causes trouble when running Apple's command line tools if it doesn't match what xcode-select says - it will never be a problem for VSfM because that environment is not affected by this change.

It's already filed here: #3931

Copy link
Member Author

Choose a reason for hiding this comment

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

PR description has been updated.

Log.LogError ($"Unknown target framework identifier: {TargetFrameworkIdentifier}.");
return string.Empty;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

That block is repeated 3 times (not DRY)
Can it be moved into a (new) base type ? or an helper method ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it's not repeated 3 times, only 2 (and one version is different from the others). In any case I've moved the duplicated code into a helper method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point - but now you have to explain why this one is different ;-) and not shared
Curious minds must know :)

Copy link
Member

Choose a reason for hiding this comment

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

Also, can we use c# 8? Switch expressions!

Copy link
Member Author

Choose a reason for hiding this comment

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

@spouliot it's the mac value that's different (osx vs macosx). It was that way before my changes, and I didn't want to change anything, so I kept it that way.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I thought (jumped) to the default case, i.e. String.Empty vs Exception, and overlooked the mac string :)

Copy link
Contributor

@VincentDondain VincentDondain left a comment

Choose a reason for hiding this comment

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

Other than Sebastien's DRY comment (:

@@ -82,6 +84,7 @@ public void CheckToolBinDir (string taskName, string binDirToCheck)
RedirectStandardError = true,
};
psi.EnvironmentVariables.Add ("DEVELOPER_DIR", Configuration.xcode_root);
psi.EnvironmentVariables.Remove ("XCODE_DEVELOPER_DIR_PATH"); // VSfM sets XCODE_DEVELOPER_DIR_PATH, which confuses the command-line tools if it doesn't match xcode-select, so just unset it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't that cause problems in VSM? We need to make sure it resets it if needed or maybe tell the VSM team to not set it at all.

@monojenkins

This comment has been minimized.

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
⚠️ Mono built from source
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

1 tests failed, 88 tests passed.

Failed tests

  • monotouch-test/watchOS 32-bits - simulator/Debug: Crashed

@rolfbjarne
Copy link
Member Author

Test failure is unrelated

@rolfbjarne rolfbjarne merged commit bdc8e69 into xamarin:master Oct 16, 2019
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this pull request Feb 26, 2020
… and watchOS to a few tasks. Fixes xamarin#6200. (xamarin#7226)

The problem with xamarin#6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

Fixes xamarin#6200.
rolfbjarne added a commit that referenced this pull request Feb 28, 2020
#7991)

* [msbuild] Provide the correct value for the operating system for tvOS and watchOS to a few tasks. Fixes #6200. (#7226)

The problem with #6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

Fixes #6200.

* [msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metal call to CreateRenderPipelineState fails on tvOS
7 participants