Merge branch 'stuff-net' into 'master'

Port stuff from dev, emu and net

See merge request redox-os/redox!2006
This commit is contained in:
Jeremy Soller 2026-03-14 07:04:41 -06:00
commit 10d67a28bc
10 changed files with 184 additions and 13 deletions

View File

@ -1,4 +1,4 @@
#TODO not compiled or tested
#TODO compiled but not tested
# build instructions: https://github.com/WebAssembly/binaryen#building
[source]
git = "https://github.com/WebAssembly/binaryen"

View File

@ -1,5 +1,11 @@
#TODO camino crate error
#TODO compiled but not tested yet
[source]
git = "https://github.com/getzola/zola"
shallow_clone = true
rev = "33f03bb11158464e3ff877cdc5f1c55bbe7337ac"
patches = [
"redox.patch"
]
[build]
template = "cargo"

View File

@ -0,0 +1,91 @@
diff --git a/Cargo.lock b/Cargo.lock
index 25c8de7..23e44f4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -411,15 +411,6 @@ dependencies = [
"generic-array",
]
-[[package]]
-name = "block2"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
-dependencies = [
- "objc2",
-]
-
[[package]]
name = "bstr"
version = "1.12.1"
@@ -986,13 +977,12 @@ dependencies = [
[[package]]
name = "ctrlc"
-version = "3.5.1"
+version = "3.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73736a89c4aff73035ba2ed2e565061954da00d4970fc9ac25dcc85a2a20d790"
+checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73"
dependencies = [
- "dispatch2",
"nix",
- "windows-sys 0.61.2",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -1048,18 +1038,6 @@ dependencies = [
"crypto-common",
]
-[[package]]
-name = "dispatch2"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
-dependencies = [
- "bitflags 2.10.0",
- "block2",
- "libc",
- "objc2",
-]
-
[[package]]
name = "displaydoc"
version = "0.2.5"
@@ -3046,21 +3024,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "objc2"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05"
-dependencies = [
- "objc2-encode",
-]
-
-[[package]]
-name = "objc2-encode"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
-
[[package]]
name = "once_cell"
version = "1.21.3"
diff --git a/Cargo.toml b/Cargo.toml
index a08be28..a9df3da 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ clap_complete = "4"
axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "ws"] }
tokio = { version = "1.0.1", default-features = false, features = ["rt", "fs", "time", "net", "sync"] }
notify-debouncer-full = "0.6"
-ctrlc = "3"
+ctrlc = "=3.4.7"
open = "5"
# For mimetype detection in serve mode
mime_guess = "2.0"

View File

@ -1,8 +1,21 @@
#TODO not compiled or tested
#TODO nix crate error
# build instructions: https://github.com/dbalsom/martypc/wiki/Building-MartyPC#building-for-linux
[source]
git = "https://github.com/dbalsom/martypc"
shallow_clone = true
rev = "0.4.1"
[build]
template = "cargo"
template = "custom"
script = """
DYNAMIC_INIT
# there's a lot of git dependencies
COOKBOOK_CARGO_FLAGS=( -Zgit=shallow-index,shallow-deps )
# clang specifics
PREFIX_INCLUDE="$COOKBOOK_HOST_SYSROOT/$TARGET/include"
export CLANGFLAGS="-I $PREFIX_INCLUDE/c++/13.2.0 -I $PREFIX_INCLUDE/c++/13.2.0/$TARGET -I $PREFIX_INCLUDE/c++/13.2.0/backward -I $PREFIX_INCLUDE"
cookbook_cargo_packages martypc_eframe
"""
cargopackages = ["martypc_eframe"]

View File

@ -1,4 +1,5 @@
#TODO camino crate error
#TODO need wayland support, then patch rfd crate
#TODO port host:jre (try not to use jdk recipe)
# build instructions: https://github.com/ruffle-rs/ruffle#building-from-source
[source]
git = "https://github.com/ruffle-rs/ruffle"

View File

@ -1,10 +1,17 @@
#TODO not compiled or tested
# build instructions: https://redmine.lighttpd.net/projects/lighttpd/wiki/InstallFromSource
#TODO compiled but not tested
[source]
tar = "https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.82.tar.xz"
b3sum = "1890d4d63dab35ed8c6e994f11f408aaf9e6dd7cda959d2533a3c80d20c93029"
patches = [
"redox.patch"
]
[build]
template = "cmake"
cmakeflags = [
"-DWITH_OPENSSL=ON"
]
dependencies = [
"pcre2",
#"openssl3", # optional
"openssl3",
]

View File

@ -0,0 +1,12 @@
diff --color -ruwN source/src/fdevent.c source-new/src/fdevent.c
--- source/src/fdevent.c 2025-09-13 02:08:20.000000000 +0700
+++ source-new/src/fdevent.c 2026-03-14 14:16:21.543520177 +0700
@@ -321,7 +321,7 @@
int fd;
socklen_t len = (socklen_t) *addrlen;
- #if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+ #if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) && !defined(__redox__)
#if defined(__NetBSD__)
const int sock_cloexec = 1;
fd = paccept(listenfd, addr, &len, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);

View File

@ -1,10 +1,6 @@
#TODO missing libc:: socket-related imports
#TODO compiled but not tested
[source]
git = "https://github.com/svenstaro/miniserve"
shallow_clone = true
[build]
template = "cargo"
dependencies = [
"openssl3",
"zlib"
]

View File

@ -0,0 +1,34 @@
diff --git a/Cargo.toml b/Cargo.toml
index 68f26c9..98c4dde 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,7 +39,6 @@ futures = "0.3"
grass = { version = "0.13", features = ["macro"], default-features = false }
hex = "0.4"
httparse = "1"
-if-addrs = "0.15"
libflate = "2"
log = "0.4"
maud = "0.27"
@@ -62,6 +61,9 @@ thiserror = "2"
tokio = { version = "1.47.1", features = ["fs", "macros"] }
zip = { version = "8", default-features = false }
+[target.'cfg(not(target_os = "redox"))'.dependencies]
+if-addrs = "0.15"
+
[features]
default = ["tls"]
# This feature allows us to use rustls only on architectures supported by ring.
diff --git a/src/main.rs b/src/main.rs
index aea9ed9..3c91968 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -193,6 +193,7 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), StartupError> {
.partition(|addr| !addr.is_unspecified());
// Replace wildcard addresses with local interface addresses
+ #[cfg(not(target_os="redox"))]
if !wildcard.is_empty() {
let all_ipv4 = wildcard.iter().any(|addr| addr.is_ipv4());
let all_ipv6 = wildcard.iter().any(|addr| addr.is_ipv6());

View File

@ -0,0 +1,11 @@
#TODO: network interfaces (ifreq)
[source]
tar = "http://www.dest-unreach.org/socat/download/socat-1.8.1.1.tar.bz2"
[build]
template = "configure"
configureflags = [
"ac_cv_type_sig_atomic_t=yes",
"sc_cv_type_struct_timeval_tv_usec=5",
"--disable-ip6",
"--disable-termios",
]