-
-
Notifications
You must be signed in to change notification settings - Fork 897
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
Upstream truffleruby patches needed when using system libraries #2663
Upstream truffleruby patches needed when using system libraries #2663
Conversation
This should fix this currently-failing CI job: https://github.com/sparklemotion/nokogiri/actions/runs/3217744062/jobs/5261075281 |
d5e129f
to
5877756
Compare
Thanks for shipping this! I'll take a look shortly. |
5877756
to
cf5147e
Compare
Normally we don't run the suite against TR for every commit (because it takes so long we opt for a cron job), so I've just pushed a commit that tries to make sure CI will run TR when branch names have "truffle" in them. |
* Adapt tests for that configuration.
cf5147e
to
1b84162
Compare
Right. Since there is workflow_dispatch I should be able to schedule it on my fork manually. BTW for test speed, the main cost is the default NOKOGIRI_TEST_GC_LEVEL=major. Without that tests execute in just 1 minute for me locally. So maybe we should set NOKOGIRI_TEST_GC_LEVEL=normal for TruffleRuby, or GC less often and then we could run it in the gate/more often? |
Given these test times over 1 hour yeah I think we should definitely force GC less often 😅 |
@@ -203,10 +203,16 @@ warning_func(void *ctx, const char *msg, ...) | |||
VALUE doc = rb_iv_get(self, "@document"); | |||
VALUE rb_message; | |||
|
|||
#ifdef TRUFFLERUBY_NOKOGIRI_SYSTEM_LIBRARIES | |||
/* It is not currently possible to pass var args from native | |||
functions to sulong, so we work around the issue here. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've asked the TruffleNFI/Sulong team about that (@rschatz), and it sounds like a limitation of libffi (can't read varargs from a libffi callback), so probably nothing we can do about it in the short term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Links I've found about that from a quick search:
* That is causing too much overhead.
It runs in ~3min (with I'm unsure how useful it is to GC between tests on TruffleRuby. I would say not worth it given the huge overhead. |
Yes, the GC settings are there primarily to exercise CRuby and I wasn't even aware that TruffleRuby supported those settings. Please do feel free to add a commit that restores normal GC behavior for TR. I have a terribly busy day today, but I will circle back to this by the weekend. I'm glad we're green and look forward to staying green! |
* It takes about the same time as other CI jobs.
9879d4f
to
7b46d28
Compare
Thank you, @eregon! |
Thank you for merging! I plan to remove the patches in TruffleRuby after the next nokogiri release, because they shouldn't be needed anymore, they are currently only needed when using system libraries, and with this PR won't be necessary for future nokogiri versions (when using system libraries). |
OK. If it's helpful, for managing upstream version checks, these changes will show up in Nokogiri 1.14.0. |
What problem is this PR intended to solve?
#2491
Have you included adequate test coverage?
Yes.
Does this change affect the behavior of either the C or the Java implementations?
Only C, no need to change Java code.