jgarber / redcloth

RedCloth is a Ruby library for converting Textile into HTML.
Other
443 stars 113 forks source link

Ragel on Windows needs ragel directory to be included #63

Closed mohits closed 6 months ago

mohits commented 4 years ago

I got a pre-built Ragel 6.9 from: https://github.com/eloraiby/ragel-windows/blob/master

When I run it, I get this error: ragel -C -T0 ragel/redcloth_scan.c.rl -o ext/redcloth_scan/redcloth_scan.c ragel/redcloth_scan.c.rl:18:49: include: failed to locate file

The fix is that it requires the "ragel" to be on the include path.

This requires "-I ./ragel" to be included in the call. I know that the change needs to be in: tasks\ragel_extension_task.rb and force adding it to this line makes it work: sh "ragel #{flags} -I ./ragel #{lang_ragel(machine)} -o #{target(machine)}"

I'm sorry I don't yet know the correct way to add this in. If someone does, it would help a lot.

I will continue to explore.

Resolving this issue is not necessary for installing and using the Gem on Windows. Pull request #62 already does that.

The fix for this issue is needed only for people who want to compile the gem on Windows.

MSP-Greg commented 4 years ago

See Puma's CI. Windows Rubies build with MSYS2, so just use the MSYS2 ragel package. Installs with:

pacman -S mingw-w64-x86_64-ragel
heliocola commented 8 months ago

Puma is another good reference in release pre-compiled releases!

MSP-Greg commented 8 months ago

@heliocola

There may be some confusion regarding the term 'pre-compiled' gem. Puma has never released 'pre-compiled' gems.

Pre-compiled gems always have a platform suffix, like nokogiri-1.16.0-x86_64-linux.gem or nokogiri-1.16.0-x86_64-darwin.gem, standard gems have no suffix, like nokogiri-1.16.0.gem.

Some may use the term 'extension' gems, which are gems that typically have c source code in them, as this gem does. Extension gems always release a standard gem, they optionally can release pre-compiled gems.

One issue with pre-compiled gems is they have an upper bound on the Ruby version they can be installed on.

JFYI, I'm still working (9:35 PM local, not on OSS), so I don't have time for a longer explanation.

heliocola commented 8 months ago

Thank you @MSP-Greg !!! I really appreciate all the work you do! And all the comments.