Skip to content

Commit fbad7a2

Browse files
author
Rules WASM Component
committed
fix: resolve Starlark compatibility and update dependencies
Fix build failures on Ubuntu CI and update deprecated configurations. Starlark compatibility: - Replace Python's next(iter()) with Starlark-compatible iteration - Use explicit loop to get first dict key instead of built-ins - Ensure compatibility with Bazel's Starlark implementation Dependency updates: - Update bazel_skylib from 1.5.0 to 1.7.1 - Update platforms from 0.0.8 to 0.0.10 - Update stardoc from 0.6.2 to 0.7.1 - Resolve version mismatch warnings in CI Configuration fixes: - Replace deprecated --local_ram_resources with --local_resources=memory= - Replace deprecated --local_cpu_resources with --local_resources=cpu= - Update .bazelrc to use modern Bazel resource flags These changes ensure the rules work correctly across different platforms and Bazel versions while maintaining backward compatibility.
1 parent b4b3ad0 commit fbad7a2

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ build:wasi --platforms=@rules_rust//rust/platform:wasm32-wasi
2828

2929
# Performance
3030
build --jobs=auto
31-
build --local_ram_resources=HOST_RAM*.8
32-
build --local_cpu_resources=HOST_CPUS*.8
31+
build --local_resources=memory=HOST_RAM*.8
32+
build --local_resources=cpu=HOST_CPUS*.8

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ module(
88

99
# Dependencies for WebAssembly tooling
1010
bazel_dep(name = "rules_rust", version = "0.46.0")
11-
bazel_dep(name = "bazel_skylib", version = "1.5.0")
12-
bazel_dep(name = "platforms", version = "0.0.8")
11+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
12+
bazel_dep(name = "platforms", version = "0.0.10")
1313

1414
# Development dependencies
1515
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
16-
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True)
16+
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
1717

1818
# Rust toolchain setup
1919
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")

wac/wac_compose.bzl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,13 @@ def _generate_composition(components):
155155

156156
# Export first component as main
157157
if components:
158-
first_comp = next(iter(components))
159-
lines.append("export {} as main;".format(first_comp))
158+
# Get first key from dict (Starlark doesn't have next/iter)
159+
first_comp = None
160+
for key in components:
161+
first_comp = key
162+
break
163+
if first_comp:
164+
lines.append("export {} as main;".format(first_comp))
160165

161166
return "\n".join(lines)
162167

0 commit comments

Comments
 (0)