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

Remove unnecessary conditional defines from scenekit.cs #14503

Merged
merged 6 commits into from
Mar 31, 2022

Conversation

tj-devel709
Copy link
Member

This PR works to remove the unneeded conditional defines and put in a better input for the generator!

@tj-devel709 tj-devel709 added do-not-merge Do not merge this pull request not-notes-worthy Ignore for release notes labels Mar 25, 2022
@tj-devel709 tj-devel709 added this to the Future milestone Mar 25, 2022
@tj-devel709 tj-devel709 requested a review from dalexsoto as a code owner March 25, 2022 16:24
Copy link
Contributor

@chamons chamons left a comment

Choose a reason for hiding this comment

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

See concerns about XAMCORE_3_0

@@ -2498,35 +2502,28 @@ interface SCNProgram : NSCopying, NSSecureCoding {
[BaseType (typeof (NSObject))]
[Model, Protocol]
interface SCNProgramDelegate {
#if MONOMAC
#if XAMCORE_3_0
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe removing XAMCORE_3_0 is a safe transformation.

Copy link
Member

Choose a reason for hiding this comment

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

we already have XAMCORE_3_0, right? Since NET == XAMCORE_4_0, The if was just around a NoiOS, so it gives no harm since the method was not there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the #if XAMCORE_3_0's because I believe the compiler would not let me add another [NoiOS] outside of it (since it had duplicate attributes) and when I didn't add it, xtro would complain that things were being set for iOS but were not really there. I could be misremembering the above though.
I figured that if I have to add a #if !XAMCORE_3_0 to add the [NoiOS] there as well and the fact that it was already inside a #if MONOMAC and not being able to be called for iOS anyways, that it would maybe be okay to remove.

Any thoughts on this? @mandel-macaque @chamons

Copy link
Member

Choose a reason for hiding this comment

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

That's some convoluted code... in general removing XAMCORE_3_0 isn't a safe transformation, but in this particular case, the code inside the XAMCORE_3_0 condition didn't do anything, because it was also inside a MONOMAC condition, thus the XAMCORE_3_0 condition is safe to remove.

Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I do agree with @chamons regarding the using being 3 times, move it to a single if.

Comment on lines -1222 to -1223
#if MONOMAC
[iOS (8,0)]
Copy link
Member

Choose a reason for hiding this comment

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

What was that IOS attr doing there?!?!

@@ -2498,35 +2502,28 @@ interface SCNProgram : NSCopying, NSSecureCoding {
[BaseType (typeof (NSObject))]
[Model, Protocol]
interface SCNProgramDelegate {
#if MONOMAC
#if XAMCORE_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.

we already have XAMCORE_3_0, right? Since NET == XAMCORE_4_0, The if was just around a NoiOS, so it gives no harm since the method was not there.

@@ -1784,15 +1790,13 @@ interface SCNSceneLoadingOptions {
[Export ("SCNSceneSourceLoading.OptionPreserveOriginalTopology")]
bool PreserveOriginalTopology { get; set; }

#if !TVOS && !WATCH
// note: generator's StrongDictionary does not support No* attributes yet
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems important: does the generator's StrongDictionary support No* attributes now? If not, we can't remove the #if conditions (and if it does, then you can remove the comment).

Copy link
Member Author

Choose a reason for hiding this comment

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

@chamons would you happen to know this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would go check the generated code and see what it generates before and after your change.

@@ -2498,35 +2502,28 @@ interface SCNProgram : NSCopying, NSSecureCoding {
[BaseType (typeof (NSObject))]
[Model, Protocol]
interface SCNProgramDelegate {
#if MONOMAC
#if XAMCORE_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.

That's some convoluted code... in general removing XAMCORE_3_0 isn't a safe transformation, but in this particular case, the code inside the XAMCORE_3_0 condition didn't do anything, because it was also inside a MONOMAC condition, thus the XAMCORE_3_0 condition is safe to remove.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests timed out on macOS M1 - Mac Big Sur (11.5) ❌

Pipeline on Agent
Merge f907ab8 into b8cb374

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Merge f907ab8 into b8cb374

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

2 tests failed, 106 tests passed.

Failed tests

  • Xtro/.NET: BuildFailure
  • Cecil-based tests/NUnit: Failed (Execution failed with exit code 24)

Pipeline on Agent XAMBOT-1030.Monterey
Merge f907ab8 into b8cb374

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests timed out on macOS M1 - Mac Big Sur (11.5) ❌

Pipeline on Agent
Merge 4252aed into b454fb4

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests timed out on macOS Mac Catalina (10.15) ❌

Pipeline on Agent
Merge 4252aed into b454fb4

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

2 tests failed, 106 tests passed.

Failed tests

  • Xtro/.NET: BuildFailure
  • Cecil-based tests/NUnit: Failed (Execution failed with exit code 24)

Pipeline on Agent XAMBOT-1017.Monterey'
Merge 4252aed into b454fb4

@mandel-macaque mandel-macaque removed the do-not-merge Do not merge this pull request label Mar 30, 2022
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on macOS Mac Catalina (10.15) ✅

Tests passed

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Merge c48dcfb into e5b8b19

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests timed out on macOS M1 - Mac Big Sur (11.5) ❌

Pipeline on Agent
Merge c48dcfb into e5b8b19

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

1 tests failed, 107 tests passed.

Failed tests

  • Cecil-based tests/NUnit: Failed (Execution failed with exit code 24)

Pipeline on Agent XAMBOT-1103.Monterey'
Merge c48dcfb into e5b8b19

@mandel-macaque mandel-macaque merged commit 79dec25 into dotnet:main Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants