Skip to content

Commit

Permalink
feat: add build environment info (#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdawson authored Jun 23, 2023
1 parent 593c56c commit 23e62c4
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ cd <your-path-to-undici>
npm run build:wasm
```

#### Commit the contents of lib/llhttp

Create a commit which includes all of the updated files in lib/llhttp.

<a id="update-wpts"></a>
### Update `WPTs`

Expand Down
12 changes: 10 additions & 2 deletions build/wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ if (process.argv[2] === '--docker') {
process.exit(0)
}

// Gather information about the tools used for the build
const buildInfo = execSync('apk info -v').toString()
if (!buildInfo.includes('wasi-sdk')) {
console.log('Failed to generate build environment information')
process.exit(-1)
}
writeFileSync(join(WASM_OUT, 'wasm_build_env.txt'), buildInfo)

// Build wasm binary
execSync(`clang \
--sysroot=/usr/share/wasi-sysroot \
Expand All @@ -60,7 +68,7 @@ execSync(`clang \
const base64Wasm = readFileSync(join(WASM_OUT, 'llhttp.wasm')).toString('base64')
writeFileSync(
join(WASM_OUT, 'llhttp-wasm.js'),
`module.exports = "${base64Wasm}";\n`
`module.exports = '${base64Wasm}'\n`
)

// Build wasm simd binary
Expand Down Expand Up @@ -89,5 +97,5 @@ execSync(`clang \
const base64WasmSimd = readFileSync(join(WASM_OUT, 'llhttp_simd.wasm')).toString('base64')
writeFileSync(
join(WASM_OUT, 'llhttp_simd-wasm.js'),
`module.exports = "${base64WasmSimd}";\n`
`module.exports = '${base64WasmSimd}'\n`
)
2 changes: 1 addition & 1 deletion lib/llhttp/llhttp-wasm.js

Large diffs are not rendered by default.

Binary file modified lib/llhttp/llhttp.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/llhttp/llhttp_simd-wasm.js

Large diffs are not rendered by default.

Binary file modified lib/llhttp/llhttp_simd.wasm
Binary file not shown.
32 changes: 32 additions & 0 deletions lib/llhttp/wasm_build_env.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
alpine-baselayout-data-3.4.0-r0
musl-1.2.3-r4
busybox-1.35.0-r29
busybox-binsh-1.35.0-r29
alpine-baselayout-3.4.0-r0
alpine-keys-2.4-r1
ca-certificates-bundle-20220614-r4
libcrypto3-3.0.8-r3
libssl3-3.0.8-r3
ssl_client-1.35.0-r29
zlib-1.2.13-r0
apk-tools-2.12.10-r1
scanelf-1.3.5-r1
musl-utils-1.2.3-r4
libc-utils-0.7.2-r3
libgcc-12.2.1_git20220924-r4
libstdc++-12.2.1_git20220924-r4
libffi-3.4.4-r0
xz-libs-5.2.9-r0
libxml2-2.10.4-r0
zstd-libs-1.5.5-r0
llvm15-libs-15.0.7-r0
clang15-libs-15.0.7-r0
libstdc++-dev-12.2.1_git20220924-r4
clang15-15.0.7-r0
lld-libs-15.0.7-r0
lld-15.0.7-r0
wasi-libc-0.20220525-r1
wasi-libcxx-15.0.7-r0
wasi-libcxxabi-15.0.7-r0
wasi-compiler-rt-15.0.7-r0
wasi-sdk-16-r0

0 comments on commit 23e62c4

Please sign in to comment.