Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix load path
Browse files Browse the repository at this point in the history
spacewander committed Dec 4, 2020
1 parent bf7f4af commit 917d933
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions apisix/cli/env.lua
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ return function (apisix_home, pkg_cpath_org, pkg_path_org)
.. apisix_home .. "/deps/lib/lua/5.1/?.so;"

local pkg_path = apisix_home .. "/?/init.lua;"
.. apisix_home .. "/deps/share/lua/5.1/?/init.lua;"
.. apisix_home .. "/deps/share/lua/5.1/?.lua;;"

package.cpath = pkg_cpath .. package.cpath
12 changes: 7 additions & 5 deletions t/APISIX.pm
Original file line number Diff line number Diff line change
@@ -135,6 +135,11 @@ add_block_preprocessor(sub {
my ($block) = @_;
my $wait_etcd_sync = $block->wait_etcd_sync // 0.1;

my $lua_deps_path = <<_EOC_;
lua_package_path "$apisix_home/?.lua;$apisix_home/?/init.lua;$apisix_home/deps/share/lua/5.1/?/init.lua;$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;;";
lua_package_cpath "$apisix_home/?.so;$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;;";
_EOC_

my $main_config = $block->main_config // <<_EOC_;
worker_rlimit_core 500M;
env ENABLE_ETCD_AUTH;
@@ -150,9 +155,7 @@ _EOC_

my $stream_enable = $block->stream_enable;
my $stream_config = $block->stream_config // <<_EOC_;
lua_package_path "$apisix_home/?.lua;$apisix_home/?/init.lua;$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;;";
lua_package_cpath "$apisix_home/?.so;$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;;";
$lua_deps_path
lua_socket_log_errors off;
lua_shared_dict lrucache-lock-stream 10m;
@@ -232,8 +235,7 @@ _EOC_

my $http_config = $block->http_config // '';
$http_config .= <<_EOC_;
lua_package_path "$apisix_home/?.lua;$apisix_home/?/init.lua;$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;;";
lua_package_cpath "$apisix_home/?.so;$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;;";
$lua_deps_path
lua_shared_dict plugin-limit-req 10m;
lua_shared_dict plugin-limit-count 10m;

0 comments on commit 917d933

Please sign in to comment.