-
Notifications
You must be signed in to change notification settings - Fork 1
feat: pre-build PLUS #252
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
feat: pre-build PLUS #252
Conversation
76c0d72 to
7ec7f58
Compare
7ec7f58 to
a25565c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends the pre-build workflow to compile WASM binaries to native machine code for multiple target architectures using Wasmtime. This allows InfluxDB and other consumers to use pre-compiled binaries instead of JIT-compiling WASM at runtime, saving CI time and improving startup performance.
Key Changes:
- Added a new
compilebinary that pre-compiles WASM components to target-specific machine code - Extended the GitHub Actions prebuild workflow to compile WASM to 5 different target architectures (ARM64/x86_64 for Linux/Windows/macOS)
- Enhanced the release artifacts with checksums, wasmtime version metadata, and improved documentation
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
host/src/bin/compile.rs |
New CLI binary that compiles WASM to native code for specified target architectures |
host/Cargo.toml |
Added binary configuration with all-arch feature requirement |
.github/workflows/prebuild.yml |
Extended workflow to compile WASM to multiple targets, calculate checksums, extract wasmtime version, and enhance release documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| targets=( | ||
| "aarch64-apple-darwin" | ||
| "aarch64-pc-windows-msvc" | ||
| "aarch64-unknown-linux-gnu" | ||
| "x86_64-pc-windows-msvc" | ||
| "x86_64-unknown-linux-gnu" | ||
| ) |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing common target: The target list includes ARM64 and x86_64 for Linux and Windows, and ARM64 for macOS, but is missing x86_64-apple-darwin (Intel Macs). While Intel Macs can run ARM64 binaries via Rosetta 2, native x86_64 binaries would provide better performance. Consider adding this target for completeness.
.github/workflows/prebuild.yml
Outdated
| for wasm_file in out/*.wasm; do | ||
| wasm_file="$(basename "$wasm_file" .wasm)" | ||
| for target in "${targets[@]}"; do | ||
| out_file="${wasm_file}.${target}.so" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these always be so files? I'd expect dynlib on Mac and dll on windows, but I might be expecting the wrong thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are ALL ELF object files. Yes, even on Windows these will be elf files, which is not what a dll usually is. Same for mac Mac, where dynlib files are also different format). This might be a bit weird, but ELF can actually contain Windows and Mac code (this is done via the ABI metadata), and hence is a nice container for all sorts of machine code.
Also having to handle a file ending based on the target triplet (instead of only the triplet) makes both this build job and the code that uses these artifacts complicated for no good reason beyond -- what I would call -- a cosmetic beauty.
I however agree that .so is confusing. I've checked the ELF wikipedia article and it suggests that .elf is also a common suffix, so I'll use that.
0bc9311 to
27d20de
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
27d20de to
6f18055
Compare
Extends the pre-build setup (introduced in #225) by also compiling the WASM payload to different target architectures. This avoids having to do this "live" in InfluxDB and waste CI time there. Note that -- if you trust the binaries that we release -- this has the same security model as just-in-time (JIT) compiling the WASM bytecode.
You can find a release that was produced by this workflow here:
https://github.com/influxdata/datafusion-udf-wasm/releases/tag/wasm-binaries%2F2025-12-09T16-51-51%2F76c0d72017b0908c59a8af5ad786797c874de34f