Skip to content

Commit e546bd9

Browse files
committed
feat: add build environment info
Refs: nodejs#2157 - adds generation of a wasm_build_env.txt file which contains information about version of tools used to build wasm - updates the docuementation to make it clear that all files in lib/llhttp should be committed when an update is done - fixes build/wasm.js to generate JS that passes the current linting configured for the project Signed-off-by: Michael Dawson <[email protected]>
1 parent 593c56c commit e546bd9

7 files changed

+43
-4
lines changed

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ cd <your-path-to-undici>
7878
npm run build:wasm
7979
```
8080

81+
#### Commit the contents of lib/llhttp
82+
83+
Create a commit which includes all of the updated files in lib/llhttp.
84+
8185
<a id="update-wpts"></a>
8286
### Update `WPTs`
8387

build/wasm.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ if (process.argv[2] === '--docker') {
3535
process.exit(0)
3636
}
3737

38+
// Gather information about the tools used for the build
39+
execSync(`apk info -vv >${join(WASM_OUT, 'wasm_build_env.txt')}`, { stdio: 'inherit' })
40+
3841
// Build wasm binary
3942
execSync(`clang \
4043
--sysroot=/usr/share/wasi-sysroot \
@@ -60,7 +63,7 @@ execSync(`clang \
6063
const base64Wasm = readFileSync(join(WASM_OUT, 'llhttp.wasm')).toString('base64')
6164
writeFileSync(
6265
join(WASM_OUT, 'llhttp-wasm.js'),
63-
`module.exports = "${base64Wasm}";\n`
66+
`module.exports = '${base64Wasm}'\n`
6467
)
6568

6669
// Build wasm simd binary
@@ -89,5 +92,5 @@ execSync(`clang \
8992
const base64WasmSimd = readFileSync(join(WASM_OUT, 'llhttp_simd.wasm')).toString('base64')
9093
writeFileSync(
9194
join(WASM_OUT, 'llhttp_simd-wasm.js'),
92-
`module.exports = "${base64WasmSimd}";\n`
95+
`module.exports = '${base64WasmSimd}'\n`
9396
)

lib/llhttp/llhttp-wasm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/llhttp/llhttp.wasm

-535 Bytes
Binary file not shown.

lib/llhttp/llhttp_simd-wasm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/llhttp/llhttp_simd.wasm

-535 Bytes
Binary file not shown.

lib/llhttp/wasm_build_env.txt

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
alpine-baselayout-data-3.4.0-r0 - Alpine base dir structure and init scripts
2+
musl-1.2.3-r4 - the musl c library (libc) implementation
3+
busybox-1.35.0-r29 - Size optimized toolbox of many common UNIX utilities
4+
busybox-binsh-1.35.0-r29 - busybox ash /bin/sh
5+
alpine-baselayout-3.4.0-r0 - Alpine base dir structure and init scripts
6+
alpine-keys-2.4-r1 - Public keys for Alpine Linux packages
7+
ca-certificates-bundle-20220614-r4 - Pre generated bundle of Mozilla certificates
8+
libcrypto3-3.0.8-r3 - Crypto library from openssl
9+
libssl3-3.0.8-r3 - SSL shared libraries
10+
ssl_client-1.35.0-r29 - EXternal ssl_client for busybox wget
11+
zlib-1.2.13-r0 - A compression/decompression Library
12+
apk-tools-2.12.10-r1 - Alpine Package Keeper - package manager for alpine
13+
scanelf-1.3.5-r1 - Scan ELF binaries for stuff
14+
musl-utils-1.2.3-r4 - the musl c library (libc) implementation
15+
libc-utils-0.7.2-r3 - Meta package to pull in correct libc
16+
libgcc-12.2.1_git20220924-r4 - GNU C compiler runtime libraries
17+
libstdc++-12.2.1_git20220924-r4 - GNU C++ standard runtime library
18+
libffi-3.4.4-r0 - portable, high level programming interface to various calling conventions.
19+
xz-libs-5.2.9-r0 - Library and CLI tools for XZ and LZMA compressed files (libraries)
20+
libxml2-2.10.4-r0 - XML parsing library, version 2
21+
zstd-libs-1.5.5-r0 - Zstandard - Fast real-time compression algorithm (libraries)
22+
llvm15-libs-15.0.7-r0 - LLVM 15 runtime library
23+
clang15-libs-15.0.7-r0 - A C language family front-end for LLVM (libraries)
24+
libstdc++-dev-12.2.1_git20220924-r4 - GNU C++ standard runtime library (development files)
25+
clang15-15.0.7-r0 - A C language family front-end for LLVM
26+
lld-libs-15.0.7-r0 - The LLVM Linker (libraries)
27+
lld-15.0.7-r0 - The LLVM Linker
28+
wasi-libc-0.20220525-r1 - WASI libc implementation for WebAssembly
29+
wasi-libcxx-15.0.7-r0 - WASI LLVM C++ standard library
30+
wasi-libcxxabi-15.0.7-r0 - WASI Low level support for the LLVM C++ standard library.
31+
wasi-compiler-rt-15.0.7-r0 - WASI LLVM compiler runtime
32+
wasi-sdk-16-r0 - WASI-enabled WebAssembly C/C++ toolchain

0 commit comments

Comments
 (0)