Skip to content

Conversation

@joast
Copy link

@joast joast commented Sep 15, 2022

Using default directories in publicly available gems can cause problems because the directories are used when building unless all of them are overridden. For this gem it means running "gem install" with "--with-magic-dir=..." and "--with-gnurx-dir=..." (yes, even if gnurx isn't installed on the system). Kind of annoying to have to look at a gem's extconf.rb to see what dir_config calls are being made and what needs to be overridden because of defaults that conflict with how ruby was configured/installed.

The above discovery was prompted by having libmagic installed in both the system default location and a non-standard location (that ruby uses for a bunch of other third-party libraries). The following warning was issued when trying to use the gem unless the gem was installed with both '--with-magic-dir=..." and "-with-gnurx-dir=...":

FileMagic v0.7.3: compiled magic version [5.40] does not match with
shared library magic version [5.43]

Using default directories in publicly available gems can cause problems
because the directories are used when building unless all of them are
overridden. For this gem it means running "gem install" with
"--with-magic-dir=..." and "--with-gnurx-dir=..." (yes, even if gnurx
isn't installed on the system). Kind of annoying to have to look at a
gem's extconf.rb to see what dir_config calls are being made and what
needs to be overridden because of defaults that conflict with how ruby
was configured/installed.

The above discovery was prompted by having libmagic installed in both
the system default location and a non-standard location (that ruby uses
for a bunch of other third-party libraries). The following warning was
issued when trying to use the gem unless the gem was installed with
both '--with-magic-dir=..." and "-with-gnurx-dir=...":

  FileMagic v0.7.3: compiled magic version [5.40] does not match with
  shared library magic version [5.43]
This is slightly different from the older changes because it allows
--with-magic-* to override the defaults in this file.
Looked at MANY gems and very few set paths for headers and/or libraries.
The vast majority expect --with-* options to be used when installing gems
that use things in non-standard places.

Old commit log entry:

Don't use default include and library directories with dir_config

Using default directories in publicly available gems can cause problems
because the directories are used when building unless all of them are
overridden. For this gem it means running "gem install" with
"--with-magic-dir=..." and "--with-gnurx-dir=..." (yes, even if gnurx
isn't installed on the system). Kind of annoying to have to look at a
gem's extconf.rb to see what dir_config calls are being made and what
needs to be overridden because of defaults that conflict with how ruby
was configured/installed.

The above discovery was prompted by having libmagic installed in both
the system default location and a non-standard location (that ruby uses
for a bunch of other third-party libraries). The following warning was
issued when trying to use the gem unless the gem was installed with
both '--with-magic-dir=..." and "-with-gnurx-dir=...":

  FileMagic v0.7.3: compiled magic version [5.40] does not match with
  shared library magic version [5.43]
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 this pull request may close these issues.

1 participant