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

Port MatterControl and dependencies to .NET 6 [$1,700] #5252

Closed
4 tasks done
larsbrubaker opened this issue Mar 3, 2022 · 23 comments
Closed
4 tasks done

Port MatterControl and dependencies to .NET 6 [$1,700] #5252

larsbrubaker opened this issue Mar 3, 2022 · 23 comments
Labels

Comments

@larsbrubaker
Copy link
Member

larsbrubaker commented Mar 3, 2022

This is quite a large project and requires extensive testing.

  • Port agg to .NET 6 and make sure it can pass all its tests
  • Port MatterSlice to .NET 6 and make sure it can pass all its tests
  • Port MatterControl to .NET 6 and make sure it can pass all its tests
  • Make sure both OpenTK and GLFW are working with .NET 6

There is a $1,700 bounty on this issue.

Help spread the word by sharing this issue with potential developers:

share on facebookshare on twitershare on linkedin

View more bounty opportunities ($12,305 in total)
$2,604 paid to date

@larsbrubaker larsbrubaker changed the title Port MatterControl and dependencies to .NET 5 Port MatterControl and dependencies to .NET 5 [$1,263] Mar 3, 2022
@larsbrubaker larsbrubaker changed the title Port MatterControl and dependencies to .NET 5 [$1,263] Port MatterControl and dependencies to .NET 5 [$1,300] Mar 7, 2022
@Glodigit
Copy link

Glodigit commented Apr 7, 2022

I'm just curious, but why .NET 5 and not .NET 6 (and MAUI)?

@larsbrubaker larsbrubaker changed the title Port MatterControl and dependencies to .NET 5 [$1,300] Port MatterControl and dependencies to .NET 6 [$1,300] Apr 7, 2022
@larsbrubaker
Copy link
Member Author

larsbrubaker commented Apr 7, 2022

@Glodigit you make a great point. Changing this issue to .NET 6. Using MAUI is a different set of issues. The most important of which is that all we need is a window hosing service (something GLFW can provide). All of MCs UI is rendered in app and we don't use any native controls. On top of that MAUI is still not available on LINUX so it would limit our distribution even if we wanted to take on the HUGE task of moving MC to native UI rendering (which I don't want).

Thank you for the feedback and suggestion.

@fortsnek9348
Copy link

Got this running on Win 10. All tests pass, except: the occasional unrelated UI timing issue (it seems), and some tests rely on the Local Library and Queue folders, which may be missing (I've marked these tests to be ignored for now). Also, .NET 6 has no AppDomains, so I kludged the test system to run some tests in a separate process. On the other hand, most UI tests now run in parallel.

Builds and runs with OpenTK for .NET framework with warnings, but any incompatibilities will be shown at runtime. Can use https://www.nuget.org/packages/OpenTK.WinForms for .NET 6, but it's pre-release and has less configurability it seems. Both appear to work. I'll probably try out OpenTK.WinForms some more. Any preference?

And is there anything else to add?

@larsbrubaker
Copy link
Member Author

The only thing that you didn't mention is GLFW working. You can add the attached matercontrol.json to your windows user folder and MC will run with the GLFW backend.

Other than that it sounds like the right set of features. I'll check the failing tests after the PR.

mattercontrol.zip

Thank you.

@fortsnek9348
Copy link

GLFW appears to work for the main application, but it seems tests that don't use MatterControl's window fail because Agg UI has completely different handling when closing windows (compare CloseSystemWindow): WinformsSystemWindow will close the test window, whereas GlfwPlatformWindow won't. The window may either hang, or crash in a future draw event.

And some tests fail because the automation doesn't inject the shift key properly for GLFW. Different handling again.

So, nothing porting-specific so far.

PR will probably happen on or after Monday.

@larsbrubaker
Copy link
Member Author

That sounds great

@fortsnek9348
Copy link

fortsnek9348 commented Apr 21, 2022

Further testing: I think some "timing" issues were caused by the parallel UI tests fighting over platform window focus. I've added a static bool to disable input from the platform.

OpenTK 4 appears to have a bug where the GLControl receives no keyboard input until focus leaves and returns to MatterControl. That's this bug: opentk/GLControl#18. Setting the focus in OpenGLSystemWindow.OnShown appears to work. There's flexibility here though, as switching back to OpenTK 3 is just changing one value in the project.

The test DimensionsWorkWhenNoSheet is showing intermittent bugs still. I've seen this happen with the test in the original .NET Framework project too, so it shouldn't be caused by parallel testing. It happens once in say, 7 in 32 times. Got it captured on video. What happens is, after undoing the drag-drop resize, after the mouse clicks on the left resize widget on the cube and begins to move towards the width text edit widget ("try scaling by text entry"), the text edit control just disappears. I have no idea what causes that. Have yet to reproduce outside of testing. Commenting out the initial "Scale it wider" resize and undo code appears to stop this from happening.

EDIT: Potential fix found.

@fortsnek9348
Copy link

Two runs through the test suite with Open TK 4, no failures. For now.

@fortsnek9348
Copy link

The keyboard input problem of OpenTK 4 GLControl seems to start with GLFW. GLFW always creates a new window, you can't attach to an existing window like OpenTK 3 does. So, Open TK 4 GLControl will have a child control that is not present in the Winforms UI hierarchy. Win32 calls are used in an attempt to prevent the control from taking focus.

It's rather inelegant. The only advantage I see over using GLFW directly, is that you don't have to translate keys, when they work.

@larsbrubaker
Copy link
Member Author

Bumping the bounty for this to 1,700.

@fortsnek9348
Copy link

Well, that's nice. It would be good if you can get around to the PRs at some point. Your updates are a moving target for both rebasing and testing.

@larsbrubaker larsbrubaker changed the title Port MatterControl and dependencies to .NET 6 [$1,300] Port MatterControl and dependencies to .NET 6 [$1,700] Apr 29, 2022
@larsbrubaker
Copy link
Member Author

My apologies. I saw the 'work in progress' and thought that you were not ready yet - not that I needed to review.

If you rebase on top of what is up there now, I will review them before adding any more content on top.

image

Thanks for all the hard work and thanks for the heads up.

@fortsnek9348
Copy link

Yes, they're drafts right now. AppVeyor needs .NET 6 to even get anywhere. And I'm sure something will pop up after that. Will rebase soon.

@fortsnek9348
Copy link

AppVeyor appears to be attempting to rebuild a bunch of Agg examples still on the .NET Framework. Those are not in the VS solution. Should I do anything about that?

@fortsnek9348
Copy link

And for MatterControl, AppVeyor nuget restore MatterControl.sln is throwing a bunch of NuGet errors as it wants precisely a net60-windows version of every project and package.

I've ran the command myself from https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-nuget-cli, and I get no errors. All I got were warnings for OpenTK 3. Is AppVeyor using an out of date tool?

I can also publish from VS to a folder without problems.

MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin'.

AppVeyor using the wrong VS version?

@larsbrubaker
Copy link
Member Author

I will try and get this sorted out on AppVeyor tomorrow.

@larsbrubaker
Copy link
Member Author

The project 'agg-sharp/agg-sharp.sln' is what AppVeyor builds and it be able to run all the samples. Without parting this we would be breaking all the agg samples and that is not something I want to do. I don't know what the scope is to get the agg samples and demos working. I'm happy to help if it is a lot.

@fortsnek9348
Copy link

Okay, what's the status here. Done your testing?

@larsbrubaker
Copy link
Member Author

Yes. This is now considered complete and we will get payment out to you first thing next week.

Thank you for all the hard work. Along with you previous work you have really helped to make MatterControl a better project. We deeply appreciate your time and diligence.

@fortsnek9348
Copy link

Same gmail address as before.

@larsbrubaker
Copy link
Member Author

Will do. I have let Mike know that he needs to pay this when he returns next week.

@larsbrubaker
Copy link
Member Author

Do you know how to attach the debugger while running tests? The new code does not allow me to set a breakpoint and it is very hard to debug what is happening with the disabled tests.

@fortsnek9348
Copy link

Follow the steps in the original MatterControl PR. You need Microsoft's extension to enable child process debugging. And I've just determined that you need to disable Just My Code too.

Or if you mean to attach to a test whilst it is running, then you attach to TestInvoker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants