Attention is currently required from: laforge, 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 (#20).
The following approvals got outdated and were removed:
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, specifically WebAssembly targets produced via the
Emscripten toolchain.
The broader motivation is to allow partial execution of selected
Osmocom components in isolated runtime environments where direct access
to hardware and traditional operating system facilities (filesystem,
sockets, privileged execution) is not available.
One intended use case is running a GSM 2G base station where the
radio-facing components are executed inside a web environment, while
the remaining Osmocom stack and core network components continue to run
unchanged on a conventional backend server. In this model, highly
stripped-down variants of osmo-bts and osmo-trx are built as static
WebAssembly libraries and executed in the browser, while depending on
core libraries such as libosmocore, libosmo-netif, and libosmo-abis.
A practical advantage of this approach is that no deployment or
privileged setup is required on the radio endpoint side. A user can
instantiate a radio endpoint with minimal configuration, while all
stateful logic and operational complexity remains centralized on the
backend. Multiple such radio endpoints may connect to the same backend
core network, effectively forming a single logical network from the
core network perspective, independent of the physical location of the
radio endpoints.
Existing libosmocore build logic and platform assumptions rely on the
availability of POSIX APIs and OS services which are not present in
WebAssembly runtimes. This currently prevents libosmocore from being
built for such targets without targeted, build-time adjustments. This
patch introduces the minimal set of changes required to enable such
builds, without affecting native platforms.
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 JavaScript
callback. This enables integration with browser-side logging or UI
infrastructure without introducing new logging backends or runtime
dependencies. For all other build targets, the hook resolves to a no-op
implementation and does not alter existing logging behavior.
No runtime behavior, protocol semantics, or network interactions are
changed by this patch. All modifications are strictly limited to
build-time and platform-specific code paths and are only active when
targeting Emscripten. Native builds and existing deployment scenarios
remain unaffected.
This patch is intended as groundwork. Follow-up changes, proposed
separately and incrementally, may extend similar support to other
Osmocom components such as libosmo-netif, libosmo-abis, osmo-bts, and
osmo-trx, while keeping all such changes optional and isolated from
native builds.
Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
---
M .gitignore
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/tun.c
M src/vty/logging_vty.c
9 files changed, 164 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/41813/20
--
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: 20
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: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, 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 19:
(5 comments)
File configure.ac:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/ac292e99_fddbad83?… :
PS16, Line 259: AM_CONDITIONAL(ENABLE_TUN, test "x$embedded" != "xyes" && test "x$emscripten" != "xyes")
> This will still probably need fixing in a separate patch like the NETNS stuff you fixed
Agreed, this likely needs an additional fix. This should follow the same
approach as netns. I’ll address this in a follow-up patch.
File src/core/Makefile.am:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/e4e0753f_7b78d474?… :
PS16, Line 87: if ENABLE_TUN
> This will probably need some sort of other fix? Why can't you add it when building for emscripten?
Agreed, this likely needs an additional fix. This should follow the same
approach as netns. I’ll address this in a follow-up patch.
File src/core/osmo_io_internal.h:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/b0a4317c_9b0388a0?… :
PS16, Line 5: #include "../config.h"
> This and the change below deserve a separate patch, feel free to submit previously in the branch to […]
Done, split out and submitted as a separate patch.
File src/core/stats_tcp.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/9a5e15b4_66cc0485?… :
PS16, Line 198: #if !defined(__EMSCRIPTEN__)
> This should be fixed in a more generic way. […]
The build fails due to missing Linux-specific headers/types.
First, without any guards:
stats_tcp.c:33:10: fatal error: 'linux/tcp.h' file not found
#include <linux/tcp.h>
If I try to workaround this by guarding the include with `#if defined(__linux__)`,
the build still fails because the code below relies on Linux-only types/macros:
stats_tcp.c:103:18: error: variable has incomplete type 'struct tcp_info'
stats_tcp.c:112:56: error: use of undeclared identifier 'TCP_INFO'
So this can’t be fixed just by wrapping the include. We need a generic
configure-time feature/header check (e.g. for linux/tcp.h and/or the presence
of struct tcp_info / TCP_INFO) and conditionally build/enable the TCP_INFO
stats code based on that.
I’ll address this in a separate patch.
File src/vty/logging_vty.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/0dd72b47_c759ba86?… :
PS16, Line 937: #if !defined(__EMSCRIPTEN__)
> what about leaving this in and let it fail during runtime if user tries to use it?
Agreed. I disabled it only to avoid creating files on the Web side, but since
Emscripten provides an IndexedDB-backed filesystem, leaving it enabled and
failing at runtime is fine. I’ll update the patch
--
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: 19
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: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 23 Jan 2026 00:42:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/39742?usp=email )
Change subject: personalization: refactor ConfigurableParameter, Iccid, Imsi
......................................................................
Patch Set 18:
(1 comment)
File pySim/esim/saip/personalization.py:
https://gerrit.osmocom.org/c/pysim/+/39742/comment/8ed0850d_737929b1?usp=em… :
PS13, Line 50: r"""Base class representing a part of the eSIM profile that is configurable during the
> about the stub idea: […]
I'd like to try and see if i'm allowed to resolve this now...
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
Gerrit-Change-Number: 39742
Gerrit-PatchSet: 18
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 22 Jan 2026 23:54:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/39742?usp=email )
Change subject: personalization: refactor ConfigurableParameter, Iccid, Imsi
......................................................................
Patch Set 18:
(1 comment)
File pySim/esim/saip/personalization.py:
https://gerrit.osmocom.org/c/pysim/+/39742/comment/7c69df23_a36ab212?usp=em… :
PS13, Line 50: r"""Base class representing a part of the eSIM profile that is configurable during the
> > re the build failure, dear Vadim, on the contrary. […]
about the stub idea:
- if I have to add a fake non-abstract yet abstract stub to prevent ABC from doing what it was designed to do, it defies the point of ABC, right? =) Instead I can just remove the @abstractmethod decorator to achieve the same goal.
- I can adjust these classes here, but i want to keep other peoples' subclasses that may be out there intact, too. I would like to add the new classmethod in an *optional* way, leaving the transition to the new features up to the implementing classes -- transitions are
shown in the subsequent commits.
As part of this discussion, I'd also like to mention from the future:
In a later patch, we generate SdKey classes by using
`type('Xxx',...)`
instead of
`class Xxx:`
According to python docs, they are identical:
https://docs.python.org/3/library/functions.html#type
"The following two...create identical..."
However, it turns out that, as soon as ConfigurableParameter inherits from ABC, the newly created `SdKeyXxx.__module__` member suddenly points to module `abc`, not to `pySim.esim.saip.personalization` where it was actually created, and I have to set the `__module__` member explicitly to make things work again.
(I don't really like generating classes very much, we should be generating class *instances* instead, but the choice is again to stay backwards compatible with the existing API)
So, in all honesty, my opinion is still that ... well ... that abc serves no purpose and doesn't work, as harsh as it may sound.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
Gerrit-Change-Number: 39742
Gerrit-PatchSet: 18
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 22 Jan 2026 23:53:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Timur Davydov has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41921?usp=email )
Change subject: core: guard SCTP include in osmo_io_internal.h
......................................................................
core: guard SCTP include in osmo_io_internal.h
Include <netinet/sctp.h> only when libsctp support is available.
This avoids pulling in SCTP-specific headers on builds where libsctp is
disabled or unavailable, while keeping the internal header usable across
all configurations.
No functional changes intended.
Change-Id: Icd626d908192a954d55d76a46d7cc863ed332631
---
M src/core/osmo_io_internal.h
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/41921/1
diff --git a/src/core/osmo_io_internal.h b/src/core/osmo_io_internal.h
index f425da2..727f617 100644
--- a/src/core/osmo_io_internal.h
+++ b/src/core/osmo_io_internal.h
@@ -2,9 +2,13 @@
#pragma once
+#include "../config.h"
+
#include <unistd.h>
#include <stdbool.h>
+#ifdef HAVE_LIBSCTP
#include <netinet/sctp.h>
+#endif
#include <osmocom/core/osmo_io.h>
#include <osmocom/core/linuxlist.h>
@@ -12,8 +16,6 @@
#include <osmocom/core/select.h>
#include <osmocom/core/socket.h>
-#include "../config.h"
-
#define OSMO_IO_DEFAULT_MSGB_SIZE 1024
#define OSMO_IO_DEFAULT_MSGB_HEADROOM 128
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41921?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icd626d908192a954d55d76a46d7cc863ed332631
Gerrit-Change-Number: 41921
Gerrit-PatchSet: 1
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>