Attention is currently required from: fixeria, neels, pespin.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email )
Change subject: Add Emscripten build support and JS callback logging backend
......................................................................
Patch Set 5:
(15 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/c8fae8a5_871cf07b?… :
PS5, Line 7: Add Emscripten build support and JS callback logging backend
> Why is this needed? How is this used? What's the context? I'm missing a good description here for a […]
Thanks for pointing this out.
The purpose of this patch is to make libosmocore usable in sandboxed, non-POSIX environments, specifically WebAssembly targets built with the Emscripten toolchain.
In such environments, a number of assumptions made by libosmocore (process model, availability of standard OS interfaces, and I/O mechanisms) do not hold, which currently prevents the library from being built and used at all. This patch introduces the minimal platform-specific adjustments required to enable successful builds and basic runtime integration in that context.
The intended use case is running Osmocom protocol and control components inside a WebAssembly runtime, where interaction with the outside world is mediated by the host environment rather than direct OS access.
All changes are limited to Emscripten-specific build paths and are inactive for native targets, leaving existing deployments and behavior unchanged.
I will update the commit message to better reflect this context.
File include/osmocom/core/logging.h:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/61a177af_16eba50d?… :
PS5, Line 285: LOG_TGT_TYPE_WEB, /*!< Web logging */
> AFAIU this is not "web generic" but "emscripten" specific, so let's please rename to something more […]
Thanks for the clarification. You are right — the current naming suggests a generic “web” abstraction, while in practice this mechanism is only enabled for Emscripten builds.
I will rename the API accordingly and update the commit message to better explain the intended scope and usage. I will send an updated patch shortly.
File src/core/netdev.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/9b4fa443_a0750960?… :
PS5, Line 67: #if (!EMBEDDED) && !defined(__EMSCRIPTEN__)
> I'd say better do this logic inside configure. […]
Fully agree, that's cleaner and more in line with the rest of the library.
I went ahead and added a new configure option `ENABLE_NETDEV` in configure.ac.
For EMBEDDED and EMSCRIPTEN builds it is explicitly set to `false`
Right now it fails to compile
File src/core/osmo_io_internal.h:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/3e3463c3_a1fc752c?… :
PS5, Line 7: HAVE_LIBSCTP
> Indeed config.h should be at the top.
Thanks for catching this!
You're right — I completely missed that config.h is included after this block
File src/core/serial.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/e06b29b5_62274514?… :
PS5, Line 27: #if !defined(__EMSCRIPTEN__)
> Again, I'd say better add a HAVE_SERIAL or alike in configure.ac. […]
Thanks for the note!
After taking a closer look at configure.ac, I noticed the project already uses `ENABLE_SERIAL` to conditionally skip compiling the serial.c file.
The file compiles without issues, but in emscripten/web environments there's simply no need for serial support at all.
File src/core/socket.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/db2155dc_fb4f7485?… :
PS5, Line 2050: #ifdef HAVE_LIBSCTP
> missing explanation for this change. It may be a separate patch.
Explained in the comment for the function `osmo_sock_multiaddr_get_ip_and_port`
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/1dc18b36_a3750508?… :
PS5, Line 1928: #ifdef HAVE_LIBSCTP
> Why this change? I'm lacking any rationale here. Also, looks like this may be a separate patch.
About functions `osmo_sock_multiaddr_get_ip_and_port`, `osmo_multiaddr_ip_and_port_snprintf` and `osmo_sock_multiaddr_get_name_buf`:
These functions were previously conditionally compiled only under `HAVE_LIBSCTP`. However, `libosmo-netif` uses some of them without the same `HAVE_LIBSCTP` guards, leading to link failures when libsctp is disabled.
Additionally, the implementations already included a fallback to legacy (single-address) behavior, so they do not strictly depend on SCTP/multi-homing features.
Refactoring done as follows:
- `osmo_sock_multiaddr_get_ip_and_port` was slightly adjusted for better fallback handling.
- `osmo_multiaddr_ip_and_port_snprintf` and `osmo_sock_multiaddr_get_name_buf` were moved outside the `HAVE_LIBSCTP` conditional block, as they do not depend on libsctp at all.
File src/vty/Makefile.am:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/b1057c93_11cc95e4?… :
PS5, Line 36: libosmovty_la_SOURCES += telnet_interface_dummy.c
> This for sure also needs an explanation.
In Emscripten there are no sockets so `telnet_interface.c` fails to compile.
However, completely excluding the file from the build leads to link errors (undefined references to the telnet functions).
To resolve this, I added a new file `telnet_interface_dummy.c` with stub/empty implementations of the required functions.
I considered adding many `#ifdef __EMSCRIPTEN__` blocks directly inside telnet_interface.c, but decided that separate dummy stubs are the cleaner approach.
File src/vty/logging_vty.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/69d27735_c443c3fd?… :
PS5, Line 907: #if !defined(__EMSCRIPTEN__)
> this also needs explanation.
The conditional compilation here was added by mistake — it's not needed in this place.
This spot was accidentally affected when I removed the file logging parts (Emscripten only emulates files via IndexedDB with no native operations, so file logging isn't usable anyway).
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/8d31850a_a69015c0?… :
PS5, Line 1038: DEFUN(cfg_log_web, cfg_log_web_cmd,
> #if defined(__EMSCRIPTEN__)
Thanks — added conditional compilation `#if defined(__EMSCRIPTEN__)`
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/d7daf5db_e7550d3b?… :
PS5, Line 1047: vty_out(vty, "%% Unable to create WEB log for %s", VTY_NEWLINE);
> this string end looks wrong
Thanks, fixed
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/35256656_e28f4c34?… :
PS5, Line 1067: vty_out(vty, "%% Unable to find WEB log target for %s", VTY_NEWLINE);
> this string end looks wrong
Thanks, fixed
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/446e4480_df154fdc?… :
PS5, Line 1130:
> No need for a space here.
Thanks, fixed
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/f04400fe_0e2783cd?… :
PS5, Line 1361: install_lib_element(CONFIG_NODE, &cfg_log_web_cmd);
: install_lib_element(CONFIG_NODE, &cfg_no_log_web_cmd);
> I assume these commands are only relevant for emscripten? […]
Thanks — added conditional compilation `#if defined(__EMSCRIPTEN__)`
File src/vty/telnet_interface_dummy.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/6ab07699_cea1ec23?… :
PS5, Line 18: #include <sys/socket.h>
: #include <netinet/in.h>
: #include <errno.h>
: #include <stdlib.h>
: #include <stdio.h>
: #include <string.h>
: #i
> (Not critical) Most if the includes are not needed here and can be removed?
Thanks for pointing that out!
You're right — many of the includes here are indeed not needed anymore (leftover from copy-paste)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 5
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 13 Jan 2026 00:40:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: Timur Davydov, neels, pespin.
Hello Jenkins Builder, fixeria, neels, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Code-Review-1 by pespin, Verified+1 by Jenkins Builder
Change subject: Add Emscripten build support and JS callback logging backend
......................................................................
Add Emscripten build support and JS callback logging backend
This change enables building libosmocore for sandboxed, non-POSIX environments such as WebAssembly targets produced via the Emscripten toolchain.
In such environments, common OS facilities assumed by existing build and platform detection logic are unavailable, which currently prevents libosmocore from being built without targeted, build-time adjustments.
As part of this groundwork, a minimal callback-based logging hook is introduced.
When building for Emscripten, this hook allows forwarding log messages to an external environment via a user-provided JS callback. For all other build targets, the hook resolves to a no-op implementation and does not affect existing logging behavior.
No new runtime behavior or protocol changes are introduced. All changes are limited to build-time and platform-specific paths and are only active when targeting Emscripten. Native builds and existing deployment scenarios remain unaffected.
Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
---
M configure.ac
M include/osmocom/core/logging.h
M src/core/Makefile.am
M src/core/libosmocore.map
A src/core/logging_emscripten.c
M src/core/netdev.c
M src/core/osmo_io_internal.h
M src/core/socket.c
M src/core/stats_tcp.c
M src/core/tun.c
M src/vty/Makefile.am
M src/vty/logging_vty.c
A src/vty/telnet_interface_dummy.c
13 files changed, 276 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/41813/6
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 6
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Attention is currently required from: fixeria, osmith.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/docker-playground/+/41778?usp=email )
Change subject: ttcn3-bts-test: bpftrace: filter by executable name
......................................................................
Patch Set 2:
(1 comment)
File ttcn3-bts-test/bpftrace/ksys_write_delay.bt:
https://gerrit.osmocom.org/c/docker-playground/+/41778/comment/46c3c677_996… :
PS2, Line 28: kretprobe:ksys_write / comm == str($1) && @start[tid] /
This change is not needed, since the other condition can only be true already when comm == str($1)
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/41778?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I04c2e36806534a8ca650733bacf521ea57950692
Gerrit-Change-Number: 41778
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 12 Jan 2026 23:07:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/docker-playground/+/41778?usp=email )
Change subject: ttcn3-bts-test: bpftrace: filter by executable name
......................................................................
Patch Set 1:
(2 comments)
This change is ready for review.
File ttcn3-bts-test/bpftrace/ksys_write_delay.bt:
https://gerrit.osmocom.org/c/docker-playground/+/41778/comment/f0c4e7ae_b3e… :
PS1, Line 20: kprobe:ksys_write / comm == $1 /
> This needs to be: / comm == str($1) /
Done
File ttcn3-bts-test/bpftrace/udp_sendmsg_delay.bt:
https://gerrit.osmocom.org/c/docker-playground/+/41778/comment/f11d9fe9_7a0… :
PS1, Line 20: kprobe:udp_sendmsg / comm == $1 /
> This needs to be: / comm == str($1) /
Done
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/41778?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I04c2e36806534a8ca650733bacf521ea57950692
Gerrit-Change-Number: 41778
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 12 Jan 2026 22:03:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41773?usp=email )
Change subject: ipaccess-config-e1-driver: Make sure struct input_signal_data is zero initialized
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-bsc/+/41773/comment/69dc920a_60cf3c10?usp… :
PS1, Line 7: struct input_signal_data is zero initialized
> Fine with me, just mentioning a corner care that I faced myself some time ago ;)
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41773?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If97c4a4202eaf96446d48e821d5e59c98bafe51c
Gerrit-Change-Number: 41773
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 12 Jan 2026 12:52:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>