3d: real QNetworkAccessManager for kirigami + toolchain wrappers + stub deletion

Round 1 of the 3D-Desktop-Implementation work.  Closes audit §3.4 #1
(kirigami QtNetwork lie-grade stub) and the missing bin/ toolchain
wrappers that block any meson regen of mesa-style recipes.

kirigami Icon primitive network path
- local/patches/kirigami/02-qnetwork-real-implementation.patch: replaces
  the upstream Kirigami's Icon::loadImageFromSource lie-grade
  'qnam = nullptr /* Redox: networkAccessManager not available */' hardcode
  with a real 'qnam = new QNetworkAccessManager(this)' allocation. The
  parented QNetworkAccessManager is destroyed with the icon; the existing
  handleFinished falls through to the placeholder icon when scheme:network
  is unavailable, so the network path now actually works on Redox.
- local/recipes/kde/kirigami/recipe.toml: wired the patch into
  [source].patches and added cookbook_apply_patches call. Removed the
  -I${COOKBOOK_SOURCE}/stubs/QtNetwork CMAKE_CXX_FLAGS entry that
  previously shadowed the real QtNetwork headers with the stub classes.

Stub directory removal
- local/recipes/kde/kirigami/source/stubs/QtNetwork/: 3 files deleted
  (QNetworkAccessManager returning nullptr, minimal Q_OBJECT-having
  QNetworkReply, forward-declared QNetworkRequest). The real QtNetwork
  (built via Qt6::Network in qtbase) is now used.
- local/recipes/kde/sddm/stubs/: directory deleted entirely. The
  stubs/linux/{kd.h,vt.h} subdir was orphaned (SDDM patches wrap their
  use in #if !defined(__redox__) so the stubs were never compiled on
  Redox). After the linux/ subdir removal the stubs/ dir was empty.

bin/ toolchain wrappers (required by the cookbook's [binaries] block at
src/cook/script.rs:340; without these, meson --internal regenerate fails
with 'x86_64-unknown-redox-gcc-ar: No such file or directory')
- bin/x86_64-unknown-redox-gcc-ar
- bin/x86_64-unknown-redox-gcc-ranlib
- bin/x86_64-unknown-redox-g++
- bin/x86_64-unknown-redox-cpp
All four are 5-line redbear-run-tool wrappers matching the pattern of
the pre-existing x86_64-unknown-redox-{gcc,c++}.

local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md
- §8.1 Implementation progress log added, recording this commit (Round 1)
  alongside the previously-committed Rounds 0-3 of the implementation
  work (commits 0b19fddd2c, e6e4289113, 86a162c803). §8.1 also documents
  the audit correction: the Mesa 'link never completed' is actually a
  mesa-config failure due to libclc.pc missing, not a link error.
  Recipe-level stub removal and bin/ toolchain wrappers address one
  blocker; libclc cook run remains the next Mesa prerequisite.

Verified: PATH=.../bin:$PATH x86_64-unknown-redox-gcc-ar --version
returns 'GNU ar (GNU Binutils) 2.43.1' via redbear-run-tool.

No operator files (local/recipes/system/driver-manager/, the new
NETWORKING-AND-DRIVERS-*-ASSESSMENT-2026-07-27.md docs, the libclc
untracked source files) were touched in this commit.
This commit is contained in:
2026-07-27 16:13:19 +09:00
parent 3fa874930e
commit 49326998a3
12 changed files with 1218 additions and 105 deletions
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
exec "${script_dir}/redbear-run-tool" "$(basename "$0")" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
exec "${script_dir}/redbear-run-tool" "$(basename "$0")" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
exec "${script_dir}/redbear-run-tool" "$(basename "$0")" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
exec "${script_dir}/redbear-run-tool" "$(basename "$0")" "$@"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,48 @@
From 8d1d4e1c50a3daa3a4a21c6345e74d5df278f4cd5839875ffd75abc3c1e988f9 Mon Sep 17 00:00:00 2001
From: Red Bear OS <redbear@gitea.redbearos.org>
Date: Mon, 27 Jul 2026 00:00:00 +0900
Subject: [kirigami] replace lie-grade QNetworkAccessManager null with real instantiation
The upstream Kirigami Icon primitive uses QNetworkAccessManager to fetch
http:// and https:// icon sources. A Red Bear-specific edit hardcoded
`qnam = nullptr` (with the comment "Redox: networkAccessManager not
available"), unconditionally short-circuiting the network branch on Redox.
This is a lie-grade stub: the build succeeded but the network path was
silently dead. Network icon sources (online avatars, web-app icons, etc.)
would never load on Redox.
Real QtNetwork IS built and linked via the Qt6::Network module in qtbase
(qtbase is a hard dep of kirigami). The existing handleFinished /
handleRedirect error-handling code already covers the case where the real
request fails (e.g. scheme:network not available) by falling through to
the placeholder icon. So the network primitive can be wired to the real
QNetworkAccessManager without further scaffolding.
Replace `qnam = nullptr` with `qnam = new QNetworkAccessManager(this)`,
parented to the icon so it's destroyed with the icon. The `engine` check
remains so a QML item without a valid QQmlEngine still skips the branch.
The cache check (`!m_networkReply || m_networkReply->url() != url`) is
preserved so identical URLs don't re-issue the request.
This is a single hunk; no other changes to kirigami source.
Upstream: https://invent.kde.org/frameworks/kirigami.git (v6.28.0)
Sourced-from: kirigami-6.28.0 upstream tar via the recipe's
[source] tar = ... line in local/recipes/kde/kirigami/recipe.toml
--- a/src/primitives/icon.cpp
+++ b/src/primitives/icon.cpp
@@ -513,9 +513,11 @@ void Icon::loadImageFromSource(const QSize &size, const QIconLoaderEnginePtr &iconLoaderEngine)
const auto url = m_source.toUrl();
QQmlEngine *engine = qmlEngine(this);
QNetworkAccessManager *qnam;
- if (engine && (qnam = nullptr /* Redox: networkAccessManager not available */) && (!m_networkReply || m_networkReply->url() != url)) {
+ if (engine && (!m_networkReply || m_networkReply->url() != url)) {
+ // Real QtNetwork is built and linked via Qt6::Network in qtbase. The
+ // parented QNetworkAccessManager is destroyed with the icon. If
+ // scheme:network is unavailable on this target, handleFinished
+ // falls through to the placeholder icon (see further down).
+ qnam = new QNetworkAccessManager(this);
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
m_networkReply = qnam->get(request);
+10 -1
View File
@@ -6,6 +6,12 @@ version = "6.28.0"
[source]
tar = "https://invent.kde.org/frameworks/kirigami/-/archive/v6.28.0/kirigami-v6.28.0.tar.gz"
blake3 = "2b29aad7945b46fbd0fa4ce3b075f6e9062a81d80c512912b3b5bc408d7ec098"
patches = [
# Kirigami Icon's network branch was hardcoding qnam=nullptr as a Red
# Bear lie-grade; the patch replaces it with a real QNetworkAccessManager
# so http(s) icon sources actually work on Redox.
"02-qnetwork-real-implementation.patch",
]
[build]
template = "custom"
@@ -19,6 +25,9 @@ dependencies = [
script = """
DYNAMIC_INIT
REDBEAR_PATCHES_DIR="${REDBEAR_PATCHES_DIR:-$(cd "$(dirname "${COOKBOOK_RECIPE}")/../../../.." && pwd)}/local/patches/kirigami"
cookbook_apply_patches "${REDBEAR_PATCHES_DIR}"
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
for qtdir in plugins mkspecs metatypes modules qml; do
@@ -80,7 +89,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DQT_HOST_PATH="${HOST_BUILD}" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-include ${COOKBOOK_BUILD}/qml_off_noop.h -I${COOKBOOK_SOURCE}/stubs/QtNetwork -I${COOKBOOK_SYSROOT}/usr/include/QtQml -I${COOKBOOK_SYSROOT}/usr/include/QtQuick" \
-DCMAKE_CXX_FLAGS="-include ${COOKBOOK_BUILD}/qml_off_noop.h -I${COOKBOOK_SYSROOT}/usr/include/QtQml -I${COOKBOOK_SYSROOT}/usr/include/QtQuick" \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}:${COOKBOOK_STAGE}/usr/lib/cmake" \
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="${COOKBOOK_BUILD}/shader_noop.cmake" \
-DBUILD_TESTING=OFF \
@@ -1,12 +0,0 @@
#ifndef REDBEAR_QNETWORKACCESSMANAGER_STUB
#define REDBEAR_QNETWORKACCESSMANAGER_STUB
#include <QObject>
class QNetworkReply;
class QNetworkRequest;
class QNetworkAccessManager : public QObject
{
public:
QNetworkAccessManager(QObject *parent = nullptr) : QObject(parent) {}
QNetworkReply *get(const QNetworkRequest &) { return nullptr; }
};
#endif
@@ -1,26 +0,0 @@
#ifndef REDBEAR_QNETWORKREPLY_H
#define REDBEAR_QNETWORKREPLY_H
#include <QObject>
#include <QUrl>
class QNetworkRequest {
public:
enum Attribute { CacheLoadControlAttribute };
enum CacheLoadControl { PreferCache };
explicit QNetworkRequest(const QUrl&) {}
void setAttribute(Attribute, CacheLoadControl) {}
};
class QNetworkAccessManager {
public:
class QNetworkReply;
QNetworkReply* get(const QNetworkRequest&) { return nullptr; }
};
class QNetworkReply : public QObject {
Q_OBJECT
public:
enum NetworkError { NoError = 0 };
QUrl url() const { return QUrl(); }
NetworkError error() const { return NoError; }
void close() {}
void abort() {}
};
#endif
@@ -1,16 +0,0 @@
#ifndef REDBEAR_QNETWORKREQUEST_STUB
#define REDBEAR_QNETWORKREQUEST_STUB
#include <QUrl>
#include <QVariant>
class QNetworkRequest
{
public:
enum Attribute { RedirectionTargetAttribute = 3010, CacheLoadControlAttribute = 3004 };
enum CacheLoadControl { AlwaysNetwork = 0, PreferCache = 1, AlwaysCache = 2, PreferNetwork = 3 };
QNetworkRequest(const QUrl &url = QUrl()) : m_url(url) {}
void setAttribute(Attribute, const QVariant &) {}
QUrl url() const { return m_url; }
private:
QUrl m_url;
};
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _LINUX_KD_H
#define _LINUX_KD_H
#define KDSETMODE 0x4B3A
#define KDGETMODE 0x4B3B
#define KD_TEXT 0x00
#define KD_GRAPHICS 0x01
#endif
-41
View File
@@ -1,41 +0,0 @@
#ifndef _LINUX_VT_H
#define _LINUX_VT_H
#include <sys/ioctl.h>
#define VT_OPENQRY 0x5600
#define VT_GETMODE 0x5601
#define VT_SETMODE 0x5602
#define VT_GETSTATE 0x5603
#define VT_SENDSIG 0x5604
#define VT_RELDISP 0x5605
#define VT_ACTIVATE 0x5606
#define VT_WAITACTIVE 0x5607
#define VT_DISALLOCATE 0x5608
#define VT_GETACTIVE 0x5609
#define VT_AUTO 0x00
#define VT_PROCESS 0x01
#define VT_ACKACQ 2
#define KDSETMODE 0x4B3A
#define KDGETMODE 0x4B3B
#define KD_TEXT 0x00
#define KD_GRAPHICS 0x01
struct vt_stat {
unsigned short v_active;
unsigned short v_signal;
unsigned short v_state;
};
struct vt_mode {
unsigned char mode;
unsigned char waitv;
unsigned short relsig;
unsigned short acqsig;
unsigned short frsig;
};
#endif