Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Implement FormsStack and FormsQueue internally for VS 2017 Compatibility #8403

Merged
merged 9 commits into from Nov 18, 2019

Conversation

PureWeen
Copy link
Contributor

@PureWeen PureWeen commented Nov 6, 2019

Description of Change

  • Update everything back to using VS 2019 build components
  • Copy in Stack and Queue implementations from corefx so that the moved types in mono don't break VS2017
    • I just linked the files into the platform projects so they can all stay internal/sealed. I assume once we totally drop VS 2017 we'll just delete all of this and roll back to using the packaged versions of these

Here are some comparison tests ran through Benchmark dotnet

Method Mean Error StdDev
PushQueue 27.780 ms 0.5488 ms 1.3148 ms
PopQueue 5.082 ms 0.0992 ms 0.0928 ms
PushFQueue 26.596 ms 0.5269 ms 0.8046 ms
PopFQueue 2.397 ms 0.0453 ms 0.0378 ms
Method Mean Error StdDev Median
PushStack 28.324 ms 1.0790 ms 3.0433 ms 26.999 ms
PopStack 4.148 ms 0.0827 ms 0.0813 ms 4.125 ms
PushFStack 26.596 ms 0.6836 ms 1.2670 ms 26.244 ms
PopFStack 2.086 ms 0.0454 ms 0.0819 ms 2.053 ms

Here's the test project if you would like to verify or add additional tests

TestCollections.zip

Issues Resolved

Platforms Affected

  • Core/XAML (all platforms)
  • iOS
  • Android
  • UWP

Testing Procedure

  • pull down the nuget and make sure you can build and deploy projects on VS 2017

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@rmarinho
Copy link
Member

rmarinho commented Nov 6, 2019

Can we have 2 pr's ? one just for the Stack and Queue and other with the other changes?

Also we should format the corefx code with our guidelines, drop private etc..

@PureWeen
Copy link
Contributor Author

PureWeen commented Nov 6, 2019

Can we have 2 pr's ? one just for the Stack and Queue and other with the other changes?

@rmarinho the whole of this PR is to create a nuget that's built on VS 2019 that we can test works on VS 2017

If we split out all the changes we can't really do that

Also we should format the corefx code with our guidelines, drop private etc..

yea I wasn't sure. This isn't really code that we are going to iterate or own we're just going to delete it sometime next year so it didn't seem worth the effort to format according to all our guidelines

@samhouts
Copy link
Member

samhouts commented Nov 7, 2019

Let's leave the code style the same as corefx, just in case we need to pull in an update.

@PureWeen
Copy link
Contributor Author

PureWeen commented Nov 7, 2019

I tested the nuget with the sample given here and it now runs with these changes

#7602 (comment)

@PureWeen PureWeen changed the base branch from master to 4.2.0 November 7, 2019 17:18
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Can we add this per parts? first the code changes, that would not need vs2019.
Then we add changes to cake and provisioning.

- name: DOTNET_VERSION
value: 3.0.100
- name: winVmImage
value: Hosted Windows 2019 with VS2019
Copy link
Member

Choose a reason for hiding this comment

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

This will keeps us from updating let's say for XamarinForms (private agents) i prefer we had this as settable from the pipeline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea once we are happy with the PR I was going to delete this before merging it.

Though I still think this should be part of the yml file not the pipeline. For example if branch 4.1.0 is set to VS 2017 than when you run those builds it'll just build and work. Then when you run 4.2.0 it'll just build and work. If it's settable at the pipeline level than you are required to have knowledge external to the repository in order to make something compile.

But we can discuss that more on Thursday :-)

Copy link
Member

Choose a reason for hiding this comment

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

we can delete i m happy with it :P Let's merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good!! I want to run some quick tests on UWP to see if incrementing the SDK build will break the icon on MDP even more or if the issue is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmarinho I added these back in for the time being because FormsQueue and FormsStack uses C# features that need 2019. I don't really want to modify them so they compile with C# 7.0 I'd rather just leave them untouched.

So I figure once this is merged in and the build server pipeline variables are updated then we can remove the fields?

Xamarin.Forms.Core\corefx\FormsQueue.cs(263,19): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsQueue.cs(278,14): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsQueue.cs(285,19): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsStack.cs(344,23): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsStack.cs(374,24): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsStack.cs(404,23): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsQueue.cs(263,19): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsQueue.cs(278,14): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsQueue.cs(285,19): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
Xamarin.Forms.Core\corefx\FormsStack.cs(344,23): Error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.

@PureWeen PureWeen removed the request for review from jsuarezruiz November 13, 2019 18:17
@samhouts samhouts added the Core label Nov 16, 2019
@@ -43,42 +44,48 @@ var informationalVersion = gitVersion.InformationalVersion;
var buildVersion = gitVersion.FullBuildMetaData;
var nugetversion = Argument<string>("packageVersion", gitVersion.NuGetVersion);

var ANDROID_HOME = EnvironmentVariable ("ANDROID_HOME") ??
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmarinho all these cake changes just make this cake script consistent with master

azure-pipelines.yml Outdated Show resolved Hide resolved
@PureWeen PureWeen merged commit 34c346c into 4.2.0 Nov 18, 2019
@PureWeen PureWeen deleted the vs_2017_compat branch November 18, 2019 17:10
@samhouts samhouts added the approved Has two approvals, no pending reviews, and no changes requested label Nov 18, 2019
@MagicAndre1981
Copy link
Contributor

what will be the first build that includes the fix, so that I can test it with VS2017?

@PureWeen
Copy link
Contributor Author

@MagicAndre1981
It should be up with the nightly in a couple of nights otherwise you can download the nuget from this PR here

https://dev.azure.com/xamarin/public/_build/results?buildId=10002&view=artifacts

and test it out

@MagicAndre1981
Copy link
Contributor

@PureWeen

I tested the version. In my current working copy the nuget package fails first with XF001 "Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s)." Trying to set <XFDisableTargetsValidation>true</XFDisableTargetsValidation> causes error that I need to reference MonoAndroid90 🤔 🤷‍♂️

So I made a new checkout from my SVN source server and here the 4.2.0.910325 works with VS2017, the Android app compiles and runs fine so far.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v4.3.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants