Proof of concept mechanical port of ircnet/ircd to Rust as part of a bit about C being insecure for network services
2.0 kB
Progress log — P1 (Leaf / pure utils)#
See PLAN.md for the phase table and migration model.
- 2026‑06‑02 — P1 (Leaf / pure utils) merged. New library crate
ircd-commonholds the ports (#[no_mangle] pub extern "C", exact*_ext.hsignatures);ircd-rs+ircd-testkitdepend on it via alink_anchor(). Ported & dropped from the C link set:match.c(5 fns + 3 tables),dbuf.c(8 fns +poolsize/freelist), and a pure subset ofsupport.c(mystrdup,strtoken,myctime,mybasename,inetntop,inetpton,irc_memcmp).- Seam wiring (resolves P0c's deferred task):
ircd-sys/build.rsnow splitsCREF_OBJS(full set → feeds thecref_*oracle) from the link set (CREF_OBJS \ PORTED, withsupport.o→support_link.osubstitution).support.cis partially ported via inert#ifndef PORT_SUPPORT_P1guards + a second compile, leaving the pristine reference build and the oracle untouched. - Scope corrections vs. original plan:
irc_sprintf.c+snprintf_appendmoved to P8 (variadicva_arg, unportable on stable Rust, no post‑format core);dgets/make_isupport/ipv6stringleft C (not pure leaves).dbuf_copyis dead/commented‑out C (not a compiled symbol) → not ported. - Verification:
cargo buildwarning‑free; all L1 + layout tests green;match/dbuf_*/mystrdup/irc_memcmpresolve to Rust inlibircd_c.awhilecref_*remain inlibcref.a. Spec:docs/superpowers/specs/2026-06-02-p1-leaf-utils-design.md; plan:docs/superpowers/plans/2026-06-02-p1-leaf-utils.md. - Faithfulness notes (caught in review): reproduced
match()'s always‑activeMAX_ITERATIONS 512cap;dbuf_getmirrors C's&&short‑circuit (avoidsdbuf_map'stailside effect);dbufpoolsizehard‑codes the compile‑time(BUFFERPOOL>1500000)?…:1500000value (correct for this config, pinned by an L1 test);irc_memcmp= unsigned byte compare (only the sign is observable);istatexterned from C, not redefined.
- Seam wiring (resolves P0c's deferred task):