Skip to content

[3b] Clean up deprecated Emscripten build flags and bump WebARKitLib submodule #27

@kalwalt

Description

@kalwalt

Summary

Clean up deprecated and incorrect Emscripten build flags in tools/makem.js and bump the WebARKitLib submodule

Environment

  • Product/Service: FeatureSET-Display — Emscripten build system
  • File: tools/makem.js

Problem Description

Several issues in the Emscripten build configuration:

  1. TOTAL_MEMORY is deprecated: The current flag should be INITIAL_MEMORY. Additionally, the comment says 64MB but the actual value is 256MB — comment and value disagree.
  2. arguments shadowing: var arguments = process.argv shadows the reserved JS arguments keyword — replace with const argv = process.argv.slice(2) and for…of.
  3. No wasm debug target: DEBUG_FLAGS currently only apply to the asm.js debug build, which is being removed (see issue 2d). A dedicated wasm debug target with DEBUG_FLAGS is needed.
  4. Stale WebARKitLib submodule: Currently pinned ~4 years back; should be bumped to latest stable.

Expected Behavior

  • INITIAL_MEMORY is used instead of TOTAL_MEMORY; comment and value agree.
  • No arguments shadowing in tools/makem.js.
  • A dedicated wasm debug build target exists with DEBUG_FLAGS applied.
  • WebARKitLib submodule is on a recent, tested commit.

Actual Behavior

  • Deprecated TOTAL_MEMORY flag used; comment/value mismatch.
  • var arguments = process.argv silently shadows reserved identifier.
  • Debug flags only apply to the asm.js build that is being deleted.
  • Submodule is 4 years stale.

Tasks

  • Replace TOTAL_MEMORY with INITIAL_MEMORY; align comment and value (64MB vs 256MB — decide which is correct)
  • Replace var arguments = process.argv with const argv = process.argv.slice(2) and update all references
  • Add a dedicated wasm debug build target with DEBUG_FLAGS applied (replacing the asm.js debug build being dropped in 2d)
  • Bump the WebARKitLib submodule to a recent tested commit; update .gitmodules and test the build

Impact

MediumTOTAL_MEMORY is silently accepted by current Emscripten but may break in future versions. Stale submodule may carry bugs fixed upstream.

Additional Context

This issue is the companion to 3a (JS toolchain update). Both should land together for a clean build-system baseline before adding tests (3c) and CI (3d). The arguments shadow is a correctness bug in Node.js strict mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions