Skip to content

Conversation

@superstructor
Copy link

Complete migration from legacy shell script build approach to the unified Meson build pattern used across the Discere OS WASM ecosystem.

New Files

  • emscripten-cross.ini: Emscripten toolchain configuration
  • scripts/unified-build.sh: Single build orchestrator for all variants
  • dependencies.json: CDN dependency manifest
  • MIGRATION.md: Comprehensive migration documentation

Modified Files

  • meson_options.txt: Added WASM-specific build options

    • wasm_build_type: minimal|standard|webgpu
    • wasm_simd: Enable SIMD optimizations (default: true)
    • wasm_threading: Enable pthread support (default: true)
    • wasm_optimize: size|speed|balanced (default: balanced)
  • wasm/meson.build: Unified build configuration

    • Conditional compilation based on build options
    • Proper flag management for MAIN_MODULE and SIDE_MODULE
    • Memory configuration per build type
    • All flags centralized (no manual emcc calls)
  • deno.json: Simplified build tasks

    • build:wasm - Standard build
    • build:minimal - Minimal size build
    • build:webgpu - WebGPU-enabled build
    • build:clean - Clean build from scratch

Benefits

  • ✅ Single source of truth (all flags in meson.build)
  • ✅ Upstream compatibility (updates flow through naturally)
  • ✅ No manual emcc calls in shell scripts
  • ✅ Type-safe configuration via meson_options.txt
  • ✅ Three build variants: minimal, standard, webgpu
  • ✅ Comprehensive error handling and logging

Build Variants

  • Minimal: 70-100KB, 64MB initial memory
  • Standard: 100-200KB, 128MB initial, 1GB max
  • WebGPU: 150-300KB, 256MB initial, 2GB max, GPU support

Usage

deno task build:wasm      # Standard build
deno task build:minimal   # Minimal size
deno task build:webgpu    # WebGPU support

All build logic is now centralized in Meson configuration files, eliminating manual emcc invocations and ensuring consistency across the Discere OS WASM ecosystem.

Complete migration from legacy shell script build approach to the unified
Meson build pattern used across the Discere OS WASM ecosystem.

## New Files

- emscripten-cross.ini: Emscripten toolchain configuration
- scripts/unified-build.sh: Single build orchestrator for all variants
- dependencies.json: CDN dependency manifest
- MIGRATION.md: Comprehensive migration documentation

## Modified Files

- meson_options.txt: Added WASM-specific build options
  * wasm_build_type: minimal|standard|webgpu
  * wasm_simd: Enable SIMD optimizations (default: true)
  * wasm_threading: Enable pthread support (default: true)
  * wasm_optimize: size|speed|balanced (default: balanced)

- wasm/meson.build: Unified build configuration
  * Conditional compilation based on build options
  * Proper flag management for MAIN_MODULE and SIDE_MODULE
  * Memory configuration per build type
  * All flags centralized (no manual emcc calls)

- deno.json: Simplified build tasks
  * build:wasm - Standard build
  * build:minimal - Minimal size build
  * build:webgpu - WebGPU-enabled build
  * build:clean - Clean build from scratch

## Benefits

- ✅ Single source of truth (all flags in meson.build)
- ✅ Upstream compatibility (updates flow through naturally)
- ✅ No manual emcc calls in shell scripts
- ✅ Type-safe configuration via meson_options.txt
- ✅ Three build variants: minimal, standard, webgpu
- ✅ Comprehensive error handling and logging

## Build Variants

- Minimal: 70-100KB, 64MB initial memory
- Standard: 100-200KB, 128MB initial, 1GB max
- WebGPU: 150-300KB, 256MB initial, 2GB max, GPU support

## Usage

```bash
deno task build:wasm      # Standard build
deno task build:minimal   # Minimal size
deno task build:webgpu    # WebGPU support
```

All build logic is now centralized in Meson configuration files,
eliminating manual emcc invocations and ensuring consistency across
the Discere OS WASM ecosystem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants