Skip to content

Conversation

@cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Dec 9, 2025

Enabling filter_wasm plugin on ARM64 Windows needs to use generic invoke mechanism for Wasm programs.
WAMR_BUILD_INVOKE_NATIVE_GENERAL enables generic native invoke code but it's enough for our use case because we just use only 6 arguments to invoke WebAssembly programs.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
    Flush        1
    Daemon       Off
    Log_Level    info
    HTTP_Server  On
    HTTP_Listen  0.0.0.0
    HTTP_Port    2020
    Hot_Reload   On
    Grace 5

[INPUT]
    Name dummy
    Tag dummy.locals
    Dummy {"message":"dummy","wasm_float1":1.0,"wasm_float2":100.0,"wasm_int1":1,"wasm_int2":100}

[FILTER]
    Name wasm
    match dummy.*
    event_format msgpack
    WASM_Path filter_rust_msgpack.wasm
    Function_Name rust_filter_msgpack
    accessible_paths .,C:\Users\$USER\Documents\GitHub\fluent-bit\build

[OUTPUT]
    Name  stdout
    Match *
  • Debug log output from testing the change
Fluent Bit v4.2.1
* Copyright (C) 2015-2025 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _             ___   _____
|  ___| |                | |   | ___ (_) |           /   | / __  \
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __/ /| | `' / /'
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| |   / /
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /\___  |_./ /___
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/     |_(_)_____/

             Fluent Bit v4.2 - Direct Routes Ahead
         Celebrating 10 Years of Open, Fluent Innovation!

[2025/12/09 16:44:23.415848800] [ info] Configuration:
[2025/12/09 16:44:23.415893000] [ info]  flush time     | 1.000000 seconds
[2025/12/09 16:44:23.415928700] [ info]  grace          | 5 seconds
[2025/12/09 16:44:23.415949100] [ info]  daemon         | 0
[2025/12/09 16:44:23.415961300] [ info] ___________
[2025/12/09 16:44:23.415974900] [ info]  inputs:
[2025/12/09 16:44:23.416003800] [ info]      dummy
[2025/12/09 16:44:23.416023900] [ info] ___________
[2025/12/09 16:44:23.416036100] [ info]  filters:
[2025/12/09 16:44:23.416046000] [ info]      wasm.0
[2025/12/09 16:44:23.416058000] [ info] ___________
[2025/12/09 16:44:23.416067900] [ info]  outputs:
[2025/12/09 16:44:23.416078300] [ info]      stdout.0
[2025/12/09 16:44:23.416088200] [ info] ___________
[2025/12/09 16:44:23.416098300] [ info]  collectors:
[2025/12/09 16:44:23.417661600] [ info] [fluent bit] version=4.2.1, commit=7ded9ae04e, pid=5964
[2025/12/09 16:44:23.417686200] [debug] [engine] maxstdio set: 512
[2025/12/09 16:44:23.417697200] [debug] [engine] coroutine stack size: 98302 bytes (96.0K)
[2025/12/09 16:44:23.417934900] [ info] [storage] ver=1.5.4, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2025/12/09 16:44:23.417946900] [ info] [simd    ] NEON
[2025/12/09 16:44:23.417954000] [ info] [cmetrics] version=1.0.5
[2025/12/09 16:44:23.417962700] [ info] [ctraces ] version=0.6.6
[2025/12/09 16:44:23.418192200] [ info] [input:dummy:dummy.0] initializing
[2025/12/09 16:44:23.418201800] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2025/12/09 16:44:23.418300800] [debug] [dummy:dummy.0] created event channels: read=760 write=764
[2025/12/09 16:44:23.422447100] [debug] [stdout:stdout.0] created event channels: read=788 write=792
[2025/12/09 16:44:23.423613900] [ info] [output:stdout:stdout.0] worker #0 started
[2025/12/09 16:44:23.424541300] [ info] [http_server] listen iface=0.0.0.0 tcp_port=2020
[2025/12/09 16:44:23.424576000] [ info] [sp] stream processor started
[2025/12/09 16:44:23.424975400] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
[2025/12/09 16:44:25.420349100] [debug] [task] created task=000002617E1CB550 id=0 OK
[2025/12/09 16:44:25.420385400] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.locals: [[1765266264.422558500, {}], {"message"=>"dummy", "time"=>"2025-12-09T07:44:24.422558500 +0000", "tag"=>"dummy.locals", "original"=>{"message"=>"dummy", "platform"=>"wasm", "wasm_float1"=>"1", "wasm_float2"=>"100", "wasm_int1"=>"1", "wasm_int2"=>"100"}, "lang"=>"Rust"}]
[2025/12/09 16:44:25.421832300] [debug] [out flush] cb_destroy coro_id=0
[2025/12/09 16:44:25.421896300] [debug] [task] destroy task=000002617E1CB550 (task_id=0)
[2025/12/09 16:44:26.422281200] [debug] [task] created task=000002617E1CBE10 id=0 OK
[2025/12/09 16:44:26.422315500] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.locals: [[1765266265.420700900, {}], {"message"=>"dummy", "time"=>"2025-12-09T07:44:25.420700900 +0000", "tag"=>"dummy.locals", "original"=>{"message"=>"dummy", "platform"=>"wasm", "wasm_float1"=>"1", "wasm_float2"=>"100", "wasm_int1"=>"1", "wasm_int2"=>"100"}, "lang"=>"Rust"}]
[2025/12/09 16:44:26.423721900] [debug] [out flush] cb_destroy coro_id=1
[2025/12/09 16:44:26.423799700] [debug] [task] destroy task=000002617E1CBE10 (task_id=0)
[2025/12/09 16:44:27] [engine] caught signal (SIGINT)
[2025/12/09 16:44:27.432227200] [debug] [task] created task=000002617E1CB190 id=0 OK
[2025/12/09 16:44:27.432278000] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.locals: [[1765266266.422624300, {}], {"message"=>"dummy", "time"=>"2025-12-09T07:44:26.422624300 +0000", "tag"=>"dummy.locals", "original"=>{"message"=>"dummy", "platform"=>"wasm", "wasm_float1"=>"1", "wasm_float2"=>"100", "wasm_int1"=>"1", "wasm_int2"=>"100"}, "lang"=>"Rust"}]
[2025/12/09 16:44:27.433765500] [debug] [out flush] cb_destroy coro_id=2
[2025/12/09 16:44:27.433818000] [debug] [task] destroy task=000002617E1CB190 (task_id=0)
[2025/12/09 16:44:27.464414400] [debug] [task] created task=000002617E1CB050 id=0 OK
[2025/12/09 16:44:27.464439300] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[2025/12/09 16:44:27.464460400] [ warn] [engine] service will shutdown in max 5 seconds
[2025/12/09 16:44:27.464468000] [debug] [engine] task 0 already scheduled to run, not re-scheduling it.
[2025/12/09 16:44:27.464481700] [ info] [engine] pausing all inputs..
[2025/12/09 16:44:27.464491500] [ info] [input] pausing dummy.0
[0] dummy.locals: [[1765266267.432307000, {}], {"message"=>"dummy", "time"=>"2025-12-09T07:44:27.432307000 +0000", "tag"=>"dummy.locals", "original"=>{"message"=>"dummy", "platform"=>"wasm", "wasm_float1"=>"1", "wasm_float2"=>"100", "wasm_int1"=>"1", "wasm_int2"=>"100"}, "lang"=>"Rust"}]
[2025/12/09 16:44:27.465357100] [debug] [out flush] cb_destroy coro_id=3
[2025/12/09 16:44:27.465400200] [debug] [task] destroy task=000002617E1CB050 (task_id=0)
[2025/12/09 16:44:28.462640200] [ info] [engine] service has stopped (0 pending tasks)
[2025/12/09 16:44:28.462670500] [ info] [input] pausing dummy.0
[2025/12/09 16:44:28.463007500] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2025/12/09 16:44:28.463246200] [ info] [output:stdout:stdout.0] thread worker #0 stopped
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Chores
    • Enabled WebAssembly (WASM) support for ARM64 Windows systems.
    • Enabled WASM filtering capabilities for ARM64 Windows systems.
    • Added temporary workaround for ARM64 architecture compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

This change enables WebAssembly (WASM) support for ARM64 Windows builds by setting FLB_WASM and FLB_FILTER_WASM to enabled. A temporary workaround flag (WAMR_BUILD_INVOKE_NATIVE_GENERAL) is introduced specifically for the ARM64 architecture.

Changes

Cohort / File(s) Summary
ARM64 WASM Build Configuration
cmake/windows-setup.cmake
Enables FLB_WASM and FLB_FILTER_WASM for ARM64 Windows; adds WAMR_BUILD_INVOKE_NATIVE_GENERAL workaround flag for ARM64 architecture

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Verify the WAMR_BUILD_INVOKE_NATIVE_GENERAL workaround is appropriate and temporary as intended
  • Confirm ARM64 WASM enablement aligns with intended platform support matrix
  • Cross-check against conflicting or dependent changes in related PRs (#10818, #10832)

Possibly related PRs

Suggested labels

docs-required, ok-package-test

Suggested reviewers

  • niedbalski
  • patrick-stephens
  • fujimotos
  • celalettin1286

Poem

🐰 A whisker twitch, an ARM64 dream,
WASM flows where Windows beams,
Invoke and build, the workaround spins,
New architecture—let the fly begin!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling the filter_wasm plugin on ARM64 Windows, which is the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cosmo0920-enable-filter-wasm-on-arm64-windows

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cosmo0920 cosmo0920 added this to the Fluent Bit v5.0 milestone Dec 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
cmake/windows-setup.cmake (1)

38-41: Arm64 Windows WAMR flag: behavior looks sound; consider clarifying the “temporary” nature

Enabling FLB_WASM for FLB_ARCH STREQUAL "arm64" and setting WAMR_BUILD_INVOKE_NATIVE_GENERAL only in that branch is consistent with the goal of limiting the workaround to ARM64 Windows and shouldn’t affect x64/x86 builds.

To make the intent clearer and easier to clean up later, you might want to turn the comment into an explicit TODO mentioning when this can be removed (e.g., after a specific WAMR upgrade or upstream fix), so it does not become a long‑term hidden knob.

-    # This is temporary solution to enable flb_wasm on ARM64 Windows.
+    # TODO: Temporary workaround to enable flb_wasm on ARM64 Windows.
+    #       Remove once WAMR supports this scenario without INVOKE_NATIVE_GENERAL.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ded9ae and 22e2ab3.

📒 Files selected for processing (1)
  • cmake/windows-setup.cmake (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: cosmo0920
Repo: fluent/fluent-bit PR: 10851
File: include/fluent-bit/flb_simd.h:60-66
Timestamp: 2025-09-08T11:21:33.975Z
Learning: Fluent Bit currently only supports MSVC compiler on Windows, so additional compiler compatibility guards may be unnecessary for Windows-specific code paths.
📚 Learning: 2025-08-31T12:46:11.940Z
Learnt from: ThomasDevoogdt
Repo: fluent/fluent-bit PR: 9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit CMakeLists.txt, the system library preference flags are defined as FLB_PREFER_SYSTEM_LIB_ZSTD and FLB_PREFER_SYSTEM_LIB_KAFKA with the FLB_ prefix.

Applied to files:

  • cmake/windows-setup.cmake
📚 Learning: 2025-08-31T12:46:11.940Z
Learnt from: ThomasDevoogdt
Repo: fluent/fluent-bit PR: 9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit, the correct CMake flag for using system librdkafka is `FLB_PREFER_SYSTEM_LIB_KAFKA=ON`.

Applied to files:

  • cmake/windows-setup.cmake
📚 Learning: 2025-09-08T11:21:33.975Z
Learnt from: cosmo0920
Repo: fluent/fluent-bit PR: 10851
File: include/fluent-bit/flb_simd.h:60-66
Timestamp: 2025-09-08T11:21:33.975Z
Learning: Fluent Bit currently only supports MSVC compiler on Windows, so additional compiler compatibility guards may be unnecessary for Windows-specific code paths.

Applied to files:

  • cmake/windows-setup.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COMPILER_STRICT_POINTER_TYPES=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_ARROW=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COVERAGE=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, gcc, g++)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, clang, clang++, ubuntu-24.04, clang-14)
  • GitHub Check: pr-compile-without-cxx (3.31.6)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, clang, clang++, ubuntu-22.04, clang-12)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, gcc, g++, ubuntu-22.04, clang-12)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, gcc, g++, ubuntu-24.04, clang-14)
  • GitHub Check: pr-compile-centos-7
🔇 Additional comments (1)
cmake/windows-setup.cmake (1)

136-141: FLB_FILTER_WASM enablement on ARM64 is consistent with other Windows archs

Aligning FLB_FILTER_WASM to Yes for arm64 alongside x64 and x86 matches the top‑level FLB_WASM settings and the PR objective; no issues from this change.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@cosmo0920
Copy link
Contributor Author

Building on Windows results are here:
https://github.com/fluent/fluent-bit/actions/runs/20056244881

if(FLB_ARCH STREQUAL "arm64")
set(FLB_WASM No)
set(FLB_WASM Yes)
# This is temporary solution to enable flb_wasm on ARM64 Windows.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we tracking this in an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this. This was already resolved in upstream here:
bytecodealliance/wasm-micro-runtime#4636
But this patch didn't include any of the stable WAMR releases yet.

@patrick-stephens patrick-stephens added ok-package-test Run PR packaging tests and removed docs-required labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-package-test Run PR packaging tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants