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

request help: building failed on Mac(2.11 ldap.h) #6068

Closed
ccwxl opened this issue Jan 10, 2022 · 17 comments
Closed

request help: building failed on Mac(2.11 ldap.h) #6068

ccwxl opened this issue Jan 10, 2022 · 17 comments
Labels
doc Documentation things

Comments

@ccwxl
Copy link

ccwxl commented Jan 10, 2022

Issue description

Installing https://luarocks.org/lualdap-1.2.6-1.src.rock

Error: Failed installing dependency: https://luarocks.org/lualdap-1.2.6-1.src.rock - Could not find header file for LDAP
No file ldap.h in /usr/include
No file ldap.h in /include
You may have to install LDAP in your system and/or pass LDAP_DIR or LDAP_INCDIR to the luarocks command.
Example: luarocks install lualdap LDAP_DIR=/usr/local
make: *** [deps] Error 1

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):
@ccwxl ccwxl changed the title mac 编译2.11 mac 编译2.11 ldap.h Jan 10, 2022
@juzhiyuan juzhiyuan added the checking check first if this issue occurred label Jan 10, 2022
@juzhiyuan juzhiyuan changed the title mac 编译2.11 ldap.h request help: building failed on Mac(2.11 ldap.h) Jan 10, 2022
@juzhiyuan
Copy link
Member

Hi @siaron, please provide the information:

  1. Which documentation you're following to build? (Please paste the link here);
  2. What are your steps to install it? so we could try to reproduce.

@juzhiyuan juzhiyuan added wait for update wait for the author's response in this issue/PR and removed checking check first if this issue occurred labels Jan 10, 2022
@juzhiyuan
Copy link
Member

I noticed the same error like #3894 (comment) please have a check

@ccwxl
Copy link
Author

ccwxl commented Jan 10, 2022

  1. macbook 编译apisix 执行 LUAROCKS_SERVER=https://luarocks.cn make deps
Error: Failed installing dependency: https://luarocks.org/lualdap-1.2.6-1.src.rock - Could not find header file for LDAP
  No file ldap.h in /usr/local/include
  No file ldap.h in /usr/include
  No file ldap.h in /include
You may have to install LDAP in your system and/or pass LDAP_DIR or LDAP_INCDIR to the luarocks command.
Example: luarocks install lualdap LDAP_DIR=/usr/local
make: *** [deps] Error 1
  1. 已经安装brew install openldap
  2. 编译安装时可以指定LDAP_DIR=xxx吗?

@ccwxl
Copy link
Author

ccwxl commented Jan 10, 2022

2. brew install openldap

有没有mac的解决方式

@tokers
Copy link
Contributor

tokers commented Jan 11, 2022

@siaron The LDAP_DIR can be specified to the LuaRocks config file, see https://github-wiki-see.page/m/luarocks/luarocks/wiki/Config-file-format#Variables for details.

@tzssangglass
Copy link
Member

my ~/.luarocks/config-5.1.lua is like

variables = {
   LDAP_DIR = "/usr/local/opt/openldap",
   LDAP_INCDIR = "/usr/local/opt/openldap/include",
   OPENSSL_INCDIR = "/usr/local/opt/openresty-openssl111/include",
   OPENSSL_LIBDIR = "/usr/local/opt/openresty-openssl111/lib",
   PCRE_DIR = "/usr/local/Cellar/pcre/8.45",
   PCRE_INCDIR = "/usr/local/Cellar/pcre/8.45/include"
}

@tzssangglass
Copy link
Member

In fact, if you don't understand the build process, it is not recommended to develop on mac, there will be many incompatibilities and you will need to maintain it yourself.

@leslie-tsang
Copy link
Member

Hello there, it's not recommended to develop on unfamiliar operating systems.
Introducing multiple unknowns at the same time, it's going to be a long day to figure out if something is wrong or not.

编译安装时可以指定LDAP_DIR=xxx吗?

Sure, LDAP_DIR defined by LuaRocks config file, more detail in luarocks wiki

@juzhiyuan juzhiyuan added the doc Documentation things label Jan 11, 2022
@xuminwlt
Copy link

macos下也可以自行安装部分依赖

  1. Openresty:用于编译和运行部分代码,单元测试时使用openresty下的nginx环境变量。
brew install openresty
  1. luarocks:用于编译和运行时的lua依赖,其他环境参考:

    https://github.com/apache/apisix/blob/master/utils/linux-install-luarocks.sh。

brew install luarocks
  1. openldap
brew install openldap
#将ldap加入到luarocks环境
luarocks config variables.LDAP_DIR /usr/local/Cellar/openldap/2.5.6
  1. 创建ldap依赖:luarocks参考:https://github.com/luarocks/luarocks/wiki/config
#apisix需要ldap的依赖才能编译运行
luarocks lua_version 5.1
luarocks install lualdap

@leslie-tsang
Copy link
Member

@juzhiyuan Consider solved. Feel free to reopen it if needed.

@kwanhur
Copy link
Contributor

kwanhur commented Jan 28, 2022

I got this trouble too, brew info openldap show installed dir /usr/local/opt/openldap, setted LDAP_DIR then make deps successfully.

So, suggest to post this prerequisite.

@juzhiyuan
Copy link
Member

I got this trouble too, brew info openldap show installed dir /usr/local/opt/openldap, setted LDAP_DIR then make deps successfully.

So, suggest to post this prerequisite.

Hi @kwanhur, Would you like to improve the docs?

@juzhiyuan juzhiyuan removed the wait for update wait for the author's response in this issue/PR label Jan 28, 2022
@kwanhur
Copy link
Contributor

kwanhur commented Jan 29, 2022

I got this trouble too, brew info openldap show installed dir /usr/local/opt/openldap, setted LDAP_DIR then make deps successfully.
So, suggest to post this prerequisite.

Hi @kwanhur, Would you like to improve the docs?

yep, #6227

@Chever-John
Copy link
Contributor

Is this a MAC specific problem?
I'm curious, how did you install the openLDAP? @tzssangglass
Guess that:

brew install openldap
&
luarocks config variables.LDAP_DIR /usr/local/Cellar/openldap/2.5.6

my ~/.luarocks/config-5.1.lua is like

variables = {
   LDAP_DIR = "/usr/local/opt/openldap",
   LDAP_INCDIR = "/usr/local/opt/openldap/include",
   OPENSSL_INCDIR = "/usr/local/opt/openresty-openssl111/include",
   OPENSSL_LIBDIR = "/usr/local/opt/openresty-openssl111/lib",
   PCRE_DIR = "/usr/local/Cellar/pcre/8.45",
   PCRE_INCDIR = "/usr/local/Cellar/pcre/8.45/include"
}

@tzssangglass
Copy link
Member

I'm curious, how did you install the openLDAP? @tzssangglass

yes.

Is this a MAC specific problem?

Yes, this is only required on MAC.

@Chever-John
Copy link
Contributor

I'm curious, how did you install the openLDAP? @tzssangglass

yes.

Is this a MAC specific problem?

Yes, this is only required on MAC.

Thinks, this news is of great use to me.

@gogogo1024
Copy link

gogogo1024 commented May 18, 2022

may be possibly has the same problem
Lua 5.4.4 macOS 12.4

brew install openldap
openldap version is 2.6.2, so lualdap version is apisix's dependencies lualdap version 1.2.6-1 needs to find header file for LDAP, but always No file ldap.h in /usr/local/Cellar/openldap/2.5.6/include , in /usr/local/Cellar/openldap/2.6.2/include I find the ldap.h .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation things
Projects
None yet
Development

No branches or pull requests

9 participants