@@ -1145,6 +1145,9 @@ def _os_id_from_release(text: str) -> str:
11451145 "make" : {"debian" : ["make" ], "arch" : ["make" ], "fedora" : ["make" ], "alpine" : ["make" ], "suse" : ["make" ], "macos" : []},
11461146 "git" : {"debian" : ["git" ], "arch" : ["git" ], "fedora" : ["git" ], "alpine" : ["git" ], "suse" : ["git" ], "macos" : ["git" ]},
11471147 "tmux" : {"debian" : ["tmux" ], "arch" : ["tmux" ], "fedora" : ["tmux" ], "alpine" : ["tmux" ], "suse" : ["tmux" ], "macos" : ["tmux" ]},
1148+ # Development package names differ by distro. Presence is probed by
1149+ # the header, not `command -v`, because this package installs no CLI.
1150+ "liburing-dev" : {"debian" : ["liburing-dev" ], "arch" : ["liburing" ], "fedora" : ["liburing-devel" ], "alpine" : ["liburing-dev" ], "suse" : ["liburing-devel" ], "macos" : []},
11481151 }
11491152 _BACKEND_EXTRAS = {
11501153 "cuda" : {"debian" : ["nvidia-cuda-toolkit" ], "arch" : ["cuda" ], "fedora" : ["cuda-toolkit" ], "alpine" : [], "suse" : ["cuda" ], "macos" : []},
@@ -1256,6 +1259,16 @@ async def list_packages(
12561259 "kind" : "system" ,
12571260 "install_hint" : "Install Docker on the selected server and allow this user to run docker." ,
12581261 },
1262+ {
1263+ "name" : "liburing-dev" ,
1264+ "pip" : "" ,
1265+ "desc" : "Native io_uring headers required by the Colibri Hy3 CUDA build" ,
1266+ "category" : "System" ,
1267+ "target" : "remote" ,
1268+ "kind" : "system" ,
1269+ "probe_path" : "/usr/include/liburing.h" ,
1270+ "install_hint" : "Install the liburing development headers on the selected Linux server. Debian/Ubuntu: sudo apt install -y liburing-dev." ,
1271+ },
12591272 # Note: cmake / gcc / git are not separate dependency rows —
12601273 # they're declared as `system_prereqs` on llama_cpp (and any
12611274 # other engine that compiles from source) so they appear as
@@ -1515,9 +1528,16 @@ async def list_packages(
15151528 checks = []
15161529 for name in all_system_names :
15171530 qn = shlex .quote (name )
1518- checks .append (
1519- f"PATH=\" $HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:/usr/local/bin:$PATH\" ; if command -v { qn } >/dev/null 2>&1; then echo { qn } =1; else echo { qn } =0; fi"
1520- )
1531+ package = next ((p for p in packages if p .get ("name" ) == name ), None )
1532+ probe_path = str ((package or {}).get ("probe_path" ) or "" )
1533+ if probe_path :
1534+ checks .append (
1535+ f"if [ -f { shlex .quote (probe_path )} ]; then echo { qn } =1; else echo { qn } =0; fi"
1536+ )
1537+ else :
1538+ checks .append (
1539+ f"PATH=\" $HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:/usr/local/bin:$PATH\" ; if command -v { qn } >/dev/null 2>&1; then echo { qn } =1; else echo { qn } =0; fi"
1540+ )
15211541 checks .append ("echo '---OSREL---'; cat /etc/os-release 2>/dev/null || { [ \" $(uname -s 2>/dev/null)\" = \" Darwin\" ] && echo ID=macos; } || true" )
15221542 inner = " ; " .join (checks )
15231543 argv = _ssh_base_argv (host , ssh_port ) + [inner ]
@@ -1572,6 +1592,11 @@ async def list_packages(
15721592 pkg ["installed" ] = None
15731593 pkg ["status_note" ] = "Only relevant for Apple Silicon / MLX image serving."
15741594 continue
1595+ if pkg ["name" ] == "liburing-dev" and target_os_id == "macos" :
1596+ pkg ["applicable" ] = False
1597+ pkg ["installed" ] = None
1598+ pkg ["status_note" ] = "Linux-only native build dependency for Colibri Hy3."
1599+ continue
15751600 on_remote = bool (host and pkg .get ("target" ) == "remote" )
15761601 probe = None
15771602 if on_remote :
@@ -1596,6 +1621,8 @@ async def list_packages(
15961621 if IS_APPLE_SILICON
15971622 else "Requires a native Apple Silicon Mac with Apple Foundational Models support."
15981623 )
1624+ elif pkg .get ("probe_path" ):
1625+ pkg ["installed" ] = Path (str (pkg ["probe_path" ])).is_file ()
15991626 else :
16001627 pkg ["installed" ] = shutil .which (pkg ["name" ]) is not None
16011628 elif pkg ["name" ] == "llama_cpp" and shutil .which ("llama-server" ):
@@ -1808,7 +1835,7 @@ async def install_package(request: Request):
18081835
18091836 @router .post ("/api/cookbook/install-system-deps" )
18101837 async def install_system_deps (request : Request ):
1811- """Install OS-level system packages (cmake/build-essential/git/tmux)
1838+ """Install allowlisted OS-level system packages
18121839 on a remote target or in the local container. Admin only.
18131840
18141841 Bounded by a per-package allowlist — anything outside the catalog
@@ -1824,20 +1851,26 @@ async def install_system_deps(request: Request):
18241851 ssh_port = body .get ("ssh_port" )
18251852 # Names users can request — must match canonical names used in the
18261853 # deps catalog's `system_prereqs` field and on the System rows.
1827- ALLOWED = {"cmake" , "build-essential" , "g++" , "gcc" , "git" , "tmux" , "make" }
1854+ ALLOWED = {"cmake" , "build-essential" , "g++" , "gcc" , "git" , "tmux" , "make" , "liburing-dev" }
18281855 pkgs = [str (p ).strip () for p in raw if str (p ).strip () in ALLOWED ]
18291856 if not pkgs :
18301857 return {"ok" : False , "error" : "no installable packages requested (allowlist: " + ", " .join (sorted (ALLOWED )) + ")" }
18311858 # Re-map to the right package name per OS. apt/dpkg use the names
18321859 # as-is; pacman has base-devel for build-essential, etc.
18331860 def _apt (names ): return list (names )
18341861 def _pacman (names ):
1835- return ["base-devel" if n == "build-essential" else n for n in names ]
1862+ return [
1863+ "base-devel" if n == "build-essential"
1864+ else "liburing" if n == "liburing-dev"
1865+ else n
1866+ for n in names
1867+ ]
18361868 def _dnf (names ):
18371869 out = []
18381870 for n in names :
18391871 if n == "build-essential" : out += ["gcc" , "gcc-c++" , "make" ]
18401872 elif n == "g++" : out += ["gcc-c++" ]
1873+ elif n == "liburing-dev" : out += ["liburing-devel" ]
18411874 else : out .append (n )
18421875 return out
18431876 def _apk (names ):
@@ -1851,10 +1884,11 @@ def _zypper(names):
18511884 for n in names :
18521885 if n == "build-essential" : out += ["gcc-c++" , "make" ]
18531886 elif n == "g++" : out .append ("gcc-c++" )
1887+ elif n == "liburing-dev" : out .append ("liburing-devel" )
18541888 else : out .append (n )
18551889 return out
18561890 def _brew (names ):
1857- return [n for n in names if n not in ("build-essential" , "g++" , "gcc" , "make" )]
1891+ return [n for n in names if n not in ("build-essential" , "g++" , "gcc" , "make" , "liburing-dev" )]
18581892 # Build a single shell snippet that detects the package manager and
18591893 # runs the right install. Non-interactive sudo (-n) only — if sudo
18601894 # asks for a password the script reports it instead of hanging.
0 commit comments