Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
269 commits
Select commit Hold shift + click to select a range
7e1a896
Update Wasmtime to 0.22
Jan 14, 2021
7bf8baf
Merge pull request #2 from radu-matei/update-wasmtime
fitzgen Jan 14, 2021
a3c6858
Bump to version 1.0.2
fitzgen Jan 14, 2021
37e4e43
Check rustfmt in CI
fitzgen Jan 14, 2021
38c0b88
Merge pull request #3 from fitzgen/rustfmt-ci
fitzgen Jan 14, 2021
041c60f
Add Wizer option to rename functions.
cfallin Feb 10, 2021
9ab84ee
Add C++ example using function renaming to handle ctors properly.
cfallin Feb 10, 2021
3c5c988
Merge pull request #5 from cfallin/cpp-ctors
fitzgen Feb 11, 2021
7d4bdb6
Bump to version 1.1.0
fitzgen Feb 11, 2021
cf715d5
Make config knobs for our supported Wasm proposals
fitzgen Feb 16, 2021
5c91035
Rename `--func-rename` to `--rename-func`
fitzgen Feb 16, 2021
4662bef
Add a test for multi-memory Wasm modules
fitzgen Feb 16, 2021
6f6ecc9
Upgrade dependencies
fitzgen Feb 16, 2021
13bd26f
Update Wasmtime to 0.23.0
fitzgen Feb 18, 2021
08b6d85
Merge pull request #6 from fitzgen/small-tweaks-and-dep-updates
fitzgen Feb 18, 2021
3b858aa
Enable Wasmtime's code cache
fitzgen Mar 18, 2021
921c378
Merge pull request #11 from fitzgen/code-cache
fitzgen Mar 18, 2021
45ee076
Bump to version 1.1.1
fitzgen Mar 18, 2021
691b6f4
Update Wasmtime and other deps
fitzgen Mar 18, 2021
168e514
Bump to 1.1.2
fitzgen Mar 18, 2021
0f1329d
Add knobs for WASI inheriting stdio and env vars
fitzgen Mar 18, 2021
979c92a
Merge pull request #12 from fitzgen/inherit-stdio-env-vars
fitzgen Mar 18, 2021
0d700cb
Bump to version 1.2.0
fitzgen Mar 18, 2021
963b737
Rename "diff" to "snapshot"
fitzgen Mar 25, 2021
13e9de3
Add the ability to preopen dirs during WASI initialization
fitzgen Mar 25, 2021
9e8634f
Bump to version 1.3.0
fitzgen Mar 25, 2021
4662dd8
Merge pull request #13 from fitzgen/preopen-dirs
fitzgen Mar 26, 2021
18686da
Add C++ example to Readme
aminya Apr 19, 2021
c2839e1
Merge pull request #14 from aminya/patch-1
fitzgen Apr 19, 2021
e4b38e8
Add module linking support to Wizer
fitzgen Mar 1, 2021
d688764
Add a fuzz target for Wizer
fitzgen Apr 26, 2021
1fbff10
Derive `Debug` to make `ModuleInfo` construction simpler
fitzgen Apr 28, 2021
4fde952
Collect into a boxed slice directly
fitzgen Apr 28, 2021
9073164
We can't ever get `NeedMoreData` from the parser
fitzgen Apr 28, 2021
5b62b68
Use `{}` instead of `continue` when it doesn't matter
fitzgen Apr 28, 2021
5ed3405
Turn some `anyhow::bail!`s into `unreachable!()`s
fitzgen Apr 28, 2021
01a93fa
Remove unnecessary parameter
fitzgen Apr 28, 2021
62c9c23
Get rid of an extra level of indention
fitzgen Apr 28, 2021
ddd648f
Remove manual computation of a variable we can instead derive
fitzgen Apr 28, 2021
a30c52a
Use `wasmtime`'s cache in tests
fitzgen Apr 29, 2021
b01815f
Switch to an arena AST representation and fix outer module aliases
fitzgen May 3, 2021
adc3832
Split out separate code paths for when module linking is vs is not en…
fitzgen May 3, 2021
5277bfc
Get instances without entries in the type section and implicit instan…
fitzgen May 17, 2021
51b5d5b
Rename `ModuleContext::resolve` to `ModuleContext::defined`
fitzgen May 19, 2021
50bd7f4
Use the `ModuleContext::defined` helper inside `ModuleContext::entity…
fitzgen May 19, 2021
5974bb1
Add more descriptive diagnostics for an `unreachable!()`
fitzgen May 19, 2021
755dd10
Merge pull request #15 from fitzgen/module-linking
fitzgen May 19, 2021
e442ab4
Do not create "native" sized/aligned data segments
fitzgen May 19, 2021
9493fde
Run `cargo update`
fitzgen May 19, 2021
a1032fc
Merge pull request #17 from fitzgen/min-sized-data-segments
fitzgen May 19, 2021
e49c2d2
Fix a bug with data segments at the end of memory
fitzgen May 20, 2021
1cc272b
Merge pull request #19 from fitzgen/data-segment-at-end-of-memory
fitzgen May 20, 2021
1e04e56
Update deps; wasmtime to 0.27.0
fitzgen Jun 28, 2021
632b950
Bump to version 1.3.1
fitzgen Jun 28, 2021
59fde42
Add a test for creating too many data segments in a snapshot
fitzgen Jul 14, 2021
2187986
Do not generate modules with >= 100_000 data segments
fitzgen Jul 14, 2021
f861e6f
Bump to version 1.3.2
fitzgen Jul 14, 2021
cb4f925
Use `windows` instead of manual indexing to compare consecutive items…
fitzgen Jul 14, 2021
a99c9bb
Merge pull request #22 from fitzgen/too-many-segments
fitzgen Jul 14, 2021
799f046
Avoid accidental quadratic behavior when removing excess data segments
fitzgen Jul 15, 2021
eff6105
Bump to version 1.3.3
fitzgen Jul 15, 2021
78e42a1
Merge pull request #23 from fitzgen/accidentally-quadratic
fitzgen Jul 15, 2021
859957a
Update to Wasmtime 0.28
fitzgen Jul 20, 2021
7988f55
Add link to wasm summit talk on Wizer
fitzgen Jul 20, 2021
f73c09e
Merge pull request #26 from fitzgen/link-to-wasm-summit-talk
fitzgen Jul 20, 2021
850b2b7
Merge pull request #25 from fitzgen/upgrade-wasmtime
fitzgen Jul 21, 2021
ae2471a
update wasmtime to 0.29
Aug 4, 2021
f685608
fmt
Aug 4, 2021
0bc5829
check benches on CI
Aug 4, 2021
ad23d02
Merge pull request #28 from maximebedard/update-wasmtime-0-29
fitzgen Aug 4, 2021
3972bc1
docs: Fix typo
saulecabrera Sep 6, 2021
9a1dc61
Merge pull request #32 from saulecabrera/fix-instrumentation-typo
fitzgen Sep 7, 2021
8a48a71
Update wasmtime to 0.30.0 and wasm-encoder to 0.6.0
tschneidereit Sep 19, 2021
153022d
Update fuzz target to wasmtime 0.30.0
tschneidereit Sep 24, 2021
319af54
Address review comment and format code
tschneidereit Oct 12, 2021
09f37b2
Bump to version 1.3.4
tschneidereit Oct 12, 2021
6d2cf8e
Merge pull request #33 from tschneidereit/wasmtime-0.30.0
fitzgen Oct 12, 2021
e8d2ce8
Publish binary releases of the `wizer` CLI tool
tschneidereit Oct 18, 2021
2337e8a
Merge pull request #34 from tschneidereit/binary-releases
fitzgen Oct 18, 2021
4feb9e8
Don't export _initialize during rewriting
TerrorJack Dec 3, 2021
f7a1002
Call _initialize before calling init_func
TerrorJack Dec 4, 2021
ad5d8cb
Add wasi_reactor test case
TerrorJack Dec 4, 2021
717a379
Strip _initialize only when it's called during snapshotting
TerrorJack Dec 6, 2021
198a7d6
Merge pull request #36 from TerrorJack/dont-export-initialize
fitzgen Dec 6, 2021
8e6ad72
Dummy functions should trap, not return dummy values
fitzgen Jan 5, 2022
558e82e
Merge pull request #40 from fitzgen/dummy-function-trap
fitzgen Jan 5, 2022
6e6baed
Add a CI job to check that the fuzz targets build okay
fitzgen Jan 5, 2022
785440b
Fix the fuzz target for the recent Wasmtime dep upgrade
fitzgen Jan 5, 2022
ca909f6
Bump to version 1.3.5
fitzgen Jan 5, 2022
93c4a5a
Merge pull request #41 from fitzgen/bump-to-1.3.5
fitzgen Jan 5, 2022
2e0ecdd
Allow to map host directory as arbitary guest path
kateinoigakukun Jan 25, 2022
7917216
Update docs for `--mapdir`
fitzgen Jan 26, 2022
2c22b46
Update docs for `Wizer::map_dir`
fitzgen Jan 26, 2022
f2c5a9f
Merge pull request #42 from kateinoigakukun/katei/add-mapdir
fitzgen Jan 26, 2022
657fa6f
Add an option to keep init-func after initialization
kateinoigakukun Jan 26, 2022
0071978
Apply suggestions from code review
kateinoigakukun Jan 27, 2022
5448560
Keep init func for module-linking in the same way
kateinoigakukun Jan 27, 2022
9f3fa98
Merge pull request #43 from kateinoigakukun/upstream-pr-katei/keep-in…
fitzgen Jan 27, 2022
d585810
chore: Bump wasmtime to 0.33.0
saulecabrera Jan 28, 2022
5930467
Merge pull request #44 from saulecabrera/update-to-wasmtime-0330
fitzgen Jan 28, 2022
a6483ca
chore: Update to wasmtime v0.34.1
saulecabrera Feb 22, 2022
16382af
Merge pull request #46 from saulecabrera/update-to-wasmtime-0341
fitzgen Feb 22, 2022
bf5dd88
Update cap-std to v0.24.2
conradgrobler Mar 25, 2022
988ed0b
Merge pull request #47 from conradgrobler/update-cap-std
fitzgen Mar 25, 2022
a6454de
Add support for specifying a custom linker to be used during wizening
itsrainy May 31, 2022
2e73d8d
Merge pull request #50 from itsrainy/rainy/bring-your-own-linker
fitzgen Jun 1, 2022
24ced08
Bump to version 1.4.0
fitzgen Jun 6, 2022
09060c5
Merge pull request #52 from fitzgen/bump-to-version-1.4.0
fitzgen Jun 7, 2022
737450d
Add release workflow which builds for multiple operating systems and …
Jul 5, 2022
c1819a5
Update installation section to mention the pre-built binaries
JakeChampion Jul 5, 2022
6e3ddff
Merge pull request #54 from JakeChampion/jake/release-artifacts
fitzgen Jul 5, 2022
04a68a9
implement partial bulk memory support
dicej Sep 1, 2022
808dd88
add tests for rejecting additional reference types ops
dicej Sep 1, 2022
47fc352
Merge pull request #57 from dicej/partial-bulk-memory-support
fitzgen Sep 1, 2022
1bc058a
chore: Update wasmtime to v0.35.3
saulecabrera Jun 7, 2022
0e16565
Move to using the same cross-compiling workflow as wasmtime which ena…
Aug 26, 2022
22e7fc4
Add npm packages for each platform+architecture combination that we s…
Aug 5, 2022
1f0b8bb
ok
Aug 26, 2022
d0bc3c4
remove the post-install command and rely on detection at runtime to f…
Nov 4, 2022
f115287
update all packages when running `npm version x.x.x`
Nov 4, 2022
1c3e1c6
append v to tag name before making github api requests -- the npm_pac…
Nov 7, 2022
c10d321
fix bug where we are attempting to reassign to a const declared value
Nov 7, 2022
89325f1
Bump to version 1.5.0
Nov 7, 2022
88e2315
correct the version for @bytecode-alliance/wizer packageto match the …
Nov 7, 2022
7b37e3b
make sure the location export is a string and not an export object co…
Nov 10, 2022
ad4e09f
Emit the DataCount section during rewriting
elliottt Dec 8, 2022
11ecf14
Merge pull request #61 from elliottt/trevor/fix-missing-datacount-sec…
fitzgen Dec 8, 2022
656d509
release 1.6.0 to npm
Dec 9, 2022
4ead91f
strip v from start of tag
Dec 9, 2022
7a0b7f6
Bump crate version to 1.6.0
fitzgen Dec 9, 2022
0e87d84
Merge pull request #62 from fitzgen/bump-to-version-1.6.0
fitzgen Dec 9, 2022
5a0bf89
Exclude `.wasm` files from the published package
fitzgen Dec 9, 2022
0464f6e
Update wizer.h to reference __main_void or __original_main as needed
elliottt Dec 15, 2022
1dc5bf0
Makefile changes for newer clang
elliottt Dec 15, 2022
18660d2
Merge pull request #63 from elliottt/trevor/update-wizer.h
fitzgen Jan 3, 2023
c1aa6b2
Reduce the maximum number of data segments.
cfallin Feb 28, 2023
c74470c
Merge pull request #71 from cfallin/fewer-segments
cfallin Feb 28, 2023
b65eb4c
1.6.1-beta
Mar 1, 2023
d3ea99f
Merge pull request #72 from guybedford/bump
cfallin Mar 1, 2023
a5b81f9
fixup: release changes
Mar 1, 2023
13e1a8d
fixup
Mar 1, 2023
3b982f0
match cargo and npm versions
Mar 1, 2023
ec59ed9
correct npm organisation name within the npm packages
Mar 1, 2023
279a759
1.6.1-beta.4
Mar 1, 2023
d3d14e5
feat: Add option to enable the Wasm SIMD128 feature
TerrorJack Mar 28, 2023
6764a79
feat: SIMD128 support
TerrorJack Mar 28, 2023
cdb3d01
Merge pull request #69 from type-dance/simd-enable
fitzgen Mar 30, 2023
e1c1161
update to wasmtime 0.38.0
Jan 4, 2023
3c5f5bd
update to wasmtime 3.0.0
Jan 8, 2023
bd4157c
Update tests.rs
Jan 9, 2023
aa37665
print out the pre-wizened wasm when debugging
Jan 10, 2023
56c9827
Update wat/wasmprinter deps
alexcrichton Apr 14, 2023
edd561f
Update wasmparser/wasm-encoder deps incrementally
alexcrichton Apr 14, 2023
05cbefa
Update to wasmparser without module linking
alexcrichton Apr 14, 2023
cb7b3d5
Update `wasmparser` to a version with the latest encoding of multi-me…
alexcrichton Apr 14, 2023
86d9f66
Remove module linking support from fuzzer
alexcrichton Apr 14, 2023
1995ac4
Update wasmparser to the latest version
alexcrichton Apr 15, 2023
119c15e
Merge pull request #76 from alexcrichton/update-wasmparser
fitzgen Apr 20, 2023
348b47e
update to wasmtime 4
Jan 5, 2023
2275e9a
Merge pull request #66 from bytecodealliance/jake/wasmtime-4
fitzgen Apr 25, 2023
f785138
Update to the latest wasm-encoder
alexcrichton Apr 20, 2023
ebcc234
Merge pull request #77 from alexcrichton/update-wasm-encoder
fitzgen Apr 25, 2023
2689733
Update Wasmtime to 8.0.0
alexcrichton Apr 25, 2023
8f04436
Fix compile of tests
alexcrichton Apr 25, 2023
4a453ef
wizer.h: handle the case when wasi command main function returns non-…
TerrorJack May 8, 2023
0615f36
Enable binary releases for AArch64 and s390x
alexcrichton May 9, 2023
9b0bbf6
Merge pull request #79 from type-dance/handle-command-main-return-non…
fitzgen May 9, 2023
3549ae3
Allow a preloaded module to be used by the wizened module.
cfallin May 11, 2023
7c5e4fc
Re-export Wasmtime crate to allow easier use with Wizer API.
cfallin May 11, 2023
dd73c11
Allow specifying preload programmatically as well.
cfallin May 11, 2023
528d7e7
Merge pull request #82 from cfallin/reexport-wasmtime
fitzgen May 12, 2023
458ac1d
Allow for multiple preloads.
cfallin May 12, 2023
254ebfb
Add smoke-test for preloads.
cfallin May 12, 2023
1cf4aa2
Merge pull request #81 from cfallin/preload
fitzgen May 12, 2023
51bc1a1
Bump to version 2.0.0
fitzgen May 12, 2023
250396d
Merge pull request #83 from fitzgen/release-2.0.0
fitzgen May 12, 2023
823392c
Avoid duplicate call to `_initialize`
Mrmaxmeier May 16, 2023
7ebc1e7
Add test for `--init-func=_initialize`
Mrmaxmeier May 17, 2023
2c728f0
Merge pull request #84 from Mrmaxmeier/main
fitzgen May 18, 2023
ff1a655
Expand "wiz" to "wizen" in test function name
fitzgen May 18, 2023
2bdeb97
Merge pull request #85 from fitzgen/test-function-name
fitzgen May 18, 2023
13478eb
ci: add aarch64-unknown-linux-gnu and s390x-unknown-linux-gnu as new …
May 25, 2023
cb13cf7
ci: add aarch64-unknown-linux-gnu and s390x-unknown-linux-gnu as new …
May 25, 2023
3a960a3
ci: publish the npm packages when a new tag is pushed
May 25, 2023
a3ad1be
add npm packages for linux arm64 and s390x
May 25, 2023
dfd294a
Update release.yml
May 25, 2023
8e353ee
Update wasmtime/wasm-tools dependencies
alexcrichton May 24, 2023
2dc14e6
Bump version to 2.0.1
May 26, 2023
5f12b41
Apply suggestions from code review
JakeChampion May 26, 2023
a55ccb8
Apply suggestions from code review
JakeChampion May 26, 2023
013a5ef
Update update.js
JakeChampion May 26, 2023
0b99f4b
Un-export `_initialize` even with keep-init
kateinoigakukun May 28, 2023
3dc5837
Add test for reactor with `--keep-init-func=true`
kateinoigakukun May 28, 2023
474bc65
Merge pull request #88 from JakeChampion/jake/2.0.1
fitzgen May 30, 2023
8dfd5ce
Merge pull request #89 from kateinoigakukun/katei/fix-double-init
fitzgen May 30, 2023
8ff7765
correct the release asset location for 'wizer-linux-arm64'
May 31, 2023
38deac6
use the same knownPackage definition to avoid drift between the two p…
May 31, 2023
06015fd
create version 3.0.1
May 31, 2023
0c4fce0
chore: bump deps and especially wasmtime to 10.0
Mossaka Jul 15, 2023
e513d9d
Merge pull request #94 from Mossaka/bump-deps
fitzgen Jul 17, 2023
c6d3926
Updated to wasmtime 11.0.1
vigoo Aug 7, 2023
e4ff6a6
Merge pull request #95 from golemcloud/wasmtime-11
fitzgen Aug 10, 2023
916d1d4
Update to Wasmtime 16
fitzgen Jan 3, 2024
36df5c1
Bump to version 4
fitzgen Jan 3, 2024
6f77c8c
Update npm package versions too
fitzgen Jan 3, 2024
ddf3c5e
Fix fuzz target build
fitzgen Jan 3, 2024
c5268ad
Merge pull request #97 from fitzgen/update-wasmtime-and-bump-version
fitzgen Jan 3, 2024
2f72d62
Update wasmtime
Gentle Mar 8, 2024
e559b95
updates, replace wasi-cap-std-sync with wasi-common
Gentle Mar 9, 2024
020327b
update fuzzing code
Gentle Mar 10, 2024
2cbdafc
add wasm_smith config again
Gentle Mar 11, 2024
97a5e49
fuzzer goes further now
Gentle Mar 11, 2024
077e6a6
disable wasm features that were added since last update
Gentle Mar 11, 2024
7e23c54
Merge pull request #99 from Gentle/wasmtime18
fitzgen Mar 11, 2024
07d10ad
Bump to version 5.0.0
fitzgen Mar 12, 2024
7141e0e
Merge pull request #100 from fitzgen/version-5
fitzgen Mar 13, 2024
a631e57
Update dependencies, wasmtime-19
Gentle Mar 27, 2024
4a27c8e
wasmtime 19.0.1
Gentle Apr 3, 2024
5ea1b5a
dummy_value now returns error for non-nullable reference types
Gentle Apr 5, 2024
5d13bb1
fix release workflow
Apr 11, 2024
8a6c06b
Merge pull request #103 from bytecodealliance/guybedford-patch-1
fitzgen Apr 11, 2024
57cf98e
error out instead of swallowing error values in fuzzer
Gentle Apr 12, 2024
59db577
Merge pull request #101 from Gentle/wasmtime19
fitzgen Apr 15, 2024
309c2ab
Bump to version 6.0.0
fitzgen Apr 15, 2024
31c59d0
Merge pull request #104 from fitzgen/release-6.0.0
fitzgen Apr 15, 2024
ee1d97b
release: add npmrc to ensure publish permissions (#107)
Aug 19, 2024
0bc5624
Remove $ signs from the bash script to allow for copy pasting (#106)
Eduard-Voiculescu Aug 19, 2024
c145a8f
Use `almalinux:8` instead of `centos:7` docker image for release buil…
fitzgen Aug 19, 2024
7387148
Update Wasmtime and the WASI implementation to v23 (#109)
fitzgen Aug 20, 2024
a5291bc
Bump to version 7.0.0 (#110)
fitzgen Aug 20, 2024
b1c6c49
Bump to 7.0.1 (#111)
fitzgen Aug 20, 2024
8ffd07b
fixup deploy workflow (#112)
Aug 20, 2024
6c75d82
Bump to 7.0.2 (#113)
fitzgen Aug 20, 2024
fec92a0
release: fix version updating (#114)
Aug 20, 2024
be98f62
7.0.3 (#115)
Aug 20, 2024
5b91ee3
release: fix version tag reader (#116)
Aug 21, 2024
e843a35
7.0.4 (#117)
Aug 21, 2024
094cb47
Fix Intel Mac CI builds. (#118)
cfallin Sep 5, 2024
16b97f0
7.0.5 (#119)
Sep 5, 2024
e1f43b1
update ci write permissions (#120)
Sep 5, 2024
4818cbe
Update wasmtime to v29 (#127)
kateinoigakukun Feb 26, 2025
5f4583b
add option for reference-types (#124)
Gentle Feb 26, 2025
fc78a01
enable reference types and bulk memory support by default (#129)
Gentle Feb 27, 2025
92f77df
Bump to version 8
fitzgen Feb 28, 2025
2f76c85
chore: bump deps (#132)
TerrorJack Apr 10, 2025
45c4b6a
Bump to version 9.0.0 (#135)
fitzgen Jun 3, 2025
409a5d5
chore(deps): update wasmtime & upstream deps (#136)
vados-cosmonic Aug 27, 2025
a94726c
Bump to version 10.0.0 (#137)
fitzgen Aug 27, 2025
71f290b
Merge branch 'wasmtime-merge' of https://github.com/alexcrichton/wize…
alexcrichton Oct 9, 2025
19c3380
Ignore wizer subdirectory for now
alexcrichton Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ members = [
]
exclude = [
'docs/rust_wasi_markdown_parser',
'crates/wizer',
]

[workspace.package]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# binary-compatible-builds

A small (ish) action which is intended to be used and will configure builds of
Rust projects to be "more binary compatible". On Windows and macOS this
involves setting a few env vars, and on Linux this involves spinning up a CentOS
6 container which is running in the background.

All subsequent build commands need to be wrapped in `$CENTOS` to optionally run
on `$CENTOS` on Linux to ensure builds happen inside the container.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Set up a CentOS 6 container to build releases in'
description: 'Set up a CentOS 6 container to build releases in'

runs:
using: node20
main: 'main.js'
inputs:
name:
required: true
description: "Name of the build"
62 changes: 62 additions & 0 deletions crates/wizer/.github/actions/binary-compatible-builds/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env node

const child_process = require('child_process');
const stdio = { stdio: 'inherit' };
const fs = require('fs');

function set_env(name, val) {
fs.appendFileSync(process.env['GITHUB_ENV'], `${name}=${val}\n`)
}

// On OSX all we need to do is configure our deployment target as old as
// possible. For now 10.9 is the limit.
if (process.platform == 'darwin') {
set_env("MACOSX_DEPLOYMENT_TARGET", "10.9");
return;
}

// On Windows we build against the static CRT to reduce dll dependencies
if (process.platform == 'win32') {
set_env("RUSTFLAGS", "-Ctarget-feature=+crt-static");
return;
}

// Android doesn't use a container as it's controlled by the installation of the
// SDK/NDK.
if (process.env.INPUT_NAME && process.env.INPUT_NAME.indexOf("android") >= 0) {
return;
}

// ... and on Linux we do fancy things with containers. We'll spawn an old
// CentOS container in the background with a super old glibc, and then we'll run
// commands in there with the `$CENTOS` env var.

if (process.env.CENTOS !== undefined) {
const args = ['exec', '-w', process.cwd(), '-i', 'build-container'];
for (const arg of process.argv.slice(2)) {
args.push(arg);
}
child_process.execFileSync('docker', args, stdio);
return;
}

const name = process.env.INPUT_NAME.replace(/-min$/, '');

child_process.execFileSync('docker', [
'build',
'--tag', 'build-image',
`${process.cwd()}/ci/docker/${name}`
], stdio);

child_process.execFileSync('docker', [
'run',
'--detach',
'--interactive',
'--name', 'build-container',
'-v', `${process.cwd()}:${process.cwd()}`,
'-v', `${child_process.execSync('rustc --print sysroot').toString().trim()}:/rust:ro`,
'build-image',
], stdio);

// Use ourselves to run future commands
set_env("CENTOS", __filename);
18 changes: 18 additions & 0 deletions crates/wizer/.github/actions/install-rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# install-rust

A small github action to install `rustup` and a Rust toolchain. This is
generally expressed inline, but it was repeated enough in this repository it
seemed worthwhile to extract.

Some gotchas:

* Can't `--self-update` on Windows due to permission errors (a bug in Github
Actions)
* `rustup` isn't installed on macOS (a bug in Github Actions)

When the above are fixed we should delete this action and just use this inline:

```yml
- run: rustup update $toolchain && rustup default $toolchain
shell: bash
```
12 changes: 12 additions & 0 deletions crates/wizer/.github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Install Rust toolchain'
description: 'Install both `rustup` and a Rust toolchain'

inputs:
toolchain:
description: 'Default toolchan to install'
required: false
default: 'stable'

runs:
using: node12
main: 'main.js'
36 changes: 36 additions & 0 deletions crates/wizer/.github/actions/install-rust/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const child_process = require('child_process');
const toolchain = process.env.INPUT_TOOLCHAIN;
const fs = require('fs');

function set_env(name, val) {
fs.appendFileSync(process.env['GITHUB_ENV'], `${name}=${val}\n`)
}

// Needed for now to get 1.24.2 which fixes a bug in 1.24.1 that causes issues
// on Windows.
if (process.platform === 'win32') {
child_process.execFileSync('rustup', ['self', 'update']);
}

child_process.execFileSync('rustup', ['set', 'profile', 'minimal']);
child_process.execFileSync('rustup', ['update', toolchain, '--no-self-update']);
child_process.execFileSync('rustup', ['default', toolchain]);

// Deny warnings on CI to keep our code warning-free as it lands in-tree. Don't
// do this on nightly though since there's a fair amount of warning churn there.
if (!toolchain.startsWith('nightly')) {
set_env("RUSTFLAGS", "-D warnings");
}

// Save disk space by avoiding incremental compilation, and also we don't use
// any caching so incremental wouldn't help anyway.
set_env("CARGO_INCREMENTAL", "0");

// Turn down debuginfo from 2 to 1 to help save disk space
set_env("CARGO_PROFILE_DEV_DEBUG", "1");
set_env("CARGO_PROFILE_TEST_DEBUG", "1");

if (process.platform === 'darwin') {
set_env("CARGO_PROFILE_DEV_SPLIT_DEBUGINFO", "unpacked");
set_env("CARGO_PROFILE_TEST_SPLIT_DEBUGINFO", "unpacked");
}
56 changes: 56 additions & 0 deletions crates/wizer/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on: pull_request

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: x86_64-linux
os: ubuntu-latest
- build: x86_64-macos
os: macos-latest
target: x86_64-apple-darwin
- build: aarch64-macos
os: macos-latest
target: aarch64-apple-darwin
- build: x86_64-windows
os: windows-latest
- build: x86_64-mingw
os: windows-latest
target: x86_64-pc-windows-gnu
- build: aarch64-linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- build: s390x-linux
os: ubuntu-latest
target: s390x-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Checking benches
run : cargo check --benches

check_fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo install cargo-fuzz
- run: cargo fuzz build --dev -s none

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update stable --no-self-update
- run: rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
138 changes: 138 additions & 0 deletions crates/wizer/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Release
on:
push:
branches: [main]
tags-ignore: [dev]
pull_request:
defaults:
run:
shell: bash

permissions: write-all

# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: x86_64-linux
os: ubuntu-latest
- build: x86_64-macos
os: macos-latest
target: x86_64-apple-darwin
- build: aarch64-macos
os: macos-latest
target: aarch64-apple-darwin
- build: x86_64-windows
os: windows-latest
- build: x86_64-mingw
os: windows-latest
target: x86_64-pc-windows-gnu
- build: aarch64-linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- build: s390x-linux
os: ubuntu-latest
target: s390x-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: ./.github/actions/install-rust
- uses: ./.github/actions/binary-compatible-builds
with:
name: ${{ matrix.build }}
- run: |
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
rustup target add ${{ matrix.target }}
if: matrix.target != ''

# Build `wizer` and executables
- run: $CENTOS cargo build --release --locked --bin wizer --all-features

# Assemble release artifats appropriate for this platform, then upload them
# unconditionally to this workflow's files so we have a copy of them.
- run: ./ci/build-tarballs.sh "${{ matrix.build }}" "${{ matrix.target }}"
- uses: actions/upload-artifact@v4
with:
name: bins-${{ matrix.build }}
path: dist
publish:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Download all the artifacts that we'll be publishing. Should keep an eye on
# the `download-artifact` repository to see if we can ever get something
# like "download all artifacts" or "download this list of artifacts"
- uses: actions/download-artifact@v4
with:
name: bins-x86_64-macos
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-aarch64-macos
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-x86_64-windows
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-x86_64-mingw
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-x86_64-linux
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-aarch64-linux
path: dist
- uses: actions/download-artifact@v4
with:
name: bins-s390x-linux
path: dist

- name: Calculate tag name
run: |
name=dev
if [[ $GITHUB_REF == refs/tags/v* ]]; then
name=${GITHUB_REF:10}
fi
echo ::set-output name=val::$name
echo TAG=$name >> $GITHUB_ENV
id: tagname

# ... and if this was an actual push (tag or `main`) then we publish a
# new release. This'll automatically publish a tag release or update `dev`
# with this `sha`. Note that `continue-on-error` is set here so if this hits
# a bug we can go back and fetch and upload the release ourselves.
- run: cd .github/actions/github-release && npm install --production
- name: Publish Release
uses: ./.github/actions/github-release
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
files: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.tagname.outputs.val }}
continue-on-error: true
- name: Update npm packages to latest version
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
working-directory: ./npm/wizer
run: npm install && node update.js "${{ steps.tagname.outputs.val }}"
- name: Setup npm auth
run: sudo npm config --global set '//registry.npmjs.org/:_authToken'='${NODE_AUTH_TOKEN}'
- name: Publish npm packages
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
working-directory: ./npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: for dir in *; do (echo $dir && cd $dir && npm publish); done
8 changes: 8 additions & 0 deletions crates/wizer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/target
node_modules
npm/wizer-darwin-arm64/
npm/wizer-darwin-x64/
npm/wizer-linux-x64/
npm/wizer-win32-x64/
npm/wizer-linux-s390x/
npm/wizer-linux-arm64/
3 changes: 3 additions & 0 deletions crates/wizer/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "benches/uap-bench/uap-core"]
path = benches/uap-bench/uap-core
url = https://github.com/ua-parser/uap-core.git
Loading
Loading