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

Remove rexml - rexml broken in Ruby versions below 2.3 #1800

Closed
jordansissel opened this issue Jun 29, 2021 · 4 comments
Closed

Remove rexml - rexml broken in Ruby versions below 2.3 #1800

jordansissel opened this issue Jun 29, 2021 · 4 comments

Comments

@jordansissel
Copy link
Owner

Another game to play just like #1795. This time, it's rexml.

rexml is a direct dependency in fpm and is used by only one place, osxpkg.rb

https://github.com/jordansissel/fpm/blob/master/lib/fpm/package/osxpkg.rb#L107

It looks like this code is only used when fpm -s osxpkg ... (using an osx package as source/input to fpm).

I'm guessing we can probably remove rexml and parse the xml ourselves without a library.

pkginfo_elem = doc.elements["pkg-info"]
identifier = pkginfo_elem.attribute("identifier").value
self.version = pkginfo_elem.attribute("version").value

It's used to grab the attributes from what looks like <pkg-info identifier="..." version="..."> element.

Reference: #1784 and #1798

@rubyFeedback
Copy link

Good old XML ... may it rest in peace.

(I stopped using XML already in 2005 or so, at the least for my own projects. YAML replaced my personal needs in this regard.)

@jordansissel
Copy link
Owner Author

#1950 should fix this by moving delaying the loading of rexml and only using that library when attempting to read a macOS .pkg file.

jordansissel added a commit that referenced this issue Nov 3, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
jordansissel added a commit that referenced this issue Nov 3, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
jordansissel added a commit that referenced this issue Nov 3, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
@jordansissel
Copy link
Owner Author

#1950 is merged. Closing this :)

jordansissel added a commit that referenced this issue Nov 4, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
@jordansissel
Copy link
Owner Author

fpm 1.15.0 is released and, I believe, has resolve this issue. Please let me know if you find otherwise in a new issue (if a new problem) or this issue (if same problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants