jgarber / redcloth

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

Restore JRuby support #44

Open headius opened 6 years ago

headius commented 6 years ago

We need RedCloth to work on JRuby, since it is used by many applications. Support for JRuby was removed around April 2016 during work on CVE-2012-6684.

What can we do to help restore it?

headius commented 6 years ago

Link #31

joshuasiler commented 6 years ago

We don't have any maintainers that currently use JRuby or have incentive to learn about it. If you wish to become a maintainer, then great! Please submit a PR with your updates and we can get them incorporated.

dometto commented 5 years ago

Seems this was closed a little abruptly. What would be needed to restore JRuby support?

headius commented 4 years ago

@dometto It looks like they removed it because none of the current maintainers use JRuby. So, I guess we need to put together a PR that restores support and get someone added that can maintain it (with someone from JRuby team as a backup, perhaps).

mohits commented 4 years ago

OK, just a small update here. If we update the installed version of RedCloth-4.2.9-java with the new versions of the files in: /lib/redcloth/formatters/*.rb functionally, it runs same as 4.3.2

I will try to see what it takes to get it to work properly so that I can suggest what needs to be done. Maybe, then with some help from @headius or others in the JRuby team, we can have an option for RedCloth to work on JRuby also.

(Noted, of couse, that we do need to solve the maintainers issue for this and for Windows)

headius commented 4 years ago

So really no changes at all were needed to reinstate JRuby support? Well that's great, and a little disappointing that support was dropped without contacting anyone from JRuby. 😢

@joshuasiler What is the overhead of maintaining the JRuby support? It seems like it hasn't changed in years (like most of this library), and the only JRuby-specific code is generated by Ragel. We'd be happy to include RedCloth head in the JRuby CI, and hopefully get someone from the community to help out... but what really needs to be done?

@mohits Once you get the basics working I'd say to submit a PR or point us at your branch so we can help finish it. We have people report that RedCloth doesn't work fairly often, so I'm excited to get it back up and going again on JRuby!

joshuasiler commented 4 years ago

The overhead of maintaining JRuby support would be first to have a maintainer interested in maintaining JRuby support. That person could then scope the updates required and make changes as required. If someone has interest, please let me know and we can open up commit access.

mohits commented 4 years ago

@joshuasiler, @headius

Let me go over this either today or latest by the weekend and see if I can set up and manage things the correct way (I probably need a Linux VM to check a few things, alongside my Windows setup). I use both Windows and JRuby, so I'm keen to have this working.

Assuming it all looks good and is proprly done, maybe, I can volunteer to support as maintainer for both the platforms. Of the 22 open issues, that would help us close 5 if these items are handled, and both platforms would be good to go again.

Thanks for your support thus far and for your patience.

headius commented 4 years ago

@mohits Thank you! ❤️

mohits commented 4 years ago

Hi @headius and @joshuasiler

Some updates on this. I have been able to set up the environment to build the JRuby fat gem using the setup for 4.2.9. With that in place, I have been able to build up from v4.3.2-stable to bring back JRuby fat gem support. The branch is at:https://github.com/mohits/redcloth/tree/br_4.3.2_add-Jruby

On my setup (RVM on Linux VM with Ruby 2.7.0 and JRuby 9.2.11.0 and all necessary gems installed as mentioned in the guide), this does work and builds the gems.

It's not perfect yet (things have changed since the gems were last built, I guess) and I had to patch rake to get it to build with a new OpenJDK but it is progress. For now, I commented out Windows since I'm not sure if we need to support older Ruby on Windows. With the new setups, Ruby on Windows >= 2.4 will properly build the native extension anyway.

I still need to explore a bit more :-)

bartkamphorst commented 3 years ago

Curious to hear where things stand on this currently, @mohits ! On behalf of gollum-users, thanks for working on redcloth JRuby support!

dometto commented 3 years ago

@mohits seconding @bartkamphorst's request and thanks :)

headius commented 3 years ago

I pinged @mohits on Twitter to stop by and let us know status. It may just need a little help to push it over the line!

mohits commented 8 months ago

I hope to get back to this in February after I set up the VM that I was using for testing that things work fine. At the last point, there were only a couple of encoding related tests that were failing. I will ask for help again when I get stuck.

headius commented 8 months ago

JRuby team is standing by to help!

heliocola commented 6 months ago

@mohits : I would like to work on this first, before the other PR about t.

I took a quick look on this branch you have, but I must say this is not at all my area of expertise.

With that said, if you or @headius can share any documentation and gems that I could look into, I will get this ball rolling.

headius commented 6 months ago

@heliocola Hello! I would love to help guide you and assist where I am able. This is largely a porting exercise, so looking at the native code and comparing it with the Java code should provide a lot of guidance. I am happy to answer any questions along the way or point you to other examples of completed and working JRuby extensions.