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

Installed gems using vendored libraries report inappropriate library paths in nokogiri -v #1482

Closed
flavorjones opened this issue Jun 6, 2016 · 4 comments · Fixed by #1859
Milestone

Comments

@flavorjones
Copy link
Member

Cross-compiled windows gem contains misleading and incorrect library paths in VersionInfo:

C:\Users\admin>nokogiri -v
# Nokogiri (1.6.8)
    ---
    warnings: []
    nokogiri: 1.6.8
    ruby:
      version: 2.2.4
      platform: x64-mingw32
      description: ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]
      engine: ruby
    libxml:
      binding: extension
      source: packaged
      libxml2_path: "/home/flavorjones/code/oss/nokogiri/ports/x86_64-w64-mingw32/libxml2/2.9.4"
      libxslt_path: "/home/flavorjones/code/oss/nokogiri/ports/x86_64-w64-mingw32/libxslt/1.1.29"
      libxml2_patches: []
      libxslt_patches: []
      compiled: 2.9.4
      loaded: 2.9.4

Really, we should alter VersionInfo to only contain these paths if using the system libraries, regardless of platform.

@flavorjones
Copy link
Member Author

I'll note that all installed gems do this if they're using vendored libraries:

$ nokogiri -v
# Nokogiri (1.10.0)
    ---
    warnings: []
    nokogiri: 1.10.0
    ruby:
      version: 2.6.0
      platform: x86_64-linux
      description: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
      engine: ruby
    libxml:
      binding: extension
      source: packaged
      libxml2_path: "/home/flavorjones/.rvm/gems/ruby-2.6.0/gems/nokogiri-1.10.0/ports/x86_64-pc-linux-gnu/libxml2/2.9.9"
      libxslt_path: "/home/flavorjones/.rvm/gems/ruby-2.6.0/gems/nokogiri-1.10.0/ports/x86_64-pc-linux-gnu/libxslt/1.1.33"
      libxml2_patches:
      - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
      libxslt_patches: []
      compiled: 2.9.9
      loaded: 2.9.9

$ ls /home/flavorjones/.rvm/gems/ruby-2.6.0/gems/nokogiri-1.10.0/ports/x86_64-pc-linux-gnu/libxml2/2.9.9
ls: cannot access '/home/flavorjones/.rvm/gems/ruby-2.6.0/gems/nokogiri-1.10.0/ports/x86_64-pc-linux-gnu/libxml2/2.9.9': No such file or directory

and so what I recommended above should be the action we take here: VersioInfo shouldn't track/display these paths unless the gem is using system libraries.

@flavorjones flavorjones added this to the v1.10.x patch releases milestone Jan 5, 2019
@flavorjones flavorjones changed the title Cross-compiled windows gem contains inappropriate library paths Installed gems using vendored libraries report inappropriate library paths in nokogiri -v Jan 5, 2019
@flavorjones
Copy link
Member Author

So what this really means is that the paths are not useful, and we should remove them entirely. Because that would be a (slight) breaking change I'm going to move this into the v1.11.0 milestone.

flavorjones added a commit that referenced this issue Jan 12, 2019
some backwards-incompatible changes here that I don't expect actually
break anything for anyone:

* Nokogiri::VersionInfo will no longer contain the following
  keys (previously these were set only when vendored libraries were
  being used):
  * `libxml/libxml2_path`
  * `libxml/libxslt_path`
* `nokogiri -v` will no longer emit these VersionInfo values
* these C macros will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH
* these global variables will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH

Fixes #1482
@flavorjones
Copy link
Member Author

See PR at #1859 which is scheduled for v1.11.0.

flavorjones added a commit that referenced this issue Jan 12, 2019
some backwards-incompatible changes here that I don't expect actually
break anything for anyone:

* Nokogiri::VersionInfo will no longer contain the following
  keys (previously these were set only when vendored libraries were
  being used):
  * `libxml/libxml2_path`
  * `libxml/libxslt_path`
* `nokogiri -v` will no longer emit these VersionInfo values
* these C macros will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH
* these global variables will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH

Fixes #1482
flavorjones added a commit that referenced this issue Jan 26, 2019
some backwards-incompatible changes here that I don't expect actually
break anything for anyone:

* Nokogiri::VersionInfo will no longer contain the following
  keys (previously these were set only when vendored libraries were
  being used):
  * `libxml/libxml2_path`
  * `libxml/libxslt_path`
* `nokogiri -v` will no longer emit these VersionInfo values
* these C macros will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH
* these global variables will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH

Fixes #1482
flavorjones added a commit that referenced this issue Jan 11, 2020
some backwards-incompatible changes here that I don't expect actually
break anything for anyone:

* Nokogiri::VersionInfo will no longer contain the following
  keys (previously these were set only when vendored libraries were
  being used):
  * `libxml/libxml2_path`
  * `libxml/libxslt_path`
* `nokogiri -v` will no longer emit these VersionInfo values
* these C macros will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH
* these global variables will no longer be defined:
  * NOKOGIRI_LIBXML2_PATH
  * NOKOGIRI_LIBXSLT_PATH

Fixes #1482
@flavorjones
Copy link
Member Author

With PR applied, output looks like:

$ ruby -Ilib bin/nokogiri -v
# Nokogiri (1.10.4)
    ---
    warnings: []
    nokogiri: 1.10.4
    ruby:
      version: 2.7.0
      platform: x86_64-linux
      description: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
      engine: ruby
    libxml:
      binding: extension
      source: packaged
      libxml2_patches:
      - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
      - 0002-Remove-script-macro-support.patch
      - 0003-Update-entities-to-remove-handling-of-ssi.patch
      - 0004-libxml2.la-is-in-top_builddir.patch
      libxslt_patches: []
      compiled: 2.9.10
      loaded: 2.9.10

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

Successfully merging a pull request may close this issue.

1 participant