commonmarker icon indicating copy to clipboard operation
commonmarker copied to clipboard

Won't build with Ruby head

Open MSP-Greg opened this issue 1 year ago • 7 comments

I've got some code that runs regularly, and I have run it for years with Windows Ruby head (ucrt). I can't build Commonmarker v1.

I then added it to CI (test.yml), and it failed to build on all three platforms. See:

https://github.com/MSP-Greg/commonmarker/actions/runs/8402231998

Not sure if it's considered an issue. I'm not familiar with Rust, so I'm not sure whether it's a Ruby issue or a Commonmarker issue.

MSP-Greg avatar Mar 23 '24 14:03 MSP-Greg

Ah, if I had to guess, it's because rb-sys itself doesn't support ruby-head / 3.4: https://github.com/oxidize-rb/rb-sys/blob/ad4f0e5445e860e56c802064ddf49eeabe1054e8/.github/workflows/ci.yml#L37

@ianks Does that sound right to you? (Note that this is not me asking for 3.4/head support, just wondering if that's a plausible reason for this.)

gjtorikian avatar Mar 23 '24 20:03 gjtorikian

I just 'copied' the file crates/rb-sys/src/stable_api/ruby_3_4.rs (from ruby_3_23rs) in rb-sys, then ran CI with Ruby head. No OS's passed.

Your guess is probably correct.

MSP-Greg avatar Mar 23 '24 21:03 MSP-Greg

Things work perfectly with ruby-head, but you need to enable the stable-api-compiled-fallback in your Cargo.toml feature for it to work. If that's not easy to do, you can also set RB_SYS_STABLE_API_COMPILED_FALLBACK=true as an env var.

ianks avatar Mar 24 '24 20:03 ianks

Got it, thank you! For reference here’s the source PR: https://github.com/oxidize-rb/rb-sys/pull/229

@MSP-Greg see if that works out for you. To be honest, I don’t really feel comfortable officially supporting ruby-head myself; I’m just one extremely busy person and the idea of opening the door to unofficial Ruby releases already stresses me out. 😆 But if you want to make a case for why it should be supported I am all ears.

Closing this out because I like to keep my issues clean, but we can keep discussing.

gjtorikian avatar Mar 24 '24 21:03 gjtorikian

@gjtorikian I'd encourage testing against ruby-head to help ruby core develop more easily. We run ruby-head in prod and anytime an extension fails to compile on ruby head, there's a lot of disruption. FWIW, stable-api-compiled-fallback should make it easy, and if not then that's a bug.

ianks avatar Mar 24 '24 23:03 ianks

Ok, you convinced me! Reopening since there's a task here.

I'll take a PR for this, as I haven't got time to investigate the work. But I'll get to it after I finish #276.

gjtorikian avatar Mar 25 '24 02:03 gjtorikian

JFYI, I quickly checked today using RB_SYS_STABLE_API_COMPILED_FALLBACK=true, and that did not work. But, I haven't checked with Ruby 3.3, nor any Ruby version on Ubuntu or macOS.

Or, with Windows locally, it may be some squirrelly build tool issue... More time later in the week.

MSP-Greg avatar Mar 25 '24 02:03 MSP-Greg

@MSP-Greg I haven’t had time to look into this, but ruby-head has been failing on Windows for some time now: https://github.com/gjtorikian/commonmarker/actions/runs/11912463542/job/33196103377

Would you happen to have encountered this before? Looks like it can’t find the header file for stdckdint.h.

gjtorikian avatar Nov 19 '24 14:11 gjtorikian

@gjtorikian

Sorry for dropping this. I'll get back to this, but it may be a few days.

Re CI and head builds, one might say "we're not in Kansas anymore". Almost all CI head builds are done running the full Ruby test suite, and if there are any failures/errors, the build doesn't replace the previous build. Also, there is better testing of the actual code created by make install. Many repos test with head builds.

Again, sorry,

Greg

MSP-Greg avatar Nov 19 '24 14:11 MSP-Greg

No worries! Just curious if something rang a bell.

gjtorikian avatar Nov 19 '24 22:11 gjtorikian