capy-ui / capy

💻Build one codebase and get native UI on Windows, Linux and Web
https://capy-ui.org
Mozilla Public License 2.0
1.6k stars 60 forks source link

var->const and internal trait.zig to compile on latest zig #67

Closed dvmason closed 8 months ago

dvmason commented 9 months ago

Zig version 0.12.0-dev.1808+69195d0cd

Really want this to work on macos

dvmason commented 9 months ago

accidentally checked in version that was WIP.... cleaned up now.

AdjectiveAllison commented 8 months ago

+1 capy is unusable on master zig without this change.

AdjectiveAllison commented 8 months ago

@dvmason It looks like there is still more work to be done to get this working on zig master. I submitted a pull request to your fork with a decent amount of additional changes and extra information on what else is left.

Here is the link: https://github.com/dvmason/capy/pull/1

After digging in more, I really like the way you are making it compatible with both 0.11.0 and master branch by creating trait.zig and using std.meta.trait if available, otherwise using the local functions.

dvmason commented 8 months ago

All compiles cleanly in 0.12.0-dev.1830+779b8e259 now. Almost compiles in 0.11.0 but still has an error I can't figure out

dvmason commented 8 months ago

Helps if I do it right! needed @hasDecl instead of field

AdjectiveAllison commented 8 months ago

https://github.com/dvmason/capy/pull/2

Sent up another PR Dave's way with some more fixes for my local environment. Here is my current status on master: Build Summary: 38/49 steps succeeded; 5 failed

One thing that I'm noticing though as I get closer to successful compilation is that I'm starting to hit build errors with the vendor repositories. Specifically vendor/zigimg is quite noisy. It looks like zigimg is keeping up to date with master, and the errors I get would be easily resolved with pulling the latest from source. However, it looks like the zigimg code isn't setup for backwards compatibility with 0.11.0, which all of a sudden means @dvmason and I's work to get capy compatibility working in both directions extends into another repository, and I don't know if that is sustainable.

@zenith391, Do you have an opinion on how you'd prefer to handle zig language version compatibility within capy?

zenith391 commented 8 months ago

I think I'll just restart keeping up with Zig master

zenith391 commented 8 months ago

I'll merge the PR as is and fix the last few errors

dvmason commented 8 months ago

Great, thanks!