Skip to content

libxml2 issue with Homebrew on Linux #2627

Answered by danielnachun
jcamiel asked this question in Linux
Discussion options

You must be logged in to vote

Two things here that might help:

  1. You probably need to add pkg-config as a Linux only dependency. That is how most Rust packages find libxml2.

  2. You should check if the final binaries you build are dynamically linked to libxml2, or if it's just using the headers. You can check what is dynamically linked to your binaries with ldd. If libxml2 is in that list, then libxml2 needs to be a run time dependency as well on Linux, and you should remove => :build after it. Note that because libxml2 is provided by macOS but not Linux, we typically use uses_from_macos "libxml2" (possibly followed by => :build) instead, unless the version of libxml2 provided by macOS is too old.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jcamiel
Comment options

Answer selected by jcamiel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Linux
Labels
None yet
2 participants