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
Restructure the C# bindings for Yoga to be based on .NET Standard 2.0 and the new .NET 6.0+ target platform work. #1207
Conversation
… and the new .NET 6.0+ target platform work. Tests building is currently broken due to e96a09e. Next commit will investigate how to fix that.
…the DEBUG define and fix a missing export
Hi @jkoritzinsky! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great stuff! Very excited to see the C# bindings work again.
Would be good to clean up some of the dead project configuration around here. E.g. looking at the new source tree, I can see a Xamarin sln referencing folders no longer present, along with a non-vcxproj build script that doesn't work/I'm guessing is no longer used.
I can see there is updated code for Mono binding to YogaKit on iOS. From what I can tell the previous iOS build used that build script instead of depending on the vcxproj. Will those non-Windows builds still work? If not I would reccomend removing as well (I'm okay losing parity if we get something presently working and maintainable in return).
I think we should add some Github workflows here to excersise any builds/NUnit tests which are working, for the matrix we want to support. My preference would be to do that as part of the change, so we can demonstrate everything is working. The recent "validate-js.yml" workflow should be relatively pattern matchable but I can also help with this, given the permutations we want to support.
Also feel free to ignore the JavaScript linting failure. Made a change internally without realizing Prettier wasn't turned on for Yoga in internal validation. Working on fixing that up soon so it won't happen again. |
…build and add some projects to build the packages
5d50a14
to
763ebb2
Compare
I've added a build and test GitHub Action at the |
I haven't hooked up testing for iOS yet as I'm not familiar enough with GitHub actions to know the best way to run tests against an iOS simulator or device. |
I looked into that a bit for the CMake change I'm working on. Right now the repo is keeping things simple, with the GitHub hosted/managed runners. The oldest LTS Ubuntu supports is 18.04, with GCC 6. but GitHub only supports back to 20.04. Ideas were:
There is lower hanging fruit though, so it's not worth thinking about too much yet. |
…nly the native project
Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: D45297676 fbshipit-source-id: 77df49f7ffe17e177db8a39e8322124058353e23
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: 9e7bd1bcce979acb6bb7abb8dc9c46416c5c3725
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: c622865232689e7cda48ec5cd566ee906962444c
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 1ec7cb1f15773efdb46669db0ebf6fc5d6b759b6
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: aa03d1a31602051d3d2514f6fc8a7a3db5bea262
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 4a7ad17192ed8d4b779b10ad834644194111b96c
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: db461b0203200b9db425f4ddebcc1798477e9cde
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 5f20e0a9865d33ba4974e03d365f11fae816087c
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 63f7c3b7c2e7a97d7bba12f62d9e448c8aaee538
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: 4535de6ba97f8ea87141b3a8dcd6dbb174555ec2
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: fcbbe4e3a1cd6ed02fee25c169d892b68c95e667
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 171c6aa3699802e51e5e12025acce854e13c7402
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: d9b9949705c8654fe2705429442affd5fa4cb0c8
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: d8a455686c5a1063e7047a7a511fd70714f8b013
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 324ebfdd8ba82813aab4816236b33f6bce7b3c26
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: fb27513efa119065a7607ae7738b3060ba098ea3
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: 3b94a7f4ec663693d686e3321ec9aa06e7cd12ca
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 4a308833fc86b0fac8e2d8a04ca9fd08df4e35cd
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: cf9246f5c223096dcb587bd2537016ef1100b248
Summary: Pull Request resolved: facebook#1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: 10cfb71a6220e4c7a6fc15032cd74033d4472f4b
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 07ca3b5c0509f18ad825029804b68ccb5c4e5522
Summary: Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](facebook#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Differential Revision: https://internalfb.com/D45297676 fbshipit-source-id: 113377d2577360d53d9bc7594322fbbcf91cd55d
Summary: Pull Request resolved: #1259 Wires C ABI to C# bindings using `System.Runtime.InteropServices`. Note that we don't have a working C# build right now, but there is [effort to address that](#1207) which may get some more effort before the Yoga release, so this keeps the bindings up to date. Reviewed By: yungsters Differential Revision: D45297676 fbshipit-source-id: 408f84d74ebbc7698407e951e831627117cbc2ed
@jkoritzinsky what do you think about merging this as-is? I think it is going to be a better reference than what we have right now, and we can leave tests disabled in the meantime. |
I'm fine merging this as-is. I haven't had time to investigate the test failures. |
Summary: These C# bindings were contributed as part of facebook@ff8f17a. They have occasionally been refreshed, but has never really had validation it built continuously, or dedicated maintenance. There has been a surge of work with facebook#1207 to try to modernize the build for these, but checking with jkoritzinsky I'm not sure either of us have the time to commit to supporting these at the same level as other bindings. Some well-known projects like Unity had already abandoned this set of bindings for their own. Unity-Technologies/UnityCsReference@016297e#diff-c85198aaac9095a5446ed00b0fba8025072d235b2b69dea8aad85abc64a83e1e So, as part of the work for an official OSS release, and really trying to define what is deprecated, and what we will try to support, I am removing the in-tree C# bindings from Yoga. In the past, gaps in Yoga bindings we haven't supported have led to new bindings with dedicated maintainers e.g. [FlexLayout](https://github.com/layoutBox/FlexLayout), [yoga-rs](https://github.com/bschwind/yoga-rs), [yoga-wasm-web](https://github.com/shuding/yoga-wasm-web). My hope is that by removing the C# bindings that we are not supporting, we free up the opportunity for a new version to become the defacto. Differential Revision: D46425886 fbshipit-source-id: 422abc0681bf02e1ebf1ba305efa3936e063c7e1
Summary: Pull Request resolved: #1302 These C# bindings were contributed as part of ff8f17a. They have occasionally been refreshed, but has never really had validation it built continuously, or dedicated maintenance. There has been a surge of work with #1207 to try to modernize the build for these, but checking with jkoritzinsky I'm not sure either of us have the time to commit to supporting these at the same level as other bindings. Some well-known projects like Unity had already abandoned this set of bindings for their own. Unity-Technologies/UnityCsReference@016297e#diff-c85198aaac9095a5446ed00b0fba8025072d235b2b69dea8aad85abc64a83e1e So, as part of the work for an official OSS release, and really trying to define what is deprecated, and what we will try to support, I am removing the in-tree C# bindings from Yoga. In the past, gaps in Yoga bindings we haven't supported have led to new bindings with dedicated maintainers e.g. [FlexLayout](https://github.com/layoutBox/FlexLayout), [yoga-rs](https://github.com/bschwind/yoga-rs), [yoga-wasm-web](https://github.com/shuding/yoga-wasm-web). My hope is that by removing the C# bindings that we are not supporting, we free up the opportunity for a new version to become the defacto. Reviewed By: javache Differential Revision: D46425886 fbshipit-source-id: df964c4d55adf93c4d1e82c104e74ca5ad181612
Talking offline, we decided to go a separate route, of removing the bindings from being in tree. This was commited with 5e74e20 |
Updated the C# bindings to build using the new simplified .NET SDK tooling. The C# projection now builds for .NET Standard 2.0 (to support Unity, .NET Framework, UWP, and modern .NET) and .NET 6.0 for iOS (to have the native calls correctly support calling into a statically-linked library).
The native changes were needed to get the C# tests passing on Windows x64 (tested locally).
This PR does not update any build, test, or package scripts. I can either add that to this PR or follow up with another PR.