Skip to content

add pcre build support for alpine & alpine-fat #108

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

Closed
chrisLeeTW opened this issue Jun 9, 2019 · 7 comments
Closed

add pcre build support for alpine & alpine-fat #108

chrisLeeTW opened this issue Jun 9, 2019 · 7 comments

Comments

@chrisLeeTW
Copy link

chrisLeeTW commented Jun 9, 2019

Hello,

I've faced the same problem for this issue (openresty/lua-resty-core#258) with alpine & alpine-fat.

It's looks like there no pcre support during the compilation.

May I know that is intended behavior or just some thing missing before ?

Thanks.

@neomantra
Copy link
Member

We install PCRE ourselves as is needed for the OpenResty build, but maybe we need to do what agentzh refers to here. I will research it further.

@vkill
Copy link

vkill commented Jul 7, 2019

+1

@neomantra
Copy link
Member

@vkill Thanks for the PR. There's also the Nginx compile lines in that link I have above... I'll pow wow with the OpenResty packagers this week to nail down the exact incantations needed.

I'm worried that what you have in the PR fixes one thing but doesn't fix others. But I also wonder if your PR also fixes #22, which would be great.

I also want to fix all the build-from-source images in one swoop, so will expand it to that.

@vkill
Copy link

vkill commented Jul 9, 2019

Hi @neomantra , #22 was fixed. the --enable-utf --enable-unicode-properties options make it effective. And the options same as openresty travis.yml .

The nginx.conf

worker_processes  1;

events {
    worker_connections 4;
}

http {
    server {
        listen 81;

        location /re {
            content_by_lua_block {
                local ngx_re = require "ngx.re"

                local res, err = ngx_re.split("a,b,c,d", ",")
                if err then
                    ngx.log(ngx.ERR, "failed: ", err)
                    return
                end

                for i = 1, #res do
                    ngx.say(res[i])
                end

                local newstr, n, err = ngx.re.gsub("测 试 用 例", "[ \t]", "", "ju")
                ngx.say(newstr)
            }
        }
    }
}

The result

$ docker run --name or_re_test_2 --rm -p 9002:81 -v $(pwd)/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf vkill/openresty:alpine-with-pcre
$ curl http://127.0.0.1:9002/re

a
b
c
d
测试用例

The ldd result

/ # ldd /usr/local/openresty/nginx/sbin/nginx 
	/lib/ld-musl-x86_64.so.1 (0x7fda9d2b5000)
	libluajit-5.1.so.2 => /usr/local/openresty/luajit/lib/libluajit-5.1.so.2 (0x7fda9ccbd000)
	libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x7fda9cc49000)
	libz.so.1 => /lib/libz.so.1 (0x7fda9cc2f000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fda9d2b5000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fda9cc1b000)

@neomantra
Copy link
Member

neomantra commented Jul 11, 2019

@vkill @chrisLeeTW I've just pushed a modified version of the #113 pull request. Please check it out and let me know if it works for you. I'm adding one more change to this release and then will tag it. Thanks for the testing and the direction for fixing this issue.

@vkill I'm going to close your PR once this is released but if you want to be in the AUTHORS file, give me the name+email you want in there (or no email is fine too).

Once the automated build is done, these will be at the simple alpine and alpine-fat image tags.

@vkill
Copy link

vkill commented Jul 12, 2019

@neomantra It works for me, and I was built the new image for apisix, it also works.

@neomantra
Copy link
Member

Great, I just tagged 1.15.8.1-3 with this. Thanks again for the help.

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

No branches or pull requests

3 participants