Skip to content
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

Nokogiri 1.17 breaking boilerplate processing #442

Closed
opoudjis opened this issue Dec 9, 2024 · 12 comments
Closed

Nokogiri 1.17 breaking boilerplate processing #442

opoudjis opened this issue Dec 9, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

opoudjis commented Dec 9, 2024

Appears to be triggered by smartquote processing done as a traverse

@opoudjis opoudjis added the bug Something isn't working label Dec 9, 2024
@opoudjis opoudjis self-assigned this Dec 9, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Dec 9, 2024
@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 9, 2024

Somehow, random text or classes are being injected into the XML document tree, with the result that not all children of traverse are Nokogiri::XML::Node.

I am removing traverse and replacing it with XPath in quotes cleanup, and even then, there is content other than Node when I go through XPath. I strongly suspect this is a bug with the newly released Nokogiri 1.17 (which is already crashing for others), but I am trying this hotfix out first.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 9, 2024

I've wasted three hours trying to work out why Nokogiri 1.17 is crashing, and I do not have three spare hours to waste. A bug has already been reported in sparklemotion/nokogiri#3359, and I have no idea if that is the issue or not, but I am freezing Nokogiri for Metanorma on 1.16. I will use html2doc to do so, as a dependency of isodoc > metanorma-standoc

The error seems to be happening at <script>Latn</script>, so there may be Nokogiri trying to do special processing with HTML scripts; it is happening not when the boilerplate is processed, but when the boilerplate XML is merged into the main document.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 9, 2024

@CAMOBAP has investigated, and html2doc is too late in the load chain to constrain the version of Nokogiri.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 9, 2024

I cannot reproduce the binding of Nokogiri locally, it is still going to the specified 1.16.8 from html2doc. The earliest invocation of Nokogiri is asciimath2unitsml and mathml2asciimath, which are followed immediately by fontist and then the relaton suite. html2doc loads only after these.

The two gems are redundant, and will be eliminated: metanorma/metanorma-standoc#947 . But I'm going to use them for now to try to constrain Nokogiri. I clearly do need to constrain it closer to home, preferably isodoc or metanorma-utils.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 9, 2024

I'll try constraining it in isodoc first

opoudjis added a commit to metanorma/isodoc that referenced this issue Dec 9, 2024
@opoudjis
Copy link
Contributor Author

It's not working, and frankly, I don't have the headspace for this any more, especially with @ronaldtse demanding that I do other things. @CAMOBAP please help. I have released isodoc 2.12.4 to constrain Nokogiri, I am rerunning https://github.com/metanorma/metanorma-ietf/actions/runs/12246534137 to keep trying to refresh it, and it keeps being ignored. I understand why we are caching gems, but this is catastrophically bad right now, and this release is going to get worse.

@opoudjis
Copy link
Contributor Author

Half hour has elapsed, Nokogiri still stuck on 2.12.3. This is not a caching issue, isodoc always gets grabbed immediately on release, and updating asciimath2unitsml is not a real solution, though I will try that now anyway. I am at a loss.

opoudjis added a commit to plurimath/asciimath2unitsml that referenced this issue Dec 10, 2024
@opoudjis
Copy link
Contributor Author

I can't update asciimath2unitsml, it's refusing to update ffi.

I give up.

@opoudjis
Copy link
Contributor Author

At @andrew2net 's suggestion, forcing isodoc dependency via standoc

opoudjis added a commit to metanorma/metanorma-standoc that referenced this issue Dec 10, 2024
opoudjis added a commit to metanorma/metanorma-ietf that referenced this issue Dec 10, 2024
@opoudjis
Copy link
Contributor Author

Thank you @andrew2net that seems to have worked. I am going to do an emergency fix of metanorma/bipm-si-brochure#225 tonight, and then rerelease all gems with explicit updated standoc dependencies, to force Nokogiri downgrade.

@ronaldtse
Copy link

ronaldtse commented Dec 10, 2024

I can't update asciimath2unitsml, it's refusing to update ffi.

According to this page:

The asciimath2unitsml gem has been deprecated and replaced by the plurimath gem. Time to remove it from the stack?

Ping @suleman-uzair for help on how to migrate usage here.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Metanorma Dec 10, 2024
@opoudjis
Copy link
Contributor Author

The asciimath2unitsml gem has been deprecated and replaced by the plurimath gem. Time to remove it from the stack?

Yes, I have scheduled that in ticket metanorma/metanorma-standoc#947

cc @suleman-uzair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants