Skip to content

Commit b259df6

Browse files
committed
Docs: dump shared libs from lambda
1 parent 1795ae1 commit b259df6

4 files changed

Lines changed: 854 additions & 0 deletions

File tree

docs/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Lambda Shared Libraries Documentation
2+
3+
This directory contains documentation of shared libraries available in different Lambda runtime environments.
4+
5+
## Files
6+
7+
- `node-20.md` - Shared libraries in Node.js 20 Lambda runtime
8+
- `node-22.md` - Shared libraries in Node.js 22 Lambda runtime
9+
- `node-24.md` - Shared libraries in Node.js 24 Lambda runtime
10+
11+
## How to Generate Library Lists
12+
13+
### Method 1: Using Shell Script via Lambda Endpoint (Easiest)
14+
15+
Execute the shell script directly via the appropriate Node.js runtime endpoint:
16+
17+
**For Node.js 20:**
18+
```bash
19+
curl -s "https://php-node20.vercel.app/exec?cmd=bash%20-c%20'for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20if%20[%20-d%20\"\$p\"%20];%20then%20echo%20\"===%20\$p%20===\";%20find%20\"\$p\"%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort%20|%20while%20read%20f;%20do%20echo%20\"\$(basename%20\$f)%20(\$(du%20-h%20\$f%20|%20cut%20-f1))\";%20done;%20fi;%20done'"
20+
```
21+
22+
**For Node.js 22:**
23+
```bash
24+
curl -s "https://php-node22.vercel.app/exec?cmd=bash%20-c%20'for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20if%20[%20-d%20\"\$p\"%20];%20then%20echo%20\"===%20\$p%20===\";%20find%20\"\$p\"%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort%20|%20while%20read%20f;%20do%20echo%20\"\$(basename%20\$f)%20(\$(du%20-h%20\$f%20|%20cut%20-f1))\";%20done;%20fi;%20done'"
25+
```
26+
27+
**For Node.js 24:**
28+
```bash
29+
curl -s "https://php-node24.vercel.app/exec?cmd=bash%20-c%20'for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20if%20[%20-d%20\"\$p\"%20];%20then%20echo%20\"===%20\$p%20===\";%20find%20\"\$p\"%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort%20|%20while%20read%20f;%20do%20echo%20\"\$(basename%20\$f)%20(\$(du%20-h%20\$f%20|%20cut%20-f1))\";%20done;%20fi;%20done'"
30+
```
31+
32+
### Method 2: Using PHP Script (JSON Output)
33+
34+
If you need JSON output, you can create a simple PHP script and execute it via the endpoint. However, the shell commands (Method 1 and 3) are recommended as they're simpler.
35+
36+
### Method 3: Simple find command
37+
38+
For a quick list of library files, use the appropriate endpoint:
39+
40+
**Node.js 20:**
41+
```bash
42+
curl -s "https://php-node20.vercel.app/exec?cmd=for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20echo%20\"===%20\$p%20===\";%20find%20\$p%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort;%20done"
43+
```
44+
45+
**Node.js 22:**
46+
```bash
47+
curl -s "https://php-node22.vercel.app/exec?cmd=for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20echo%20\"===%20\$p%20===\";%20find%20\$p%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort;%20done"
48+
```
49+
50+
**Node.js 24:**
51+
```bash
52+
curl -s "https://php-node24.vercel.app/exec?cmd=for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20echo%20\"===%20\$p%20===\";%20find%20\$p%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort;%20done"
53+
```
54+
55+
## Formatting the Results
56+
57+
When you get the JSON output, format it into the markdown file like this:
58+
59+
```markdown
60+
### /var/lang/lib
61+
62+
- libcrypto.so.3 (20.8 MB)
63+
- libssl.so.3 (5.6 MB)
64+
- ...
65+
66+
### /lib64
67+
68+
- libc.so.6
69+
- libm.so.6
70+
- ...
71+
```
72+
73+
## Usage
74+
75+
When analyzing which libraries to include in a package:
76+
77+
1. Check the appropriate runtime documentation (node-20.md, node-22.md, or node-24.md)
78+
2. Compare libraries in your package's `native/lib` with the list
79+
3. Remove libraries that already exist in Lambda
80+
4. Keep libraries that are not in the list or have version conflicts
81+
82+
## Runtime Endpoints
83+
84+
- **Node.js 20**: https://php-node20.vercel.app/
85+
- **Node.js 22**: https://php-node22.vercel.app/
86+
- **Node.js 24**: https://php-node24.vercel.app/
87+
88+
## Notes
89+
90+
- Libraries in `/var/task/lib` are application-specific and should not be documented here
91+
- Only document libraries provided by the Lambda runtime itself
92+
- Update these files when Lambda runtime versions change

