mozilla-services / lua_sandbox_extensions

Extension packages (sandboxes and modules) for the lua_sandbox project
Other
72 stars 55 forks source link

missing some file in Lpeg extension #229

Closed ruiaylin closed 6 years ago

ruiaylin commented 6 years ago

Some file missing after install

I was testing hindsight those days , and i face a problem about installing lua_sandbox_extensions.

there are many files in lua_sandbox_extensions/lpeg/modules/lpeg/ folder. but when i installed , some file missing .

some part install log:

make install 
....
-- Up-to-date: /usr/local/lib/luasandbox/modules
-- Up-to-date: /usr/local/lib/luasandbox/modules/lpeg
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/syslog_message.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/openssh_portable.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/sudo.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/kernel.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/pam.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/groupadd.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/groupdel.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/dhclient.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/named.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/su.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/login.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/cron.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/puppet_agent.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/sshd.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/useradd.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/systemd_logind.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/linux/dhcpd.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/syslog.lua
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/bsd
-- Installing: /usr/local/lib/luasandbox/modules/lpeg/bsd/filterlog.lua
... 

The file list in the install target folder

ll /usr/local/lib/luasandbox/modules/lpeg
total 80
drwxr-xr-x 2 root root  4096 Jan 30 17:54 bsd
-rw-r--r-- 1 root root  1839 Jan 30 16:36 cbufd.lua
drwxr-xr-x 2 root root  4096 Jan 30 17:54 linux
-rw-r--r-- 1 root root 15955 Jan 30 16:36 openssh_portable.lua
-rw-r--r-- 1 root root 10929 Jan 30 16:36 syslog.lua
-rw-r--r-- 1 root root 38178 Jan 30 16:36 syslog_message.lua

The origin folder's file list

tree lpeg/
lpeg/
├── CMakeLists.txt
├── CMakeLists.txt.lpeg
├── index.md
├── io_modules
│   └── decoders
│       └── nginx
│           ├── access.lua
│           └── error.lua
├── modules
│   └── lpeg
│       ├── common_log_format.lua
│       ├── date_time.lua
│       ├── escape_sequences.lua
│       ├── ip_address.lua
│       ├── logfmt.lua
│       ├── mysql.lua
│       ├── postfix.lua
│       └── printf.lua
├── tests
│   ├── common_log_format.lua
│   ├── date_time.lua
│   ├── escape_sequences.lua
│   ├── ip_address.lua
│   ├── logfmt.lua
│   ├── mysql.lua
│   ├── postfix.lua
│   ├── printf.lua
│   ├── printf_m1.lua
│   ├── printf_m2.lua
│   ├── printf_m3.lua
│   ├── printf_m4.lua
│   └── test.lua
└── test_sandbox.c

Is there something wrong ? I need help

trink commented 6 years ago

That looks correct but you should really be installing the package (rpm/deb). What is the actual problem/error you are seeing?

ameihm0912 commented 6 years ago

I ran into a similar problem using make install. Trying to recall the exact details, but I believe it had to do with installing anything in the repository that contains or is a cmake ExternalProject. In these cases, IIRC make install actually installs these files under release/ as the installation phase for ExternalProject happens during build.

I tried to find a nice way to work around it without having to install the external project files into their final destination during build, but couldn't come up with the right cmake configuration to get it working.

I just work around it by building the packages or TGZ and using those.

ruiaylin commented 6 years ago

@trink I want to use mysql.lua module, but after make install i can not found it at all .

ruiaylin commented 6 years ago

@ameihm0912 Thanks , I should using the way like yours .

ruiaylin commented 6 years ago

@trink @ameihm0912 Building package can work

tar zxvf luasandbox-lpeg-1.0.8-Linux.tar.gz
luasandbox-lpeg-1.0.8-Linux/lib/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/mysql.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/date_time.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/common_log_format.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/escape_sequences.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/postfix.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/ip_address.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/printf.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg/logfmt.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/re.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/modules/lpeg.so
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/io_modules/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/io_modules/decoders/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/io_modules/decoders/nginx/
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/io_modules/decoders/nginx/access.lua
luasandbox-lpeg-1.0.8-Linux/lib/luasandbox/io_modules/decoders/nginx/error.lua

The 'make install ' has the problem i described above .

trink commented 6 years ago

I just took a look based on https://github.com/mozilla-services/lua_sandbox_extensions/issues/229#issuecomment-361699986. The problem can be corrected by moving some of the install directives up to CMakeLists.txt instead of CMakeLists.txt.lpeg (as the same for the other external projects). It will addressed in the upcoming sprint. Thanks

trink commented 6 years ago

This repository is a collection of independent projects and cannot be installed as a single unit. It would require jumping through a number of hoops to achieve the suggested behavior but it is not something we will invest in. Please use make packages and install the individually generated packages as needed.