-
Notifications
You must be signed in to change notification settings - Fork 16
Add PoC Ruby bindings #155
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
base: main
Are you sure you want to change the base?
Conversation
7f26e71 to
2c7e605
Compare
|
I think I'd be alright with merging this, assuming that:
Sorbet types would also be nice, but I don't know how hard that would be. |
|
Oh, and we also need to figure out what to do about:
The source of truth should remain: Line 7 in a3b3520
|
|
Also, I need help making sure that VS Code extensions for Ruby syntax highlighting / formatting / linting also all work. |
This may not be possible to resolve. Ruby bindings are their own independent thing (it's called a "gem", conceptually somewhat similar to a Rust crate), and the gem specification wants to know what version it is before even starting the native building process. So we cannot use any approach where the native Rust code exposes its version and Ruby reads that, because this means the Rust <-> Ruby bridge needs to already be built/compiled. But the The only approach that I can think of right now is to parse the The other option is to run two versions: One |
|
I'd be fine with anything that allows me to use https://github.com/lgarron/repo to bump versions. I could add a Ruby version bumper to it, but adding a heuristic to look for libraries in nested folders sounds daunting. Perhaps as a stopgap I could allow a configuration that runs a script to keep the Ruby version up to date any time I bump the Rust versions. That could also be checked in CI, and it would still be easy to bump by hand. |
|
I've run into another blocker: Details╭─── /Users/lgarron/Code/git/github.com/cubing/twips ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ├─ (jj) @=low #=cf02 (rv +0 pushable +1 empty) ├─ (git) rv | ✔ ├─ lgarron@Germain │ cargo test --package twips-rb ┴ Compiling magnus v0.8.2 error[E0432]: unresolved imports `rb_sys::rb_proc_call_kw`, `rb_sys::rb_yield_values_kw` --> /Users/lgarron/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/magnus-0.8.2/src/block.rs:14:5 | 14 | rb_proc_call_kw, rb_proc_lambda_p, rb_proc_new, rb_yield, rb_yield_splat, rb_yield_values_kw, | ^^^^^^^^^^^^^^^ no `rb_proc_call_kw` in the root ^^^^^^^^^^^^^^^^^^ no `rb_yield_values_kw` in the root | help: a similar name exists in the module | 14 - rb_proc_call_kw, rb_proc_lambda_p, rb_proc_new, rb_yield, rb_yield_splat, rb_yield_values_kw, 14 + rb_proc_call, rb_proc_lambda_p, rb_proc_new, rb_yield, rb_yield_splat, rb_yield_values_kw, | help: a similar name exists in the module | 14 - rb_proc_call_kw, rb_proc_lambda_p, rb_proc_new, rb_yield, rb_yield_splat, rb_yield_values_kw, 14 + rb_proc_call_kw, rb_proc_lambda_p, rb_proc_new, rb_yield, rb_yield_splat, rb_yield_values, | There are no tests in the Rust code for EDIT: now filed as matsadler/magnus#162 |
This is implemented in: 0b7fb23 |
I've figured out a workaround: |
|
I believe this just leaves the following blockers:
|
Redid #140 with a cleaner history (and less confused commits about me trying to figure out the Ruby gems native binding ecosystem)