Skip to content

Commit 2b37f71

Browse files
committed
fix: apply pre-commit formatting and linting fixes
Apply automated formatting and linting fixes from pre-commit hooks: - buildifier: Bazel BUILD file formatting improvements - rustfmt: Rust code formatting standardization - prettier: Documentation and configuration file formatting - end-of-file-fixer: Add missing newlines at end of files - rust-clippy: Code quality improvements for Rust files These changes ensure code consistency and adherence to project style guidelines across all files in the AOT embedding implementation.
1 parent d5b3ef3 commit 2b37f71

File tree

15 files changed

+130
-89
lines changed

15 files changed

+130
-89
lines changed

.markdownlintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Ignore generated files
55
**/dist/**
66
**/build/**
7-
**/.next/**
7+
**/.next/**

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This release represents a significant achievement - transitioning from custom pa
3232
### 📦 Migration Guide
3333

3434
**Before (1.x.x)**:
35+
3536
```starlark
3637
bazel_dep(name = "rules_rust", version = "0.62.0")
3738
git_override(
@@ -42,6 +43,7 @@ git_override(
4243
```
4344

4445
**After (2.0.0)**:
46+
4547
```starlark
4648
bazel_dep(name = "rules_rust", version = "0.65.0")
4749
```

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-site/src/content/docs/reference/rules.mdx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,11 +1001,11 @@ load("@rules_wasm_component//wasm:defs.bzl", "wasm_embed_aot")
10011001

10021002
**Attributes:**
10031003

1004-
| Name | Type | Required | Description |
1005-
| --------------- | ----------------------- | -------- | ----------------------------------------------------- |
1004+
| Name | Type | Required | Description |
1005+
| --------------- | ----------------------- | -------- | ------------------------------------------------------------ |
10061006
| `aot_artifacts` | String-keyed label dict || Dictionary mapping target names to precompiled AOT artifacts |
1007-
| `component` | Label || Base WebAssembly component to embed AOT artifacts into |
1008-
| `name` | String || A unique name for this target |
1007+
| `component` | Label || Base WebAssembly component to embed AOT artifacts into |
1008+
| `name` | String || A unique name for this target |
10091009

10101010
**Examples:**
10111011

@@ -1064,10 +1064,10 @@ load("@rules_wasm_component//wasm:defs.bzl", "wasm_extract_aot")
10641064

10651065
**Attributes:**
10661066

1067-
| Name | Type | Required | Description |
1068-
| ------------- | ------ | -------- | ----------------------------------------------------- |
1069-
| `component` | Label || WebAssembly component with embedded AOT artifacts |
1070-
| `name` | String || A unique name for this target |
1067+
| Name | Type | Required | Description |
1068+
| ------------- | ------ | -------- | ------------------------------------------------------- |
1069+
| `component` | Label || WebAssembly component with embedded AOT artifacts |
1070+
| `name` | String || A unique name for this target |
10711071
| `target_name` | String || Target architecture name to extract (e.g., "linux_x64") |
10721072

10731073
**Examples:**
@@ -1436,12 +1436,12 @@ load("@rules_wasm_component//wkg:defs.bzl", "wkg_lock")
14361436

14371437
**Attributes:**
14381438

1439-
| Name | Type | Required | Description |
1440-
| -------------- | --------------- | -------- | --------------------------------------- |
1441-
| `dependencies` | List of Strings || List of package dependencies to lock |
1442-
| `name` | String || A unique name for this target |
1443-
| `package_name` | String || Name of the package being locked |
1444-
| `registry` | String || Custom registry URL |
1439+
| Name | Type | Required | Description |
1440+
| -------------- | --------------- | -------- | ------------------------------------ |
1441+
| `dependencies` | List of Strings || List of package dependencies to lock |
1442+
| `name` | String || A unique name for this target |
1443+
| `package_name` | String || Name of the package being locked |
1444+
| `registry` | String || Custom registry URL |
14451445

14461446
**Examples:**
14471447

@@ -1471,16 +1471,16 @@ load("@rules_wasm_component//wkg:defs.bzl", "wkg_publish")
14711471

14721472
**Attributes:**
14731473

1474-
| Name | Type | Required | Description |
1475-
| -------------- | --------------- | -------- | --------------------------------- |
1476-
| `authors` | List of Strings || List of component authors |
1477-
| `component` | Label || WebAssembly component to publish |
1478-
| `description` | String || Component description |
1479-
| `license` | String || License identifier |
1480-
| `name` | String || A unique name for this target |
1481-
| `package_name` | String || Package name for publication |
1482-
| `registry` | String || Custom registry URL |
1483-
| `version` | String || Package version |
1474+
| Name | Type | Required | Description |
1475+
| -------------- | --------------- | -------- | -------------------------------- |
1476+
| `authors` | List of Strings || List of component authors |
1477+
| `component` | Label || WebAssembly component to publish |
1478+
| `description` | String || Component description |
1479+
| `license` | String || License identifier |
1480+
| `name` | String || A unique name for this target |
1481+
| `package_name` | String || Package name for publication |
1482+
| `registry` | String || Custom registry URL |
1483+
| `version` | String || Package version |
14841484

14851485
**Examples:**
14861486

@@ -1510,12 +1510,12 @@ load("@rules_wasm_component//wkg:defs.bzl", "wkg_push")
15101510

15111511
**Attributes:**
15121512

1513-
| Name | Type | Required | Description |
1514-
| ----------------- | ------ | -------- | --------------------------------- |
1515-
| `component` | Label || WebAssembly component to push |
1513+
| Name | Type | Required | Description |
1514+
| ----------------- | ------ | -------- | ------------------------------------------- |
1515+
| `component` | Label || WebAssembly component to push |
15161516
| `image_reference` | String || OCI image reference (registry/org/name:tag) |
1517-
| `name` | String || A unique name for this target |
1518-
| `registry_config` | Label || Registry configuration |
1517+
| `name` | String || A unique name for this target |
1518+
| `registry_config` | Label || Registry configuration |
15191519

15201520
**Examples:**
15211521

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
"""Test case for AOT embedding functionality"""
22

3-
load("//wasm:defs.bzl", "wasm_precompile", "wasm_embed_aot", "wasm_extract_aot")
3+
load("//wasm:defs.bzl", "wasm_embed_aot", "wasm_extract_aot", "wasm_precompile")
44

55
package(default_visibility = ["//visibility:public"])
66

77
# Create debug AOT artifacts with debug info (for comparison)
88
wasm_precompile(
99
name = "hello_linux_x64_debug",
1010
component = "//examples/basic:hello_component",
11-
target_triple = "x86_64-unknown-linux-gnu",
12-
optimization_level = "2",
1311
debug_info = True,
12+
optimization_level = "2",
13+
target_triple = "x86_64-unknown-linux-gnu",
1414
)
1515

1616
wasm_precompile(
1717
name = "hello_linux_arm64_debug",
1818
component = "//examples/basic:hello_component",
19-
target_triple = "aarch64-unknown-linux-gnu",
20-
optimization_level = "2",
2119
debug_info = True,
20+
optimization_level = "2",
21+
target_triple = "aarch64-unknown-linux-gnu",
2222
)
2323

2424
wasm_precompile(
2525
name = "hello_portable_debug",
2626
component = "//examples/basic:hello_component",
27-
target_triple = "pulley64",
28-
optimization_level = "2",
2927
debug_info = True,
28+
optimization_level = "2",
29+
target_triple = "pulley64",
3030
)
3131

3232
# Create production AOT artifacts for embedding (default - no debug info)
3333
wasm_precompile(
3434
name = "hello_linux_x64",
3535
component = "//examples/basic:hello_component",
36-
target_triple = "x86_64-unknown-linux-gnu",
3736
optimization_level = "2",
37+
target_triple = "x86_64-unknown-linux-gnu",
3838
)
3939

4040
wasm_precompile(
4141
name = "hello_linux_arm64",
4242
component = "//examples/basic:hello_component",
43-
target_triple = "aarch64-unknown-linux-gnu",
4443
optimization_level = "2",
44+
target_triple = "aarch64-unknown-linux-gnu",
4545
)
4646

4747
wasm_precompile(
4848
name = "hello_portable",
4949
component = "//examples/basic:hello_component",
50-
target_triple = "pulley64",
5150
optimization_level = "2",
51+
target_triple = "pulley64",
5252
)
5353

5454
# Test embedding stripped AOT artifacts (production)
5555
wasm_embed_aot(
5656
name = "hello_with_embedded_aot",
57-
component = "//examples/basic:hello_component",
5857
aot_artifacts = {
5958
"linux_x64": ":hello_linux_x64",
6059
"linux_arm64": ":hello_linux_arm64",
6160
"portable": ":hello_portable",
6261
},
62+
component = "//examples/basic:hello_component",
6363
)
6464

6565
# Test embedding debug AOT artifacts (with debug info)
6666
wasm_embed_aot(
6767
name = "hello_with_embedded_aot_debug",
68-
component = "//examples/basic:hello_component",
6968
aot_artifacts = {
7069
"linux_x64": ":hello_linux_x64_debug",
7170
"linux_arm64": ":hello_linux_arm64_debug",
7271
"portable": ":hello_portable_debug",
7372
},
73+
component = "//examples/basic:hello_component",
7474
)
7575

7676
# Test extraction
@@ -84,4 +84,4 @@ wasm_extract_aot(
8484
name = "extracted_portable",
8585
component = ":hello_with_embedded_aot",
8686
target_name = "portable",
87-
)
87+
)

examples/aot_example/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,28 +109,28 @@ wasm_precompile(
109109
wasm_precompile_multi(
110110
name = "hello_component_multi_arch",
111111
component = ":hello_component",
112+
debug_info = False,
113+
optimization_level = "2",
112114
targets = {
113115
"linux_x64": "x86_64-unknown-linux-gnu",
114116
"linux_arm64": "aarch64-unknown-linux-gnu",
115117
"darwin_x64": "x86_64-apple-darwin",
116118
"darwin_arm64": "aarch64-apple-darwin",
117119
"pulley64": "pulley64", # Portable bytecode
118120
},
119-
optimization_level = "2",
120-
debug_info = False,
121121
)
122122

123123
# High-performance multi-arch version
124124
wasm_precompile_multi(
125125
name = "hello_component_multi_arch_size_opt",
126126
component = ":hello_component",
127+
optimization_level = "s", # Size optimization
128+
strip_symbols = True,
127129
targets = {
128130
"linux_x64": "x86_64-unknown-linux-gnu",
129131
"linux_arm64": "aarch64-unknown-linux-gnu",
130132
"pulley64": "pulley64",
131133
},
132-
optimization_level = "s", # Size optimization
133-
strip_symbols = True,
134134
)
135135

136136
# Direct WASM file execution

examples/aot_test/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,49 +55,49 @@ wasm_test(
5555
wasm_precompile(
5656
name = "hello_x86_64",
5757
component = "//examples/basic:hello_component",
58-
target_triple = "x86_64-unknown-linux-gnu",
5958
optimization_level = "2",
59+
target_triple = "x86_64-unknown-linux-gnu",
6060
)
6161

6262
wasm_precompile(
6363
name = "hello_aarch64",
6464
component = "//examples/basic:hello_component",
65-
target_triple = "aarch64-unknown-linux-gnu",
6665
optimization_level = "2",
66+
target_triple = "aarch64-unknown-linux-gnu",
6767
)
6868

6969
wasm_precompile(
7070
name = "hello_pulley",
7171
component = "//examples/basic:hello_component",
72-
target_triple = "pulley64",
7372
optimization_level = "2",
73+
target_triple = "pulley64",
7474
)
7575

7676
# Multi-architecture compilation test
7777
wasm_precompile_multi(
7878
name = "hello_multi_arch_test",
7979
component = "//examples/basic:hello_component",
80+
debug_info = False,
81+
optimization_level = "2",
8082
targets = {
8183
"linux_x64": "x86_64-unknown-linux-gnu",
8284
"linux_arm64": "aarch64-unknown-linux-gnu",
8385
"darwin_x64": "x86_64-apple-darwin",
8486
"darwin_arm64": "aarch64-apple-darwin",
8587
"pulley64": "pulley64",
8688
},
87-
optimization_level = "2",
88-
debug_info = False,
8989
)
9090

9191
# Minimal multi-arch test (for faster CI)
9292
wasm_precompile_multi(
9393
name = "hello_minimal_multi_arch",
9494
component = "//examples/basic:hello_component",
95+
optimization_level = "s",
9596
targets = {
9697
"x64": "x86_64-unknown-linux-gnu",
9798
"arm64": "aarch64-unknown-linux-gnu",
9899
"portable": "pulley64",
99100
},
100-
optimization_level = "s",
101101
)
102102

103103
# Cross-compilation functionality tests

examples/wac_oci_composition/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ wasm_component_from_oci(
103103
image_ref = "localhost:5000/wasm-examples/signed-service:v1.0.0",
104104
public_key = ":verification_keys",
105105
registry_config = ":example_registries",
106-
verify_signature = True,
107106
tags = ["manual"], # Temporarily disable - signature verification not yet supported
107+
verify_signature = True,
108108
)
109109

110110
# Example 3: Basic WAC composition with OCI components

tools/wasm_embed_aot/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ rust_binary(
1515
"@wasm_embed_aot_crates//:wasm-encoder",
1616
"@wasm_embed_aot_crates//:wasmparser",
1717
],
18-
)
18+
)

tools/wasm_embed_aot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ path = "src/main.rs"
1111
anyhow = "1.0"
1212
clap = { version = "4.0", features = ["derive"] }
1313
wasm-encoder = "0.220"
14-
wasmparser = "0.220"
14+
wasmparser = "0.220"

0 commit comments

Comments
 (0)