docs/node-20.md

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# Lambda Node.js 20 Shared Libraries
2+
3+
This document lists all shared libraries (`*.so*`) available in the Lambda Node.js 20 runtime environment.
4+
5+
## Overview
6+
7+
- **Runtime**: Node.js 20
8+
- **Endpoint**: https://php-node20.vercel.app/
9+
- **Last Updated**: 2026-01-13
10+
- **Total Libraries**: ~380+ (varies by path)
11+
12+
## Library Paths
13+
14+
Lambda `LD_LIBRARY_PATH` includes:
15+
- `/var/task/lib` - Application-provided libraries
16+
- `/var/lang/lib` - Lambda runtime libraries
17+
- `/lib64` - System libraries
18+
- `/usr/lib64` - System libraries
19+
- `/var/runtime/lib` - Runtime libraries
20+
- `/opt/lib` - Optional libraries
21+
22+
## Libraries by Path
23+
24+
### /var/lang/lib
25+
26+
- libcrypto.so
27+
- libcrypto.so.3
28+
- libssl.so
29+
- libssl.so.3
30+
31+
### /lib64
32+
33+
- ld-linux-x86-64.so.2
34+
- libacl.so.1
35+
- libacl.so.1.1.2301
36+
- libanl.so.1
37+
- libarchive.so.13
38+
- libarchive.so.13.7.4
39+
- libassuan.so.0
40+
- libassuan.so.0.8.5
41+
- libattr.so.1
42+
- libattr.so.1.1.2501
43+
- libaudit.so.1
44+
- libaudit.so.1.0.0
45+
- libauparse.so.0
46+
- libauparse.so.0.0.0
47+
- libblkid.so.1
48+
- libblkid.so.1.1.0
49+
- libBrokenLocale.so.1
50+
- libbz2.so.1
51+
- libbz2.so.1.0.8
52+
- libc_malloc_debug.so.0
53+
- libc.so.6
54+
- libcap-ng.so.0
55+
- libcap-ng.so.0.0.0
56+
- libcap.so.2
57+
- libcap.so.2.73
58+
- libcom_err.so.2
59+
- libcom_err.so.2.1
60+
- libcrypto.so.3
61+
- libcrypto.so.3.2.2
62+
- libcurl.so.4
63+
- libcurl.so.4.8.0
64+
- libdl.so.2
65+
- libdnf.so.2
66+
- libdrop_ambient.so.0
67+
- libdrop_ambient.so.0.0.0
68+
- libffi.so.8
69+
- libffi.so.8.1.2
70+
- libform.so.6
71+
- libform.so.6.2
72+
- libformw.so.6
73+
- libformw.so.6.2
74+
- libgcc_s-14-20250110.so.1
75+
- libgcc_s.so.1
76+
- libgcrypt.so.20
77+
- libgcrypt.so.20.4.2
78+
- libgio-2.0.so.0
79+
- libgio-2.0.so.0.8200.2
80+
- libgirepository-1.0.so.1
81+
- libgirepository-1.0.so.1.0.0
82+
- libgirepository-2.0.so.0
83+
- libgirepository-2.0.so.0.8200.2
84+
- libglib-2.0.so.0
85+
- libglib-2.0.so.0.8200.2
86+
- libgmodule-2.0.so.0
87+
- libgmodule-2.0.so.0.8200.2
88+
- libgmp.so.10
89+
- libgmp.so.10.4.1
90+
- libgobject-2.0.so.0
91+
- libgobject-2.0.so.0.8200.2
92+
- libgpg-error.so.0
93+
- libgpg-error.so.0.32.0
94+
- libgpgme.so.11
95+
- libgpgme.so.11.32.1
96+
- libgssapi_krb5.so.2
97+
- libgssapi_krb5.so.2.2
98+
- libgssrpc.so.4
99+
- libgssrpc.so.4.2
100+
- libgthread-2.0.so.0
101+
- libgthread-2.0.so.0.8200.2
102+
- libhistory.so.8
103+
- libhistory.so.8.1
104+
- libidn2.so.0
105+
- libidn2.so.0.3.7
106+
- libjson-c.so.5
107+
- libjson-c.so.5.0.0
108+
- libk5crypto.so.3
109+
- libk5crypto.so.3.1
110+
- libkdb5.so.10
111+
- libkdb5.so.10.0
112+
- libkeyutils.so.1
113+
- libkeyutils.so.1.10
114+
- libkrad.so.0
115+
- libkrad.so.0.0
116+
- libkrb5.so.3
117+
- libkrb5.so.3.3
118+
- libkrb5support.so.0
119+
- libkrb5support.so.0.1
120+
- liblua-5.3.so
121+
- liblua-5.4.so
122+
- liblz4.so.1
123+
- liblz4.so.1.9.4
124+
- liblzma.so.5
125+
- liblzma.so.5.2.5
126+
- libm.so.6
127+
- libmagic.so.1
128+
- libmagic.so.1.0.0
129+
- libmemusage.so
130+
- libmenu.so.6
131+
- libmenu.so.6.2
132+
- libmenuw.so.6
133+
- libmenuw.so.6.2
134+
- libmodulemd.so.2
135+
- libmodulemd.so.2.13.0
136+
- libmount.so.1
137+
- libmount.so.1.1.0
138+
- libmpfr.so.6
139+
- libmpfr.so.6.1.0
140+
- libmvec.so.1
141+
- libncurses.so.6
142+
- libncurses.so.6.2
143+
- libncursesw.so.6
144+
- libncursesw.so.6.2
145+
- libnghttp2.so.14
146+
- libnghttp2.so.14.26.0
147+
- libnpth.so.0
148+
- libnpth.so.0.1.2
149+
- libnss_compat.so.2
150+
- libnss_dns.so.2
151+
- libnss_files.so.2
152+
- libnssckbi.so
153+
- libp11-kit.so.0
154+
- libp11-kit.so.0.3.0
155+
- libpanel.so.6
156+
- libpanel.so.6.2
157+
- libpanelw.so.6
158+
- libpanelw.so.6.2
159+
- libpcprofile.so
160+
- libpcre2-8.so.0
161+
- libpcre2-8.so.0.11.0
162+
- libpcre2-posix.so.3
163+
- libpcre2-posix.so.3.0.2
164+
- libpeas-1.0.so.0
165+
- libpeas-1.0.so.0.3200.0
166+
- libpopt.so.0
167+
- libpopt.so.0.0.1
168+
- libpsl.so.5
169+
- libpsl.so.5.3.5
170+
- libpsx.so.2
171+
- libpsx.so.2.73
172+
- libpthread.so.0
173+
- libreadline.so.8
174+
- libreadline.so.8.1
175+
- librepo.so.0
176+
- libresolv.so.2
177+
- librpm.so.9
178+
- librpm.so.9.1.3
179+
- librpmio.so.9
180+
- librpmio.so.9.1.3
181+
- librt.so.1
182+
- libSegFault.so
183+
- libselinux.so.1
184+
- libsepol.so.2
185+
- libsigsegv.so.2
186+
- libsigsegv.so.2.0.6
187+
- libsmartcols.so.1
188+
- libsmartcols.so.1.1.0
189+
- libsolv.so.1
190+
- libsolvext.so.1
191+
- libsqlite3.so.0
192+
- libsqlite3.so.0.8.6
193+
- libssl.so.3
194+
- libssl.so.3.2.2
195+
- libstdc++.so.6
196+
- libstdc++.so.6.0.33
197+
- libtasn1.so.6
198+
- libtasn1.so.6.6.3
199+
- libthread_db.so.1
200+
- libtic.so.6
201+
- libtic.so.6.2
202+
- libtinfo.so.6
203+
- libtinfo.so.6.2
204+
- libunistring.so.2
205+
- libunistring.so.2.1.0
206+
- libutil.so.1
207+
- libuuid.so.1
208+
- libuuid.so.1.3.0
209+
- libverto.so.1
210+
- libverto.so.1.0.0
211+
- libxml2.so.2
212+
- libxml2.so.2.10.4
213+
- libyaml-0.so.2
214+
- libyaml-0.so.2.0.9
215+
- libz.so.1
216+
- libz.so.1.2.11
217+
- libzstd.so.1
218+
- libzstd.so.1.5.5
219+
- p11-kit-proxy.so
220+
221+
### /usr/lib64
222+
223+
*(Same libraries as /lib64 - symlinks to the same files)*
224+
225+
### /var/runtime/lib
226+
227+
*(No libraries found in this path)*
228+
229+
### /opt/lib
230+
231+
*(No libraries found in this path)*
232+
233+
## How to Update This Document
234+
235+
1. Execute the shell script via Node.js 20 endpoint:
236+
```bash
237+
curl -s "https://php-node20.vercel.app/exec?cmd=bash%20-c%20'for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20if%20[%20-d%20\"\$p\"%20];%20then%20echo%20\"===%20\$p%20===\";%20find%20\"\$p\"%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort%20|%20while%20read%20f;%20do%20echo%20\"\$(basename%20\$f)%20(\$(du%20-h%20\$f%20|%20cut%20-f1))\";%20done;%20fi;%20done'"
238+
```
239+
240+
2. Or use the simple find command:
241+
```bash
242+
curl -s "https://php-node20.vercel.app/exec?cmd=for%20p%20in%20/var/lang/lib%20/lib64%20/usr/lib64%20/var/runtime/lib%20/opt/lib;%20do%20echo%20\"===%20\$p%20===\";%20find%20\$p%20-name%20\"*.so*\"%20-type%20f%202>/dev/null%20|%20sort;%20done"
243+
```
244+
245+
3. Copy the output and format it into this markdown file
246+
247+
4. Update the "Last Updated" date in this document after running the commands
248+
249+
## Notes
250+
251+
- Libraries in `/var/task/lib` are application-specific and may vary
252+
- Libraries in other paths are provided by the Lambda runtime
253+
- This list helps identify which libraries can be removed from packages

0 commit comments

Comments
 (0)