luaexpat icon indicating copy to clipboard operation
luaexpat copied to clipboard

Newer MacOS has sufficiently new libExpat but is missing `expat_config.h`

Open alerque opened this issue 3 years ago • 3 comments

Trying to bump a luaexpeat dependency on something in Homebrew I ran into trouble moving to 1.5.x because for whatever reason even the newer versions of libExpat don't supply expat_config.h as expected.

See https://github.com/Homebrew/homebrew-core/pull/114831#issuecomment-1304830770

This may be something upstream in libExpat, or it could be just an expectation that luaexpat needs to adjust.

alerque avatar Nov 07 '22 20:11 alerque

That file is needed. The settings in that file can change the ABI of the resuling compiled lib. So you need the specific version of the header file that was used to compile the binary.

On MacOS I typically do a brew info expat to find the location (in my case /usr/local/Cellar/expat/2.4.8), and then follow that up with the luarocks command like this;

luarocks install luaexpat EXPAT_DIR=/usr/local/Cellar/expat/2.4.8

Tieske avatar Nov 08 '22 10:11 Tieske

Hello guys. I'm facing the same error above, howerver, I'm running luarocks inside a CentOs Docker container. This is commando I run

RUN luarocks install luaexpat 1.5.0

and this is the error

src/lxplib.c:12:26: fatal error: expat_config.h: No such file or directory
 #include "expat_config.h"
                          ^
compilation terminated.

Error: Build error: Failed compiling object src/lxplib.o

So, my question is: how to solve that inside a docker container?

felipepazsquid avatar Nov 11 '22 18:11 felipepazsquid

@felipepazsquid Do you have the expat-dev or equivalent package installed on CentOS? Many distros split up library packages to have just the binaries with the header files in a separate package. You likely need the -dev or -devel or whatever RHEL is calling it these days for whatever provides libexpat.

alerque avatar Nov 11 '22 18:11 alerque