nuttx-apps/interpreters/python/patch/0018-ignore-chmod-on-nuttx-like-wasi.patch
Tiago Medicci 8ba84edb0a interpreters/python: Enable using pip to install Python packages
This commit enables using `pip` as a pre-compiled (pyc) built-in
distributed along with cpython.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-18 15:08:30 -04:00

25 lines
875 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tiago Medicci <tiago.medicci@espressif.com>
Date: Thu, 7 May 2026 14:00:00 -0300
Subject: [PATCH] posixmodule: ignore chmod on NuttX like WASI
NuttX's tmpfs does not implement chstat, so chmod fails with ENOSYS.
Apply the same workaround already used for WASI: silently succeed
when HAVE_CHMOD is not defined.
---
Modules/posixmodule.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3608,8 +3608,8 @@
#ifdef HAVE_CHMOD
result = chmod(path->narrow, mode);
-#elif defined(__wasi__)
- // WASI SDK 15.0 does not support chmod.
+#elif defined(__wasi__) || defined(__NuttX__)
+ // WASI SDK 15.0 and NuttX do not fully support chmod.
// Ignore missing syscall for now.
result = 0;
#else