yjh0502 / erl-brotli

Brotli encoder NIF for Erlang
Other
29 stars 17 forks source link

brotli/port.h error in Erlang/OTP 26 #19

Closed stefholbrook closed 1 year ago

stefholbrook commented 1 year ago

Hi! I'm running into an issue that I'm hoping you can help me with. It looks like brotli doesn't compile when using OTP 26. I was running 25 locally where everything ran fine, and saw the error in our CI where we're running OTP 26. I was then able to reproduce the error locally when switching to Erlang version 26.0.2. Thanks in advance!

Steps to reproduce:

  1. Switch to latest Erlang asdf local erlang 26.0.2
  2. rm -rf _build deps
  3. mix do deps.get, deps.compile

Error:

Error! Failed to eval: io:format("~s/erts-~s/include/", [code:root_dir(), erlang:system_info(version)]).

cc -O2 -g -fno-stack-check -O3 -std=c99 -finline-functions -Wall -fPIC -I  -I ./include/  -c brotli_nif.c -o brotli_nif.o
Error! Failed to eval: io:format("~s/erts-~s/include/", [code:root_dir(), erlang:system_info(version)]).

clang: warning: ./include/: 'linker' input unused [-Wunused-command-line-argument]
In file included from brotli_nif.c:32:
./include/brotli/decode.h:15:10: fatal error: 'brotli/port.h' file not found
#include <brotli/port.h>
         ^~~~~~~~~~~~~~~
1 error generated.
Error! Failed to eval: io:format("~s/erts-~s/include/", [code:root_dir(), erlang:system_info(version)]).

cc -O2 -g -fno-stack-check -O3 -std=c99 -finline-functions -Wall -fPIC -I  -I ./include/  -c common/constants.c -o common/constants.o
Error! Failed to eval: io:format("~s/erts-~s/include/", [code:root_dir(), erlang:system_info(version)]).

make: *** [brotli_nif.o] Error 1
make: *** Waiting for unfinished jobs....
clang: warning: ./include/: 'linker' input unused [-Wunused-command-line-argument]
In file included from common/constants.c:7:
In file included from common/./constants.h:15:
common/./platform.h:28:10: fatal error: 'brotli/port.h' file not found
#include <brotli/port.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [common/constants.o] Error 1
yjh0502 commented 1 year ago

I'm looking into the issue.

yjh0502 commented 1 year ago

@stefholbrook Could you confirm if the issue is fixed with v0.3.2?

stefholbrook commented 1 year ago

@yjh0502 It worked! I was initially getting an error, but just had to unset LDFLAGS. Thank you!!