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

Add Jai bindgen #1090

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Add Jai bindgen #1090

merged 2 commits into from
Aug 14, 2024

Conversation

colinbellino
Copy link
Contributor

@colinbellino colinbellino commented Aug 10, 2024

I've created gen_jai.py to support generating Jai bindings, based on the work done in gen_odin.py.

Note: right now gen_all.py expects a sokol-jai/ folder to be present so i've added a line to the README with the bindings i'm maintaining here, feel free to delete that commit.

@colinbellino colinbellino marked this pull request as ready for review August 10, 2024 14:44
@floooh
Copy link
Owner

floooh commented Aug 12, 2024

One thing we need to fix before the merge is to allow the Github Action script which automatically updates the bindings push access to the sokol-jai repository, and for that I'll need your help to add a 'deploy key' to your repository.

We already did the same thing before with the sokol-d bindings repository which is also not owned by me: https://github.com/kassane/sokol-d.

The process is as follows:

  • I will create a SSH key pair on my side.
  • The private key will be added as CI secret in the Sokol Github repository settings by me.
  • The public key (see below) needs to be added by you as 'Deploy Key' in the Github project settings. This will allow the Sokol project CI pipeline to push changes to the https://github.com/colinbellino/sokol-jai)

Alternatively I can also fork your sokol-jai repo and manage everything on my side, this would however mean that the 'official' Jai bindings would be under https://github.com/floooh/sokol-jai (I would prefer though to keep it under your location because 'credit where credit is due' ;)

In any case here's the public key I created:

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFITMuAd0uCXlvGbkz/7YPlPxuPHCtAVOJcpdcnYn//t [email protected]

...the result should then look similar to this:

image

...on my side I will add the private key as CI secret, accessible from the gen_bindings.yml script.

Thanks!

@floooh
Copy link
Owner

floooh commented Aug 12, 2024

PS: the failing CI pipeline is expected. No need to fix anything on your side.

@colinbellino
Copy link
Contributor Author

I've added the deploy key, let me know if you run into any issues.

@floooh
Copy link
Owner

floooh commented Aug 13, 2024

Thanks! I'll try to look into the rest tomorrow evening (if nothing higher priority comes inbetween).

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

Ok, looking into this now. I'll add GH Actions integration in my own merge branch...

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

It's getting pretty crowded :D (this run didn't commit and push because it's running from a branch):

image

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

...I don't run actual compile tests in the test-jai job yet btw, I guess as long as Jai isn't public there's no way to legally run it on Github CI...

...at one point we'd want to add a CI pipeline to the sokol-jai repo which runs on new commits, like this: https://github.com/floooh/sokol-zig/blob/master/.github/workflows/main.yml

...then I can also add a badge for the Jai bindings to the sokol readme...

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

Ok, I'm going to merge now. There's a slight chance that the CI pipeline which then starts will mess up your sokol-jai repository (worst thing that can happen is that I messed up the subpath and there will be files committed to the wrong place).

Since the sokol-jai repo is already on a recent version I'm actually expecting that no commit is created, but we'll see...

@floooh floooh merged commit 9fe3ba6 into floooh:master Aug 14, 2024
19 of 20 checks passed
@floooh
Copy link
Owner

floooh commented Aug 14, 2024

...ok let's see what happens:

https://github.com/floooh/sokol/actions/runs/10391639556

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

Hmm, yeah, no changes and thus nothing committed:

https://github.com/floooh/sokol/actions/runs/10391639556/job/28775312222

Run git config user.email "none"
  git config user.email "none"
  git config user.name "GH Action"
  git add -A
  git diff-index --quiet HEAD || git commit -m "updated (https://github.com/floooh/sokol/commit/d8fcfa[2](https://github.com/floooh/sokol/actions/runs/10391639556/job/28775312222#step:4:2)5ccba9aace37ac89e8fe8a0e1b5601a5b)"
  git push
  shell: /usr/bin/bash -e {0}
Everything up-to-date

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

...I think I'll do a little whitespace commit to one of the sokol headers to test if the access-token stuff works...

@floooh
Copy link
Owner

floooh commented Aug 14, 2024

Ok it seems to work, when you look in:

https://github.com/colinbellino/sokol-jai

There's now an automatic commit (just a whitespace change in sokol_audio.h)

...I'll update the sokol readme and changelog, and that should be it. Many thanks for the PR!

@colinbellino
Copy link
Contributor Author

...I don't run actual compile tests in the test-jai job yet btw, I guess as long as Jai isn't public there's no way to legally run it on Github CI...

...at one point we'd want to add a CI pipeline to the sokol-jai repo which runs on new commits, like this: floooh/sokol-zig@master/.github/workflows/main.yml

...then I can also add a badge for the Jai bindings to the sokol readme...

Oh yeah, i guess there is no real way to compile in GH CI since the repository is public. 🤔

@colinbellino
Copy link
Contributor Author

Thank you for taking the time to look into this and merging it @floooh !

allcreater pushed a commit to WANNABY/sokol that referenced this pull request Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants