Skip to content

[wasm] Review relink triggering properties #105135

Closed

Description

@ilonatommy

We have some properties that we mark as PropertiesThatTriggerRelinking in wasi and wasm. Currently we are most probably not marking all of these, that should be marked this way.

Discussion: #104790 (comment)

Fix (steps for copilot):

Add only to WASM:

  • EmccInitialHeapSize- together with EmccMaximumHeapSize it's controlling the memory layout. It should be added by a symmetry rule. Heap size configuration applies only for browser scenarios, same as ExceptionHandling.

Add only to WASI:

  • nothing identified.

Add to both:

  • WasmEnableThreads - affects memory layout, e.g. usage of SharedArrayBuffer in the browser or DISABLE_THREADS switches in the runtime.
  • RunAOTCompilation - the native objects and linked outputs are no longer valid for the new value and must be rebuilt.
  • PublishTrimmed - the set of assemblies and code passed to the native linker changes significantly.

Activity

  1. added this to the 10.0.0 milestone on Jul 19, 2024
  2. dotnet-policy-service commented on Jul 19, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing
    See info in area-owners.md if you want to be subscribed.

  3. reopened this on Jul 29, 2024
  4. added
    Priority:3
    on Jan 13, 2025
  5. ilonatommy commented on Jul 23, 2025

    @ilonatommy
    MemberAuthor

    It is best to trigger relinking only for a targeted subset of properties (affecting the native build, e.g. memory layout, code generation, feature toggles, linking flags). If we flagged all of them, we would possibly unnecessarily prolong the build time.

    Add only to WASM:

    • EmccInitialHeapSize- together with EmccMaximumHeapSize it's controlling the memory layout. It should be added by a symmetry rule. Heap size configuration applies only for browser scenarios, same as ExceptionHandling.

    Add only to WASI:

    • nothing identified.

    Add to both:

    • WasmEnableThreads - affects memory layout, e.g. usage of SharedArrayBuffer in the browser or DISABLE_THREADS switches in the runtime.
    • RunAOTCompilation - the native objects and linked outputs are no longer valid for the new value and must be rebuilt.
    • PublishTrimmed - the set of assemblies and code passed to the native linker changes significantly.

    PropertiesThatTriggerRelinking supports only properties. There are items that could also affect native build but we don't provide a mechanism to trigger relink on their change:

    • EmccExportedRuntimeMethod
    • EmccExportedFunction
    • WasmOptConfigurationFlags
      Supporting items would require some more complex comparison logic to check for both: metadata and identity. Because of complexity of this solution, I would skip items.
  6. locked and limited conversation to collaborators on Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Priority:3arch-wasmarea-Build-mono

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions