Commit Graph

310 Commits

Author SHA1 Message Date
vasilito bf05bf1123 x11: promote libxkbfile; clear build dirs stranded by the wip move
kcms/keyboard links X11::xkbfile (CMakeLists.txt:37) and cmake aborted with
"Target kded_keyboard links to X11::xkbfile but the target was not found".
libxkbfile was sitting in recipes/wip/x11; promoted, given its util-macros
dependency, and wired into plasma-desktop and the config.

Also clears 9 build directories stranded by the earlier `git mv` out of wip.
Autotools bakes the absolute srcdir into its generated Makefiles, so a moved
recipe keeps building against a path that no longer exists:
  No rule to make target
  '.../recipes/wip/x11/libxkbfile/source/src/cout.c', needed by 'cout.lo'
The cook-side auto-invalidation added earlier only inspects CMakeCache.txt, so
autotools recipes are not covered by it -- these were latent failures that
would have surfaced one package at a time (libx11, libxcb, libxdmcp, libxft,
libxrender, x11proto, x11proto-kb, xcb-proto, xtrans).

Verified: cook libxkbfile - successful, libxkbfile.a staged.
2026-08-05 02:24:19 +03:00
vasilito ab9ccae80f xcb-util-image: build for Redox; search recipe sysroot for autoconf macros
Three separate defects, one per class:

1. script.rs passed autoreconf only -I${COOKBOOK_HOST_SYSROOT}/share/aclocal, so
   macros installed by a DEPENDENCY into the per-recipe sysroot were invisible.
   util-macros was built and declared as a dependency, yet configure still said
     configure.ac:10: error: must install xorg-macros 1.16.0 or later
   Now also searches ${COOKBOOK_SYSROOT}/usr/share/aclocal and exports
   ACLOCAL_PATH. Fixed generically -- every autotools recipe benefits.

2. Upstream builds test/test_xcb_image_shm unconditionally (Makefile.am:15
   SUBDIRS = image test) and it needs SysV shared memory, which Redox lacks.
   The library itself does not: configure only probes sys/shm.h and adapts. So
   dropping test/ removes a test binary, not functionality.

3. libxcb is a STATIC archive here, so its libXau/libXdmcp dependencies do not
   propagate to consumers as a shared library's DT_NEEDED would:
     xcb_auth.c: undefined reference to `XauGetBestAuthByAddr'
   Named them via LIBS, not LDFLAGS: autoconf emits LDFLAGS BEFORE the objects
   and LIBS AFTER, and a static archive only satisfies symbols referenced by
   objects preceding it. With -lXau in LDFLAGS the link still failed while
   libXau.a sat in the sysroot. Same ordering rule as -lgcc in
   redox-toolchain.cmake and -licudata in plasma-workspace -- third occurrence.

Verified: cook xcb-util-image - successful, libxcb-image.a staged.
2026-08-05 00:52:14 +03:00
vasilito a55e1d6bd9 x11: add util-macros; xcb-util needs it to autoreconf
xcb-util and xcb-util-image start configure.ac with XORG_MACROS_VERSION(), so
autoreconf dies before configure runs:
  configure.ac:10: error: must install xorg-macros 1.16.0 or later before
  running autoconf/autogen
libice failed identically earlier -- it was dropped as unnecessary, but
xcb-util-image is genuinely required (plasma-desktop needs the XCB IMAGE
component), so the macros had to be ported rather than routed around.

util-macros ships only autoconf m4 text and a pkg-config file -- no compiled
code, so no cross-compilation concern. Installed into the sysroot's
share/aclocal, which is already the directory the cookbook passes to
autoreconf (-I .../sysroot//share/aclocal), so consumers need no other change.

Verified by cooking it standalone before wiring it in: builds successfully and
stages usr/share/aclocal/xorg-macros.m4. The recipe asserts that file exists,
since a silent no-op would resurface as the same "must install xorg-macros"
error in a consumer, far from the cause.
2026-08-04 23:30:09 +03:00
vasilito 68b3916eb1 plasma-desktop: provide XCB with SHM and IMAGE components
plasma-desktop's CMakeLists.txt:223 does
  find_package(XCB REQUIRED COMPONENTS XCB SHM IMAGE)
and configure aborted with "Could NOT find XCB (missing: XCB_LIBRARIES XCB SHM
IMAGE)" -- libxcb was promoted but plasma-desktop did not depend on it, so it
was absent from that recipe's sysroot.

libxcb supplies xcb and xcb-shm (libxcb-shm.a confirmed staged); IMAGE comes
from xcb-util-image, which needs xcb-util. Both promoted out of recipes/wip/x11
and their tarballs fetched and blake3-verified.

This is the case for xcb on Wayland, not X11 nostalgia: KDE's XWayland
integration and Qt's xcb platform plugin both reference these.
2026-08-04 23:23:03 +03:00
vasilito 218a1f86b0 x11: promote the xcb/X11 client stack out of wip and wire it into redbear-full
Reverses this session's approach. Gating X11 out kept producing failures in a
new syntactic shape each build -- API calls, else-chains, standalone statements,
inert #ifdef guards, bare X11/xcb includes, namespace definitions -- six shapes,
each needing its own rule in gate-kx11extras.py. Providing the real headers and
libraries removes the cause rather than adding a seventh rule.

The stack was already ported and building; it was just parked in recipes/wip.
Verified before promoting: xcb-proto, libxcb, libx11, x11proto and xtrans cook
(cached from earlier builds), libxrender and libxft built successfully, and the
key headers are staged -- xcb/xcb.h, X11/Xlib.h, X11/Xft/Xft.h -- with 25 libs
and 33 headers from libxcb alone. Real upstream releases pinned by blake3
(libxcb 1.17.0, libX11 1.8.12), not stubs.

Promoted: x11proto-kb, xtrans, xcb-proto, libxcb, libx11, libxdmcp, libxext,
libxfixes, libxi, libxrender, libxft, libice, libsm (recipes/x11/) and
libpthread-stubs (recipes/libs/). x11proto was already in the config.

xcb is needed on Wayland too -- Qt's xcb platform plugin, libxkbcommon-x11 and
KDE's XWayland integration all reference it -- so this is not X11-only value.
These remain CLIENT libraries: isPlatformX11() stays false at runtime and the
X11 paths do not execute unless Xwayland is up. The port buys compilation
compatibility, not X11 functionality.
2026-08-04 21:50:13 +03:00
vasilito 221a91cba4 build: port libcanberra, gate X11-only KWindowSystem APIs, build out of tree
libcanberra: plasma-workspace calls find_package(Canberra) TYPE REQUIRED and
includes <canberra.h> from four translation units with no HAVE_CANBERRA guard,
one of them libnotificationmanager (the core notification library). It cannot
be made optional, so it is ported for real. Built shared: it dlopens its
backend through libltdl, the libtool recipe stages libltdl.so only (no .a), so
a static build left every consumer with an undefined lt_dlopenext.

Audio is SILENT. Upstream 0.30 offers alsa/oss/pulse/gstreamer/null and none
speak Redox; the pulse driver needs PulseAudio's client library, which PipeWire
does not provide. The null driver is real upstream code, so the API/ABI is
genuine and all consumers work -- but nothing reaches the speakers until a
native /scheme/audio driver exists.

KX11Extras et al: gate the five X11-only KWindowSystem headers behind the
HAVE_X11 that plasma-workspace already defines. X11 is compiled OUT, not added.
gate-kx11extras.py brace-matches each block and keeps any trailing else outside
the guard, since wrapping a whole if/else-if chain yields invalid C++.

check-recipe-escapes.py: a single backslash in a TOML multi-line string is a
TOML escape, so a sed written as \bFoo\b parses to <BS>Foo<BS> and silently
matches nothing -- no TOML error, no sed error. This class bit the tree three
times. Now gated in preflight; it also found openssh, which used an invalid \$
and could not be parsed by any compliant parser.

cook_build.rs: build git-tracked vendored sources OUT OF TREE. Recipe scripts
rewrite their source, so builds were mutating version-controlled files: a
no-op sed became indistinguishable from a working one, and the integrity gate
fired so often that clearing it stopped being protective. Uses
cp -a --reflink=auto, not cp -al: sed -i is link-safe but `cp -f` and `>`
truncate in place and would write through a hard link into the tracked
original. Content hashing still runs against the pristine tree, so hashes now
describe committed state. Escape hatch: REDBEAR_IN_TREE_BUILD=1.
2026-08-04 16:41:39 +03:00
vasilito 45696b918b git: re-port git.patch onto 2.55.0
The patch was written against git 2.13.1 (2017) while the recipe fetches
2.55.0 — eight years of drift, seven of eight files rejecting. Rebased by
applying what still fit, hand-porting every reject against the current
source, and regenerating the whole patch from a pristine-vs-ported diff so
it is a coherent 2.55.0 patch rather than a 2.13 patch with fixups.

Per file, preserving the original Redox intent:
  compat/bswap.h      <machine/endian.h> for ntohl/htonl
  compat/terminal.c   __redox__ git_terminal_prompt branch; the file was
                      restructured, so it now precedes the generic #else
  configure           NO_IPV6=YesPlease
  daemon.c            logreport is a switch over LOG_DESTINATION_* in
                      2.55.0; guard the syslog arm and openlog instead of
                      the old if/else
  git-compat-util.h   SIG_DFL/SIG_IGN/SIG_ERR fallbacks
  Makefile            EXTLIBS=-lnghttp2; drop the three hardlink fallbacks
  run-command.c       dup_devnull is gone in 2.55.0; the four /dev/null
                      opens it replaced now use DEV_NULL directly
  setup.c             sanitize_stdfds uses xopen/xdup, which die
                      internally, so the old die_errno hunk is obsolete

Applies at --fuzz=0 with zero rejects across all eight files.

Also ac_cv_iconv_omits_bom=no: the 'iconv omits bom for utf-16 and
utf-32' probe is a RUN test and cannot execute while cross compiling.
Same mechanism as the neighbouring ac_cv_fread_reads_directories and
ac_cv_snprintf_returns_bogus entries.

One trap worth recording: a blanket '*.orig' cleanup before regenerating
the diff silently deleted t/t4256/1/mailinfo.c.orig, a real git test
fixture, which would have shipped as a deletion in the patch. Restored.
2026-08-03 20:16:12 +03:00
vasilito 22f8849007 git: rebase the setup.c hunks onto 2.55.0 (patch still needs a full re-port)
git.patch is written against git 2.13.1 (2017); the recipe fetches 2.55.0.
The setup.c hunks were the first to fail, so the build stopped there.

Rebased them. 2.55.0 rewrote sanitize_stdfds() to use xopen/xdup, which
die internally, so the old die_errno hunk is obsolete and the rebase is
smaller than the original:
  - xopen("/dev/null", O_RDWR) -> xopen(DEV_NULL, O_RDWR)
  - #if !defined(__redox__) around setsid()
Both preserve the original Redox intent: scheme paths instead of
/dev/null, and no setsid() on Redox.

This does NOT make git build. With setup.c applying, the patch runs
further and six more files turn out to have drifted over the same eight
years:

    compat/bswap.h        1/1 hunk
    compat/terminal.c     1/1
    configure             1/1
    daemon.c              2/4
    git-compat-util.h     1/2
    Makefile              1/1
    run-command.c         1/1

git-compat-util.h matters most: it is where DEV_NULL is defined, so the
setup.c change above depends on that hunk being re-ported too.

An eight-year, 2.13 -> 2.55 span is a re-port, not a hunk rebase, and
PATCH-GOVERNANCE.md is explicit that the patch is rebased rather than
dropped. Committing this piece so it is not lost and the remaining scope
is written down.
2026-08-03 20:09:10 +03:00
vasilito 93a0433770 gcc13: three real GCC-16-as-bootstrap fixes; blocked on a compiler ICE
Three defects found and fixed, each verified to go to zero:

1. libcody C++ standard. Its configure contains
       #if __cplusplus > 201103
       #error "C++11 is required"
   so anything newer than C++11 is rejected outright. My earlier
   -std=gnu++17 tripped exactly this -- the 'C++11 is required' failure
   came from build/libcody/config.log, not from a missing libstdc++ as
   the previous commit assumed. C++11 also fixes the original problem:
   char8_t arrived in C++20, so under C++11 u8"" is still const char[].
   char8_t diagnostics: 100+ -> 0.

2. libcody is compiled by the CROSS compiler, not the host one --
       x86_64-unknown-redox-g++ ... -c -o buffer.o .../libcody/buffer.cc
   because --host is the Redox target. So plain CXXFLAGS is the right
   knob, scoped to this branch; the freestanding branch must keep the
   compiler defaults.

3. libgcc's cpuinfo.c needs CPUID bit macros from <cpuid.h>. Built by
   GCC 16 that resolves to GCC 16's header, and GCC 15/16 REMOVED the
   macros for the withdrawn AVX512PF/ER/4VNNIW/4FMAPS and PREFETCHWT1
   extensions. GCC 13 ships its own cpuid.h that still defines them, so
   its config dir now precedes the toolchain include path for target
   compiles. Undeclared-bit errors: 5 -> 0.

BLOCKED, and not by a flag. GCC 16 now ICEs compiling GCC 13's own
libstdc++:

    libstdc++-v3/libsupc++/eh_call.cc:39:1: internal compiler error:
    in gimple_build_eh_must_not_throw

Each fix has revealed the next incompatibility; an ICE is where
flag-tweaking stops being the answer. Building GCC 13 with GCC 16 is
three major versions of drift and is not a supported configuration.

The coherent fix is to move gcc-native onto GCC 16, which is the whole
point of the port in local/patches/gcc-redox-port/ -- local/recipes/dev/
gcc16/source is already ported and is what produced the working cross
toolchain. That is an operator-level decision, so it is not taken here.
2026-08-03 18:50:01 +03:00
vasilito deca6a6820 gcc13: scope -std=gnu++17 to the target branch (char8_t fixed; probe still open)
libcody is compiled by the CROSS compiler, not the host one -- the build
log shows
    x86_64-unknown-redox-g++ ... -c -o buffer.o .../libcody/buffer.cc
because --host is the Redox target. So plain CXXFLAGS is the right knob,
not CXXFLAGS_FOR_BUILD as the previous commit assumed. Scoped to the
gcc-native branch only.

Verified: char8_t errors go 100+ -> 0.

STILL OPEN. With CXXFLAGS set, the top-level configure now fails its
build-side probe:
    checking whether gcc accepts -g... no
    configure: error: C++11 is required
The two states are exclusive as things stand:
  - CXXFLAGS carrying -std=gnu++17  -> char8_t fixed, C++11 probe fails
  - CXXFLAGS without it             -> probe passes, char8_t fails
so something in the exported CXXFLAGS is unacceptable to the HOST gcc
that configure probes (the cookbook adds -fno-hardened -DHAVE_ALLOCA_H=1
-fPIC alongside a target -I). The recipe unsets CFLAGS/CPPFLAGS/LDFLAGS
for this branch but leaves CXXFLAGS set, which is the likely culprit --
the next step is to give the build-side compiler its own clean flags
rather than inheriting the target's.
2026-08-03 18:31:03 +03:00
vasilito 88b4d06ec2 libc: vendor a Redox-complete fork for waitid/CLD_*/P_*
local/sources/libc is libc 0.2.189 with src/unix/redox/mod.rs extended to
expose the waitid surface relibc already implements:

  - idtype_t (= c_int, as relibc defines it)
  - P_ALL / P_PID / P_PGID
  - CLD_EXITED / KILLED / DUMPED / TRAPPED / STOPPED / CONTINUED
  - extern fn waitid(idtype_t, id_t, *mut siginfo_t, c_int) -> c_int

All of it is real in relibc -- src/header/sys_wait/mod.rs defines the
types and constants, and `nm libc.a` shows `T waitid` -- but the libc
crate's Redox bindings never exposed any of it, and still do not as of
0.2.189. Any crate calling waitid therefore cannot build for
x86_64-unknown-redox:

  error[E0531]: cannot find unit struct, unit variant or constant
                `CLD_EXITED` in crate `libc`

which breaks nix, and through it ctrlc and rustc's bootstrap tooling --
the last thing blocking rust-native.

Values and types come from relibc, not from Linux. Every non-Redox target
is byte-for-byte upstream 0.2.189, so host builds are unaffected. Wired
into the rust workspace via [patch.crates-io]; the fork type-checks for
x86_64-unknown-redox.

Upstream-reportable: this gap belongs in the libc crate.
2026-08-03 18:02:32 +03:00
vasilito 8218c3f5d1 gcc13: scope -std=gnu++17 to the build-side compiler only
Putting it in plain CXXFLAGS also handed it to the Redox cross g++, whose
C++ probe then failed during the freestanding stage, before libstdc++
exists:

    configure: error: C++11 is required

libcody -- where the char8_t failures occur -- is compiled by
CXX_FOR_BUILD (the host g++ 16), so CXXFLAGS_FOR_BUILD is the correct
knob and the cross compiler is left alone.
2026-08-03 17:44:19 +03:00
vasilito c7bca65088 gcc13, rust: fix C++20 char8_t and the nix/libc type mismatch
gcc13
  The host compiler is now GCC 16, which defaults to C++20
  (__cplusplus 202002L). C++20 changed u8"" literals from const char[] to
  const char8_t[], and GCC 13's libcody -- its module mapper -- uses them
  throughout, so the build collapsed with ~100 diagnostics like
      error: invalid conversion from 'const char8_t*' to 'const char*'
  in libcody/{buffer,client,server}.cc. GCC 13's sources are C++17; build
  them at that standard. Not a workaround -- it is the dialect this
  release was written against.

rust / rust-native
  nix 0.30.1 is incompatible with the resolved libc 0.2.178: it declares
  type SaFlags_t = libc::c_ulong while libc now has sigaction.sa_flags and
  the SA_* constants as c_int, so rustc's bootstrap tooling failed with
      error[E0308]: expected `u64`, found `i32`  nix/src/macros.rs:72
      error[E0308]: expected `i32`, found `u64`  nix/src/sys/signal.rs:808
  nix 0.31 fixed it by flipping the default to c_int. ctrlc moves itself
  (3.5 requires nix "0.31"), but in-tree miri pinned 0.30.1 and kept the
  broken version in the graph, so both are moved forward -- update and
  adapt rather than pinning libc back, per the
  Most-recent-upstream-when-building rule. Both crates were already in the
  offline registry cache.

These surfaced only because gcc-native/rust-native were restored to the
config; neither had been building.
2026-08-03 17:12:16 +03:00
vasilito af03420bcc libpng, zsh: two more GCC 14+ strictness regressions
libpng
  contrib/libtests/pngvalid.c calls feenableexcept(), a glibc extension
  relibc does not provide, and GCC 14+ makes the implicit declaration an
  error. It is a test program, so build it the way AGENTS.md
  § CONVENTIONS already prescribes for cross builds -- '--disable-tests'.
  The library is unaffected; only check_PROGRAMS is skipped, and those
  binaries cannot run on the build host regardless.

zsh
  zsh 5.9 probes for the termcap symbol arrays with
      char **test = boolcodes; puts(*test);
  and ncurses declares boolcodes as 'const char * const *'. GCC 14
  promoted -Wincompatible-pointer-types to an error, so the probe stopped
  compiling, configure concluded boolcodes=no, HAVE_BOOLCODES was left
  undefined, and Src/Modules/termcap.c fell back to defining its own
  array -- colliding with the header:
      termcap.c:45: error: conflicting types for 'boolcodes'
  The probe uses a bare shell variable, not an ac_cv_ cache entry, so
  there is nothing to override; restoring the pre-GCC-14 severity is what
  lets it reach the right answer. Scoped to this recipe so the rest of the
  tree keeps the stricter default.

Both cook clean.
2026-08-03 16:15:17 +03:00
vasilito d55deaa420 build: declare HAVE_ALLOCA_H; route netutils through the local forks
uutils / onig_sys
  oniguruma guards its alloca.h include on the autoconf macro:
      #if defined(HAVE_ALLOCA_H)
      # include <alloca.h>
      #endif
  onig_sys is compiled by the `cc` crate, so no configure ever runs and
  nothing defines it. Under GCC 14+ the resulting implicit declaration is
  an error, so uutils failed at
      regint.h:271: error: implicit declaration of function 'alloca'
  relibc does ship <alloca.h>, so declare it in the cookbook's C flags.
  This asserts a fact about the sysroot rather than silencing a warning,
  and is what a cross-build environment is expected to supply for sources
  that have no configure step. Packages whose own configure defines it to
  1 are unaffected -- identical redefinitions are not diagnosed.

netutils
  Declares `libredox = "0.1"`, a version string, so cargo resolved
  libredox and its transitive redox_syscall from crates.io instead of the
  forks. With the forks now at 0.1.19 / 0.9.1 the crates.io side is not in
  the offline cache and the build died with
      failed to download `redox_syscall v0.9.0`
      Caused by: attempting to make an HTTP request, but --offline was
      specified
  local/AGENTS.md 'Local fork dependency rule (ABSOLUTE)' prohibits
  version strings for crates that have a local fork, for exactly this
  reason -- a second copy of the crate in the graph gives mismatched
  types, and offline builds cannot resolve it at all. [patch.crates-io]
  now redirects the direct and transitive resolutions onto the forks.

Both cook clean.
2026-08-03 16:03:17 +03:00
vasilito 893f98a2cf build: cancel -fhardened; fix termcap for GCC 16; regenerate pam-redbear lock
Three GCC 16 gaps found by the redbear-full build.

-fhardened (seatd and other meson recipes, 24 errors)
  -fhardened is a host-glibc hardening bundle x86_64-unknown-redox cannot
  implement, but GCC accepts it on the command line, so meson's
  cc.has_argument('-fhardened') probe answers YES and meson adds it to
  every compile. GCC then refuses it for real:
    cc1: error: '-fhardened' not supported for this target [-Werror]
  Note the tag is [-Werror], not [-Werror=hardened] -- it is an
  unconditional warning, so -Wno-hardened does not silence it (tried, and
  it did not). The flag has to be cancelled instead; -fno-hardened does
  that cleanly and the cookbook's flags are appended after the project's
  own, so it wins. Nothing is weakened: the compiler is telling us the
  option is inert on this target.

termcap (two independent defects, both latent until now)
  1. Makefile.in hardcoded 'CFLAGS = -g' and has no @CFLAGS@ substitution
     at all, so nothing configure resolved ever reached the compiler --
     including the toolchain's default C dialect. termcap is pre-ANSI
     code, so being compiled as GCC 16's default C23 failed at once with
     'too many arguments to function malloc; expected 0, have 1'.
     Substituting @CFLAGS@ is what a normal autotools Makefile.in does.
  2. With CFLAGS flowing, the remaining errors were implicit declarations
     of strlen/memcpy/exit/write, which GCC 14+ makes errors regardless of
     -std. Cause: autoconf 2.70+ removed AC_HEADER_STDC, so STDC_HEADERS
     is never defined and termcap.c/tparam.c took their pre-ANSI branch,
     declaring 'char *malloc ();' instead of including <stdlib.h>.
     Autoconf's guidance on dropping AC_HEADER_STDC is to assume those
     headers exist, which holds for every target Red Bear builds.

pam-redbear
  Cargo.lock missed by the earlier sweep; regenerated for the 0.3.2 fork
  versions.

termcap and seatd now cook clean.
2026-08-03 15:32:29 +03:00
vasilito e3aa90b0f5 gettext: use relibc's error() instead of gnulib's replacement
gettext failed to link against the GCC 16 toolchain with

  ld: libc.a(...rcgu.o):(.bss.error_message_count+0x0): multiple
      definition of `error_message_count'; libgrt.a(libgrt_a-error.o):
      first defined here

Root cause is a cross-compile artefact, not a compiler change. gnulib's
check for a working error() is a RUN test, so cross-compiling reports
'checking for working error function... guessing no' and turns on
GNULIB_REPLACE_ERROR. Two things then go wrong at once: consumers are
redirected to rpl_error, and gnulib's own error.c -- listed in
am__objects_5 with no GL_COND_OBJ_ERROR guard -- still defines the
unrenamed error_* globals, which collide with relibc's.

relibc genuinely implements error(), error_at_line() and all three
globals (verified with nm). Two coordinated fixes:

- gl_cv_func_working_error=yes in the recipe. Stating the answer a run
  test cannot reach while cross-compiling is the standard autoconf
  mechanism, and is exactly what the neighbouring ac_cv_/gt_cv_ entries
  already do for the same reason. Consumers now call relibc's error()
  and no rpl_error reference remains.

- Guard gnulib's error.c on HAVE_ERROR, which configure already defines
  as 1 -- upstream gnulib later made this module conditional on the
  system lacking error(); this snapshot computes the right answer and
  does not act on it. Without this the definitions still collide, since
  relibc is Rust and one codegen unit carries several symbols, so
  referencing any of them drags the whole object in. glibc escapes this
  only by giving each its own object file.

gettext cooks clean. Patch generated by diff, applies at --fuzz=0.
2026-08-03 15:02:36 +03:00
vasilito 393fa47cfe argp-standalone: include <alloca.h> under GCC (GCC 14+ / C23)
argp-parse.c and argp-help.c wrap the whole alloca-declaration block in
'#ifndef __GNUC__', so the header is never included when building with
GCC -- the code relied on GCC historically providing an implicit
declaration. GCC 14 promoted -Wimplicit-function-declaration to an error
and C23 removed implicit declarations, so the GCC 16 cross toolchain
fails:

  argp-parse.c:1227:36: error: implicit declaration of function 'alloca'
  argp-help.c:1329:35: error: implicit declaration of function 'alloca'

configure already sets HAVE_ALLOCA_H 1 and relibc's <alloca.h> defines
alloca(size) as __builtin_alloca(size), which is what GCC wants. Honour
HAVE_ALLOCA_H before consulting __GNUC__; non-GCC paths are untouched.

Patch generated by diff against pristine source, applies at --fuzz=0,
and the recipe cooks clean. Second opportunistic C23-era fix under the
gnu17 migration, after libiconv.
2026-08-03 14:17:59 +03:00
vasilito 48a924c561 recipes: regenerate Cargo.lock for the 0.3.2 fork versions
The libredox 0.1.19 / redox_syscall 0.9.1 bump left 45 recipe lockfiles
pinning libredox 0.1.18+rb0.3.1 and redox_syscall 0.9.0+rb0.3.1. The
cookbook builds with --locked, so every affected recipe died with

  error: cannot update the lock file .../Cargo.lock because --locked was
  passed to prevent this

which is what took out redox-driver-sys -- and with it every Red Bear
driver -- during the redbear-full build. Regenerating the fork lockfiles
was not enough; the recipes that consume the forks as path deps carry
their own. This is step 6 of local/docs/FORK-BUMP-PATCHING-POLICY.md
applied to the recipe layer.

Also drop the hardcoded GCC version in recipes/libs/libstdcxx-v3: the
literal include/c++/13.2.0 stopped resolving the moment the cross
toolchain moved to 16.1.0, leaving -I pointing at a directory that does
not exist. Now resolves the newest installed C++ header directory and
fails loudly if there is none. Same failure class as the hardcoded
13.2.0 in mk/prefix.mk.

Note: a few recipe-level Cargo.lock files (redox-driver-pci, cpufreqd,
redbear-acmd/-ecmd/-ftdi) sit beside a recipe.toml whose [source] is
path = "source", so they are not build inputs; redox-driver-pci's even
references a redox-driver-core/Cargo.toml that does not exist. They are
left alone rather than given meaning they do not have.

redox-driver-sys now cooks clean.
2026-08-03 14:15:38 +03:00
vasilito 63a458a610 build: track the libiconv C23 patch symlink
recipes/**/*.patch is gitignored, but 01_redox.patch is force-added and
tracked. Match that precedent so the patch wiring survives a clean
checkout -- recipe.toml lists it, so an untracked symlink would break
the build from scratch.
2026-08-03 12:51:44 +03:00
vasilito 0c0ee5810d build: default C to gnu17 for the GCC 16 toolchain; fix libiconv for C23
GCC 13.2.0 defaulted to gnu17 (__STDC_VERSION__ 201710L); GCC 16.1.0
defaults to gnu23 (202311L). The recipe tree is C17-era code, and C23
turns an empty parameter list from 'unspecified arguments' into 'no
arguments', which is a hard error against a real prototype.

Pin the cookbook's default C dialect to gnu17. This states the dialect
these sources were written against rather than suppressing a diagnostic,
and matches how the distributions handled the same GCC 14/15 transition.
Packages migrate to C23 as they are touched; the pin is dropped when the
tree is clean. A per-recipe -std= still wins, being appended after. C++
is deliberately NOT pinned -- kwin needs C++23, which is the entire point
of the GCC 16 upgrade.

Fix a real cookbook bug this exposed: CMAKE_CXX_FLAGS was built from
CFLAGS, so the C dialect flag reached the C++ compiler and g++ reported
"'-std=gnu17' is valid for C/ObjC but not for C++" on every file. The
meson path already keeps c_args/cpp_args apart; CMake now matches.
CPPFLAGS still reaches both, which is what carries the sysroot includes.

First opportunistic C23 fix: libiconv's lib/loop_wchar.h declared
'extern size_t mbrtowc ();', conflicting with relibc's four-argument
prototype. That declaration exists only for platforms whose <wchar.h>
does not declare mbrtowc -- per its own comment, BeOS, which lacks
mbstate_t and #defines it -- and the very next line already tests
'#ifdef mbstate_t'. Moving it inside that guard keeps it where it is
needed and drops it where a real prototype is in scope.

libiconv now cooks clean against GCC 16.1.0.
2026-08-03 12:51:31 +03:00
vasilito ef3f38da8b feat: port Vulkan headers and ICD loader; wire into kwin
KWin does an unconditional find_package(Vulkan REQUIRED), and CMake's
FindVulkan needs BOTH Vulkan_INCLUDE_DIR and Vulkan_LIBRARY. Mesa already
builds the Vulkan drivers (libvulkan_intel/_radeon/_lvp) but an ICD is not
the API surface a consumer links against, so kwin could not configure.

vulkan-headers: header-only, but VulkanHeadersConfig.cmake is GENERATED at
install time rather than shipped in the tarball, and Vulkan-Loader
hard-requires it -- a hand copy of include/ satisfies FindVulkan and then
fails the loader. Run upstream's cmake install instead.

vulkan-loader: one real port. vk_loader_platform.h gates the whole POSIX
arm (DIRECTORY_SYMBOL, the dlopen wrappers, manifest search) on an OS list
that predates Redox, so the build collapsed with 'DIRECTORY_SYMBOL'
undeclared. Redox provides dlopen/dlsym and POSIX paths via relibc, so it
belongs in the same arm as Linux; that header is the only file under
loader/ doing OS detection. WSI backends are left off: Red Bear is
Wayland-only and the compositor talks to Mesa's ICDs directly.

Both shadow the untested recipes/wip/libs/graphics/{vulkan-headers,
libvulkan} via the local-over-WIP mechanism, per the WIP ownership rule
that the shipping version lives in local/recipes/.

Verified: kwin now reports
  -- Found Vulkan: .../sysroot/lib/libvulkan.so (found version 1.4.321)

kwin also gains its missing kf6-knewstuff dep -- its
find_package(KF6 COMPONENTS NewStuff) is REQUIRED, so without the dep the
framework was never staged into kwin's sysroot.
2026-08-03 09:10:57 +03:00
vasilito 2622b426af kf6-kwallet: complete the crypto/secret chain — now builds
redbear-ci / check (push) Has been cancelled
Vendor libsecret 0.21.7 (org.freedesktop.secrets client lib, required by
kwalletd6's secretserviceclient.cpp) under the full-fork model; build it shared
against the static libgcrypt closure (custom template + unset COOKBOOK_DYNAMIC so
pkg-config --static pulls libgpg-error). Add it to kf6-kwallet deps.

Fixes to reach a full kwallet build:
- qca recipe: rewrite the exported Qca-qt6Targets.cmake to compute _IMPORT_PREFIX
  relative to the config-file location (QCA hardcoded an absolute /usr prefix +
  include dir, so cross consumers failed with 'imported target includes
  non-existent path /usr/include/Qca-qt6/QtCrypto').
- ksecretd/CMakeLists.txt: gate add_subdirectory(autotests) on BUILD_TESTING
  (upstream does not); the autotests need Qt6Test, unavailable for the cross
  target and never shipped.
- kwalletbackend blowfish.h + sha1.cc: include <stdint.h> on __redox__ (the cross
  check_include_files(stdint.h) misfired, leaving HAVE_STDINT_H unset -> uint32_t
  undeclared).
- cmake/FindLibGcrypt.cmake: append libgpg-error after libgcrypt (static-only on
  Redox, its gpg-error dep not pulled transitively -> undefined gpgrt_lock_*/
  gpg_strerror at link).

Gpgmepp stays optional (find_package without REQUIRED, all uses HAVE_GPGMEPP-
gated); GPG-key wallets are a secondary feature. kwalletd6 + ksecretd both build.
2026-08-02 05:34:41 +03:00
vasilito 7284eec11e libs: vendor qca (Qt Cryptographic Architecture, Qt6) for kf6-kwallet ksecretd
redbear-ci / check (push) Has been cancelled
kf6-kwallet's ksecretd daemon (the org.freedesktop.secrets Secret Service
provider) requires Qca-qt6 2.3.1. Vendor QCA 2.3.10 under the full-fork model
and build the gcrypt provider plugin (backed by the vendored libgcrypt) so QCA
has a working SymmetricCipher/Hash/PBKDF2 backend on Redox. External-toolkit
providers (ossl/nss/botan/gnupg/pkcs11/cyrus-sasl) are disabled — those
libraries are not part of the Redox userland; logger + softstore (pure-Qt) are
kept.

Source edit: the top-level Qt6 find_package required the Test component
unconditionally; gate it on BUILD_TESTS so a tools/tests-off build configures
without Qt6Test. Install via DESTDIR since QCA anchors its install dirs to the
absolute Qt prefix (/usr), which ignores cmake --install --prefix.

Build libgpg-error + libgcrypt with --with-pic so their static archives can be
linked into the qca-gcrypt shared plugin. Add qca to kf6-kwallet deps.
2026-08-02 04:44:37 +03:00
vasilito c825f470cb libs: vendor libgcrypt 1.11.1 + libgpg-error 1.55; wire into kf6-kwallet
redbear-ci / check (push) Has been cancelled
kf6-kwallet's kwalletbackend hard-requires LibGcrypt 1.5.0 for PBKDF2 key
derivation and the GPG-backed wallet format. Vendor both libraries under the
full-fork model (committed source/, offline-reproducible) and add libgcrypt to
kf6-kwallet's dependencies.

Release tarballs ship a pre-generated configure and a config.sub that already
recognises the *-redox triple, so no autotools regeneration is needed at cook
time. libgpg-error supplies a generic pthread-backed gpgrt_lock_t for Redox via
its build script; the test-only redox.patch (tms/times stub) is baked into
libgcrypt's source and kept alongside for future version bumps.

Promoted from the stale recipes/wip copies (now .disabled).
2026-08-02 04:29:16 +03:00
vasilito a7ada11442 polkit: vendor upstream client libraries (libpolkit-gobject-1 + agent-1)
kf6-kauth deliberately uses the real polkit backend (KAUTH_BACKEND_NAME=
POLKITQT6-1), and PolkitQt6-1 links the upstream polkit CLIENT libraries, which
nothing provided (redbear-polkit is only the org.freedesktop.PolicyKit1 daemon).
This makes the KDE authorization mechanism actually work, not just compile.

- New recipe local/recipes/libs/polkit (vendored polkit 124, full-fork path=source)
  built with -Dlibs-only=true so polkitd + the JS rules engine are skipped
  (redbear-polkit is the authority daemon). glib/gio/expat deps already exist.
- src/meson.build: build src/polkitagent even under libs-only — libpolkit-agent-1
  + its PAM auth helper are client-side, needed by PolkitQt6-1, and depend only on
  libpolkit-gobject-1 + glib + PAM (pam-redbear, the same PAM SDDM uses). Only the
  daemon/backend/programs stay gated off.
- pam-redbear: add the standard PAM_MAX_MSG_SIZE/PAM_MAX_RESP_SIZE constants its
  header was missing (polkit-agent-helper-1 needs them).
- polkit-qt6: depend on polkit; it now finds polkit-gobject-1 + polkit-agent-1
  (v124) and builds. Auth prompts verify passwords via pam-redbear; authorization
  decisions come from the redbear-polkit daemon over D-Bus.
2026-08-01 16:23:40 +03:00
vasilito 7ddb4acf98 audio: un-defer pipewire + wireplumber in redbear-full
Both now build for x86_64-unknown-redox against the ported relibc surface:
- wireplumber recipe: fix meson option types for 0.4.14 (doc feature; tests/
  tools/daemon are booleans, not features) — configure was erroring out.
- pcre2: build the static archive with -fPIC so it links into WirePlumber's
  shared PipeWire modules (via glib); matches expat/icu/libffi. Fixes the
  R_X86_64_32S-in-shared-object link failure.
- config/redbear-full.toml: re-add pipewire + wireplumber to packages[] and
  [files]; drop the TODO(audio) deferral.
- bump relibc submodule pointer to the ported C-runtime surface.
2026-08-01 13:12:13 +03:00
vasilito ac1daf0428 qt: add qt5compat + qtmultimedia modules (port the missing Qt modules, not around them)
Per the no-workarounds policy, provide the Qt modules KDE needs instead of
patching KDE to avoid them:
 - qt5compat (Core5Compat): promoted from recipes/wip, re-laid to 6.11.1
   (matches the rest of Qt); no Redox source port needed. Unblocks 8 KDE pkgs.
 - qtmultimedia: new recipe at 6.11.1, built API-only (all platform backends
   off: ffmpeg/gstreamer/pulseaudio/alsa/pipewire/v4l2) so libQt6Multimedia
   links for consumers (konsole bell); playback is a no-op until a Redox audio
   backend exists.
 - libclc: convert git= -> path=source (it was fully vendored; a fresh fetch
   broke on the removed .git). Overlay symlinks added for both new qt modules.
2026-08-01 08:42:28 +03:00
vasilito 1488226b91 dev/git: add gettext build dependency (fixes 'ld: cannot find -lintl')
git links -lintl (libintl, from gettext) for i18n but never declared gettext as
a build dependency — it was implicitly relying on libintl.a already being in the
shared prefix sysroot from another package. When the relibc/kernel-touched boot-
ABI relink cleaned the sysroot, git's own sysroot lacked libintl and the link
failed. Declare the dependency so libintl.a is staged into git's sysroot.
2026-08-01 07:32:30 +03:00
vasilito caa2fb48b8 mesa-clc: native host build of mesa_clc + vtn_bindgen2 for cross builds
A Redox cross build cannot run the target shader-precompile tools on the host,
so build them natively once and feed them to the cross Mesa via
-Dmesa-clc=system -Dprecomp-compiler=system. Native meson build against
llvm-native's CLEAN host LLVM/Clang (the redoxer toolchain's llvm-config emits
-I<toolchain>/include, which holds Redox target libc headers that poison host
g++), host system deps (libdrm/expat/zlib/zstd), and our host-built
SPIRV-Tools/LLVMSPIRVLib/libclc (pkg-config with absolute .pc prefixes; native
pkg-config, not the cross wrapper). Driver-agnostic tools, so iris-only (no
amdgpu-LLVM needed); they serve radeonsi/radv in the cross build too.
2026-07-31 15:32:38 +03:00
vasilito 41d0ff60d9 libelf: new recipe (elfutils carve-out) for Mesa radeonsi; wire into mesa
Mesa's radeonsi gallium driver requires libelf. Add a libelf recipe that builds
only the elfutils lib/+libelf/ subdirs (avoiding the libdw/libasm/tools glibc
surface) as a PIC static archive, relying on the new relibc headers/functions
(byteswap/error/libintl/ar/search + tsearch/mempcpy/rawmemchr). Installs
libelf.a + libelf.h/gelf.h/nlist.h + libelf.pc. Wired into mesa deps.

Verified: cook libelf - successful.
2026-07-31 15:04:40 +03:00
vasilito c775ea2539 llvm21: host libLLVM must keep rustc's CPU targets (X86;AArch64;RISCV) + GPU
The host libLLVM.so (COOKBOOK_HOST_SYSROOT=/usr branch) lives in the redoxer
toolchain and is dynamically linked by rustc's librustc_driver. Building it as
X86;AMDGPU;NVPTX only dropped AArch64/RISCV, so after the AMDGPU splice rustc
failed to load with 'undefined symbol: LLVMInitializeAArch64AsmPrinter' —
breaking every Rust compile in the tree. Build the host LLVM with all CPU
targets rustc emits (X86;AArch64;RISCV) PLUS the GPU backends (AMDGPU;NVPTX).
The Redox-target llvm21 stays X86;AMDGPU;NVPTX (Redox is amd64-only, no need to
bloat the shipped libLLVM with foreign CPU backends).

Fixes a latent regression from 80d20db8/a6999912.
2026-07-31 14:40:09 +03:00
vasilito e4c78b3d18 mesa: add CLC/SPIRV chain (SPIRV-Headers/Tools/LLVM-Translator) + clang21 dep
Shipping the Intel iris/ANV gallium+vulkan drivers turns on Mesa's with_clc
(with_driver_using_cl), which requires, in the native mesa_clc/intel_clc shader
precompile path: LLVMSPIRVLib (SPIRV-LLVM-Translator), SPIRV-Tools, and clang's
C++ libraries. None had recipes. Add three host-built dev recipes modelled on
libclc (built against llvm-native's host LLVM 21, staged into the cross sysroot
so Mesa's pkg-config resolves them):
  - spirv-headers          (SPIR-V grammar + headers; find_package package)
  - spirv-tools            (SPIRV-Tools.pc; SPIRV-Headers via find_package)
  - spirv-llvm-translator  (LLVMSPIRVLib.pc, v21.1.0.0; llvm_release_210 branch)
All three clear the cross-sysroot __libc_start_main leak with the llvm21-style
flag-clearing block in their native toolchain files.

Wire them + clang21 into mesa deps: Mesa resolves dep_clang via
cpp.find_library('clang-cpp', dirs: llvm-config --libdir), which the wrapper
rewrites to the target sysroot/lib, so clang21's target libclang-cpp.so must be
staged there (shared-llvm=enabled avoids needing the static clang libs).

Verified: mesa meson now passes amdgpu, LLVMSPIRVLib, SPIRV-Tools, and clang-cpp
(next gate is libelf for radeonsi).
2026-07-31 13:42:25 +03:00
vasilito ce8359342c llvm21+policy: add NVPTX (future NVIDIA) + document GPU-driver/LLVM strategy
Per operator: don't forget Intel + virgl, and prepare for future NVIDIA. Intel
(iris/anvil) and virgl need NO LLVM GPU backend (NIR / virtualized) — they stay
in Mesa's driver lists as first-class targets. AMD needs AMDGPU (now); NVIDIA
(future, nouveau/NVK) needs NVPTX. LLVM rebuilds are very expensive, so include
NVPTX now (llvm21: X86;AMDGPU;NVPTX) to avoid an LLVM rebuild when NVIDIA lands.
Documented the vendor->driver->LLVM-backend matrix in the amd64-only policy.
2026-07-31 11:05:42 +03:00
vasilito 5d087d63bc llvm21: add AMDGPU LLVM target for Mesa radeonsi/radv (amd64-only)
Mesa's radeonsi/radv AMD-GPU drivers require the LLVM 'amdgpu' codegen backend
(dependency('llvm', modules: [... amdgpu ...])). llvm21 built X86 only, so the
host llvm-config the mesa build reads reported amdgpu(missing). Add AMDGPU to
LLVM_TARGETS_TO_BUILD (X86;AMDGPU per the amd64-only policy — AMDGPU is a GPU
backend, not a second CPU platform). This is the redox-target LLVM whose libs
mesa links AND the source of the prefix clang-install host LLVM. NB: the
~/.redoxer toolchain host llvm-config (a provisioned prebuilt) still needs the
rebuilt AMDGPU host-LLVM propagated into it (follow-up).
2026-07-31 11:03:12 +03:00
vasilito 312659fe21 lld21/llvm-native: pin cross tblgen to version-matched redoxer toolchain
Cross-building lld/llvm needs a HOST-runnable llvm-tblgen to generate the
Options.inc opt-parser sources, and it must match the LLVM 21 source tree.
Both recipes referenced ${COOKBOOK_HOST_SYSROOT}/bin/llvm-tblgen, but the
cookbook does not export COOKBOOK_HOST_SYSROOT, so the path collapsed to the
host /bin/llvm-tblgen. On a rolling distro that is now LLVM 22, whose
-gen-opt-parser-defs backend requires a 'SubCommand' TableGen class absent
from LLVM 21's OptParser.td:

    error: The class 'SubCommand' is not defined

Default COOKBOOK_HOST_SYSROOT to the redoxer toolchain (host-runnable LLVM
21.1.2 llvm-/clang-tblgen), exactly as the sibling clang21 recipe already
does. Fixes the full-target build reaching mesa's LLVM build-deps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 06:16:27 +09:00
vasilito 47a46bb015 recipes: redbear-dnsd whole-dir symlink into local (fixes cook: no Cargo.toml)
redbear-dnsd is an in-house recipe (path = "source"), but recipes/system/
redbear-dnsd was a real dir with only a recipe.toml file-symlink, so
'cargo install --path recipes/system/redbear-dnsd/source' found no Cargo.toml
(the source lives in local/recipes/system/redbear-dnsd/source). Make it a
whole-dir symlink to local/ like every other in-house recipe (ehcid, netctl,
...), and add it to apply-patches.sh's link list so it is recreated durably.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 12:03:41 +09:00
vasilito 9ff09dceaf sessiond: track inhibitor FD per-call + wifictl: AccessPointExport type alias
Three concurrent refinements from the same work batch:

1. sessiond/manager.rs + runtime_state.rs: switch inhibitor_fds
   from HashMap<u64, StdOwnedFd> to HashMap<i32, TrackedInhibitorFd>
   so each inhibitor carries both its numeric id and the OwnedFd
   that needs to be closed when the caller FD vanishes. The
   TrackedInhibitorFd newtype wraps (inhibitor_id, _fd) and lets
   reap-on-vanish use the keyed fd handle to take() out of the
   map cleanly. The dead_senders code path now collects daemon_fd()
   values directly instead of round-tripping through Vec<u64>.

2. wifictl/dbus_nm.rs: introduce AccessPointExport type alias
   (OwnedObjectPath, AccessPointInterface) and rename
   access_point_interfaces -> access_point_exports returning the
   same shape. access_point_paths now derives from the exports
   list (avoiding the parse-then-rebuild cycle) and a new
   all_access_point_paths() passes through. All call sites in
   serve_on_thread get a single coherent exports() call instead
   of duplicate path/interface computations.

3. recipes/wip/wayland/qt6-wayland-smoke: correct the relative
   symlink target from ../../../local/recipes/wayland/qt6-wayland-smoke
   to ../../../../local/recipes/wayland/qt6-wayland-smoke. The
   symlink resolves correctly either way (filesystem lookup
   succeeds) but the git tree now records a path that is one
   level more explicit and matches the canonical Red Bear recipe
   symlink convention used elsewhere in recipes/wip/.

Verified via grep that no callers of the old HashMap<u64,
StdOwnedFd> shape remain; all switched to the new TrackedInhibitorFd
type. The sessiond-vs-dead_senders race that motivated the FD
tracking is now correctly closed by taking the daemon_fd handle
out of the map under the same Mutex that updates runtime.inhibitors.
2026-07-28 08:02:34 +09:00
vasilito aa12991053 docs: extend legacy-obsolete reference repair across AGENTS and READMEs
Completes the round-2 docs cleanup sweep by repairing the same
stale-reference pattern in files I missed in the prior commit.

Same pattern as 5970dd226f: each replacement points at the
current canonical doc (restored to top-level, absorbed into a
different plan, or now tracked in SUPERSEDED-DOC-LOG.md for
historical reference).

- AGENTS.md: legacy-obsolete/BUILD-SYSTEM-HARDENING-PLAN.md
  -> COLLISION-DETECTION-STATUS.md
  legacy-obsolete/HOOKS.md -> RELEASE-BUMP-WORKFLOW.md § Git Hooks
  legacy-obsolete/PATCH-PRESERVATION-AUDIT -> SUPERSEDED-DOC-LOG.md
- CONTRIBUTING.md: same legacy-obsolete repairs
- README.md: same legacy-obsolete repairs
- docs/01-REDOX-ARCHITECTURE.md:
  WAYLAND-IMPLEMENTATION-PLAN.md -> 3D-DESKTOP-COMPREHENSIVE-PLAN.md
- docs/07-RED-BEAR-OS-IMPLEMENTATION-PLAN.md:
  legacy-obsolete/IRQ -> top-level IRQ plan;
  legacy-obsolete/05-KDE-PLASMA -> struck-through with deletion note;
  WAYLAND-IMPLEMENTATION-PLAN.md -> 3D-DESKTOP-COMPREHENSIVE-PLAN.md
- docs/AGENTS.md: same legacy-obsolete repairs; 05-KDE marked as
  deleted; legacy-obsolete/DRM-MODERNIZATION -> 3D-DESKTOP-COMPREHENSIVE
- docs/README.md: same legacy-obsolete repairs
- local/AGENTS.md: same legacy-obsolete repairs
- local/docs/SUPERSEDED-DOC-LOG.md: alignment with the
  2026-07-27 consolidation entry
- recipes/wip/AGENTS.md: legacy-obsolete/05-KDE-PLASMA repoint

The deltas are documented verbatim in each diff; nothing was
rephrased, only the link target was corrected.
2026-07-27 22:40:37 +09:00
vasilito 8fbc113d9f round 14: remove LD_PRELOAD stub + firmware-loader + scheme daemons expect chains + SUPERSEDED-DOC-LOG R11-14
Round 14 audit cleanup. Six coordinated fixes across seven files
plus a documentation log update:

1. local/recipes/system/redbear-wayland-guard/ — REMOVED entirely.
   The directory contained only source/wayland_guard.c — an LD_PRELOAD
   interposer stub for three wl_proxy_* functions — with NO recipe.toml.
   This violated local/AGENTS.md STUB AND WORKAROUND POLICY ('No LD_PRELOAD
   tricks'). The correct null-guard fix lives in libwayland upstream per
   QT6-WAYLAND-NULL8-DIAGNOSIS.md (already covered by Mesa win compat).

2. recipes/system/redbear-wayland-guard — broken symlink cleaned up.

3. local/recipes/AGENTS.md — catalog entry for redbear-wayland-guard was
   wrong (claimed 'Rust' but the code was C LD_PRELOAD). Replaced with
   REMOVED note explaining the policy violation and the correct fix
   location in libwayland.

4. local/recipes/system/firmware-loader/source/src/main.rs — converted
   9 .expect() calls in the daemon init path (Socket::create, scheme_root,
   create_this_scheme_fd, syscall::call_wo notify, setrens, next_request,
   write_response) to Result propagation. get_init_notify_fd() and
   notify_scheme_ready() now return Result; run_daemon() returns Result and
   main() matches on Err to log+exit(1) cleanly. The daemon was
   crashing the entire firmware-delivery subsystem on any init failure;
   now init can fall back or restart the daemon.

5. local/recipes/system/{redbear-keymapd,redbear-ime,redbear-accessibility}/
   source/src/main.rs — three scheme daemons used the same
   Socket::create().expect() + register_sync_scheme().expect() pattern.
   Replaced all six .expect() calls with match expressions that
   log_msg('ERROR', ...) and process::exit(1). Same pattern.

6. local/docs/NETWORKING-AND-DRIVERS-SYSTEMATIC-ASSESSMENT-2026-07-27.md —
   struck through 5 references to the now-removed redbear-wayland-guard
   (line 65 missing-daemons list, line 344 table row, line 397
   implementation list, line 414 source-list, line 797 P3-8 backlog).

7. local/docs/SUPERSEDED-DOC-LOG.md — appended a 'Rounds 11-14 Source-Level
   Supersessions' table logging every lie-grade fix and stale-doc
   strike from this session. Mirrors the original deletion-log style for
   consistency, and gives operators a single place to see what was
   resolved and where. Documents the emerging pattern: lie-grade code in
   Red Bear concentrates in (a) relibc panic-site catch-alls (addressed
   rounds 9-10), (b) scheme daemon init paths using .expect() instead of
   Result (rounds 11-14), (c) Mesa DRM/Wayland stubbing (rounds 12;
   remaining work tracked in 3D-DESKTOP-COMPREHENSIVE-PLAN.md).

Not committed in this commit (operator's parallel work, to be
committed by them):
- driver-manager/* (N-tier edits)
- redbear-sessiond/manager.rs (can_* probe refinements)
- redbear-statusnotifierwatcher/* (recipe + source)
- redbear-dbus-services/* (dbus service cleanup)
- redox-driver-core/manager.rs (test-only)
- Mesa redox_drm_cs.c (CS submit fix)

7 files changed in this commit + 2 deletions.
2026-07-27 21:27:39 +09:00
vasilito 1dd1fccbf3 docs: relocate DRIVER-MANAGER-MIGRATION-PLAN to archive + cleanup
The DRIVER-MANAGER-MIGRATION-PLAN was self-declared complete (the
driver-manager cutover happened 2026-07-23 per local/AGENTS.md). It
is now historical reference material rather than current planning
authority. Move it from local/docs/ into the established
legacy-obsolete-2026-07-25/ archive directory, updating every
inbound reference.

Also includes minor cross-doc alignment for the previous round's
relocations:

- local/AGENTS.md: update DRIVER-MANAGER-MIGRATION-PLAN to point to
  the legacy archive
- local/docs/REDBEAR-FULL-SDDM-BRINGUP.md: alignment update
- local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md: alignment update
- local/docs/archived/README.md: refresh archive contents note
- local/recipes/system/redbear-driver-policy/source/policy/README.md:
  policy doc drift alignment
- local/scripts/guard-recipes.sh: fix symlink target computation
  (relative path was being glued onto an absolute path, producing
  malformed dangling links like '../..//mnt/.../recipe.toml')
  -- this is a real bug fix discovered during this audit round.
2026-07-27 12:05:54 +09:00
vasilito 52e1deebd0 multi-session sweep: submodule bumps + doc/recipe/script updates
Submodule pointer updates (forks already pushed):
- base: netstack generic ReaderPool + OwnedFd bridge (36dddf23)
- bootloader, installer, userutils: upstream-tracking commits

Parallel agent work swept:
- kf6-kcmutils: recipe + CMakeLists + initial migration patch
- redbear-iwlwifi: Cargo.toml update
- tlc: MC-PARITY-AUDIT + README updates
- xwayland recipe+patch removed (stale)
- scripts: verify-patch-content.py, lint-config-paths.sh
- docs: CONSOLE-TO-KDE-DESKTOP-PLAN, DBUS-INTEGRATION-PLAN,
  HARDWARE-VALIDATION-MATRIX, REDBEAR-FULL-SDDM-BRINGUP,
  UPSTREAM-SYNC-PROCEDURE, README
2026-07-27 06:17:58 +09:00
vasilito c6e625a276 xwayland: comprehensive #TODO for runtime validation steps 2026-07-26 08:27:43 +09:00
vasilito 35e28dd37a clang21/libxml2: fix cross-build tablegen path + missing libiconv dep
clang21 (recipes/dev/clang21): the cross build (redox target) references
${COOKBOOK_HOST_SYSROOT}/bin/clang-tblgen and .../llvm-tblgen to generate the
*.inc sources, but cookbook does not export COOKBOOK_HOST_SYSROOT, so the paths
collapsed to /bin/clang-tblgen and ninja died: "'/bin/clang-tblgen' ... missing
and no known rule to make it". Point COOKBOOK_HOST_SYSROOT at the redoxer
toolchain, which ships host-runnable clang-tblgen/llvm-tblgen (LLVM 21.1.2) —
the same way the mesa recipe sets it.

libxml2 (recipes/libs/libxml2): declare the libiconv dependency. libxml2 2.15.x
requires iconv and its configure aborts "libiconv not found"; a libiconv recipe
exists but was never built because nothing depended on it.

Both are base recipes (not the operator's dirty mesa/kf6/libclc source WIP).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 00:18:39 +09:00
vasilito 1c94358a9b libarchive: fix dead source URL (libarchive.org -> GitHub releases)
The recipe's tar URL (https://libarchive.org/downloads/libarchive-3.8.8/...)
404s — that pathed form does not exist. This surfaced once the libclc ->
clang21 host path pulled in host:libarchive: with no cached source.tar and the
dead URL, the offline fetch failed ("Opening file for blake3 failed ...
source.tar: No such file"). Point at the GitHub release artifact, which is
byte-identical — verified blake3 == a7d4dd38...888b9024, unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 00:04:11 +09:00
vasilito d9af098408 build: unblock the FULL desktop stack (libclc wiring, host toolchain, xz, gate)
Fixes the chain of blockers that left redbear-full producing a desktop-less ISO
while still reporting success. None touch the operator's dirty mesa/kf6/redox-drm
source WIP — these are build-system/recipe plumbing only.

build-redbear.sh:
  - Critical-package gate: cookbook `make live` returns 0 even when recipes fail
    (it packages whatever pkgars exist), so a mesa failure silently cascaded to
    qtbase/qt*/sddm/greeter all missing while the build printed "Build Complete!".
    Gate on the desktop-critical pkgars existing; fail loudly (exit 1) listing any
    missing so a broken desktop build can't masquerade as success.
  - Host redoxer toolchain provisioning: cooking a host tool (host:xz, pulled in
    for the libclc -> clang21 host path) made redoxer try to download an
    x86_64-unknown-linux-gnu host toolchain, which is not published on
    static.redox-os.org -> 404 "unable to init toolchain", failing every host
    cook. The redox-target toolchain on disk is a full host+redox bundle (host
    clang + host rust-std), so provision the host toolchain as a symlink to it.
    Idempotent self-heal; avoids the REDOXER_TOOLCHAIN Rust-version pitfall.
  - Pre-cook libclc before mesa.

local/recipes/libs/mesa/recipe.toml:
  - Declare `libclc` as a dependency. Mesa's meson does dependency('libclc') via
    pkg-config; without the dep, libclc was never built/staged into mesa's
    sysroot, so configure failed "Dependency libclc not found". libclc ships its
    .pc in its main package, so depending on "libclc" is sufficient.

recipes/tools/xz/recipe.toml:
  - Host build static-only. xz 5.8.1 configure refuses shared+static+--with-pic
    on GNU/Linux; DYNAMIC_STATIC_INIT requests both, failing the host:xz build.
    Redox target keeps both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 23:56:12 +09:00
vasilito f26371ae30 recipes: add libclc as a local Red Bear OS project (Cat 1)
libclc was vendored at recipes/dev/llvm21/source/libclc/ as a
build artifact of the llvm21 fork. This promoted it from an
implicit Mesa dependency (the CLC bitcode Mesa consumes) to a
first-class local project, mirroring how tlc, redbear-*, cub, etc.
are organized per local/AGENTS.md.

Local layout follows the existing in-house pattern:
  recipes/dev/libclc          -> ../../local/recipes/dev/libclc
  local/recipes/dev/libclc/recipe.toml
  local/recipes/dev/libclc/source/   (vendored from llvm-project)

The recipe builds libclc as a host-side CMake project using the
cookbook-sysroot clang21 binary (not the cross-compiler) to compile
OpenCL kernels to .bc bitcode. Output targets are amdgcn, amdgcn-amdhsa,
r600, generic, and spirv — the union that Mesa's clc tool consumes
for the iris/radeonsi/llvmpipe drivers. ptx-nvidiacl and clspv are
excluded because they don't map onto any Mesa hardware driver.

The recipe also wires the cookbook's native-cmake generation with
an override that points CMAKE_C_COMPILER etc. at the cookbook
sysroot's clang-21 binary. This is needed because libclc must
run on the build host (output is bitcode, not a Redox binary),
and the cookbook's default cross-toolchain would link the build
against relibc instead of host glibc.

libclc.pc is installed at usr/lib/pkgconfig/, satisfying Mesa's
dependency('libclc') lookup. The .bc files are installed under
usr/share/clc/, which is what the libclc.pc libexecdir pointer
(libexecdir=<prefix>/share/clc) expects.

This is the prerequisite for re-enabling iris, radeonsi, and the
Intel Vulkan driver in the Mesa recipe (Phase 4-6 of
local/docs/3D-DRIVER-PLAN.md). With libclc available in the
cross-sysroot, mesa's meson '-Dwith_clc -> dependency(libclc)'
resolves and the gallium drivers compile.
2026-07-25 14:29:34 +09:00
vasilito 326df7f02d config: complete pcid-spawner retirement
- base-initfs recipe: pcid-spawner removed from initfs BINS and the
  lib/pcid.d initfs staging dropped (dead pcid-spawner config).
- acid.toml, redoxer.toml: requires_weak now points at
  00_driver-manager.service.
- redbear-mini.toml: dead /etc/pcid.d/* staging removed; driver-manager
  service override no longer gated on the retired fallback flag.
- redbear-full.toml: dead legacy-format /etc/pcid.d/ihdgd.toml and
  virtio-gpud.toml removed (driver-manager's 30-graphics.toml covers
  the same drivers in the current format).
- Comments updated: no fallback exists; driver-manager owns the path
  unconditionally. Base submodule bump (0c11c2b5).
2026-07-24 08:49:08 +09:00
vasilito 5d04ddc593 base recipe: make EXISTING_BINS filtering fast (one scan, not N full-tree greps)
The driver-list filter ran `grep -R "^name = \"$bin\"$" $COOKBOOK_SOURCE`
once PER bin (~40 bins). $COOKBOOK_SOURCE is local/sources/base, whose
target/ build tree is ~8.7 GB, so each grep re-scanned gigabytes and the
whole loop scanned hundreds of GB — a very slow build phase.

Collect the workspace's crate names ONCE from Cargo.toml files (skipping
target/ via --exclude-dir), into a bash associative array, then do an
O(1) membership check per bin. Verified equivalent (same bins selected)
and near-instant: the single scan of local/sources/base completes in
~0.02s vs minutes for the per-bin recursive greps.
2026-07-24 08:30:43 +09:00
vasilito e6b907a130 uutils-tar: fix forkpty libc patch anchor for libc >=0.2.189
The recipe adds a forkpty extern to the libc crate's Redox module (which
relibc provides but the libc crate does not declare) so nix 0.30.1's pty
module compiles. The sed anchor was `)-> c_int;` (no space), which
matched older libc formatting but NOT libc 0.2.189's multi-line openpty
close `) -> c_int;` (with space) — pulled in by the latest-upstream rule.
The sed silently no-op'd, forkpty was never declared, and nix failed with
"cannot find function forkpty in crate libc", breaking the mini build.

Fix: anchor `) *-> c_int;` (optional space) matches both the old and new
formatting. Verified: clean uutils-tar build compiles nix and finishes.

Note on the stale-rlib symptom seen during diagnosis: cargo fingerprints
registry crates by version, not source content, so a libc rlib compiled
while the anchor was broken (forkpty absent) is reused even after the
source is patched. A clean/target-wiped build recompiles correctly; the
anchor fix is the durable root fix.
2026-07-22 23:06:30 +09:00