rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood36c10fac855f5a25627f8f9b68e86bfb4800e3a4
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "357f7046ca3c789608d2cbb1f560d90a98047f27",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"title": "Changes:",
"state": {
"status": "archived",
"conflicts": []
},
"before": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"after": "36c10fac855f5a25627f8f9b68e86bfb4800e3a4",
"commits": [
"36c10fac855f5a25627f8f9b68e86bfb4800e3a4",
"8bff6c9405eb8dee1699feb437ea29c4dfeed18d"
],
"target": "d285eccb23f3986bfa88fc1af033e6dcb0dc3a65",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "357f7046ca3c789608d2cbb1f560d90a98047f27",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "- Split changes into two commits\n- Guard the `cmd_name = echo` line behind cfg to silence clippy\n- Rework `set_file_limit` into two `unix` and `windows` functions, where the\n former handles conversions to u64 and the latter i64.",
"base": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"oid": "36c10fac855f5a25627f8f9b68e86bfb4800e3a4",
"timestamp": 1715169979
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "fa456731-9db1-44b3-86e6-10f8e48c312f"
},
"info_url": "https://cci.rad.levitte.org//fa456731-9db1-44b3-86e6-10f8e48c312f.html"
}
Started at: 2026-09-07 20:19:46.960567+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/fa456731-9db1-44b3-86e6-10f8e48c312f/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 38 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 357f7046ca3c789608d2cbb1f560d90a98047f27
✓ Switched to branch patch/357f704 at revision 357f704
✓ Branch patch/357f704 setup to track rad/patches/357f7046ca3c789608d2cbb1f560d90a98047f27
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 36c10fac855f5a25627f8f9b68e86bfb4800e3a4
HEAD is now at 36c10fac httpd: support Windows for `rad web`
Exit code: 0
$ rad patch show 357f7046ca3c789608d2cbb1f560d90a98047f27 -p
╭────────────────────────────────────────────────────────────────────────────────╮
│ Title Changes: │
│ Patch 357f7046ca3c789608d2cbb1f560d90a98047f27 │
│ Author fintohaps z6Mkire…SQZ3voM │
│ Head 36c10fac855f5a25627f8f9b68e86bfb4800e3a4 │
│ Base 6ab3bfcba0577fabdcb84498441c6605391290f4 │
│ Target master │
│ Branches patch/357f704 │
│ Commits ahead 2, behind 1369 │
│ Status archived │
│ │
│ - Split changes into two commits │
│ - Guard the `cmd_name = echo` line behind cfg to silence clippy │
│ - Rework `set_file_limit` into two `unix` and `windows` functions, where the │
│ former handles conversions to u64 and the latter i64. │
├────────────────────────────────────────────────────────────────────────────────┤
│ 36c10fa httpd: support Windows for `rad web` │
│ 8bff6c9 radicle: OS specific setting of file limits │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision 357f704 @ 6ab3bfc..36c10fa by fintohaps z6Mkire…SQZ3voM 2 years ago │
╰────────────────────────────────────────────────────────────────────────────────╯
commit 36c10fac855f5a25627f8f9b68e86bfb4800e3a4
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Wed May 8 13:03:10 2024 +0100
httpd: support Windows for `rad web`
There was no Windows `cmd_name` support in `rad web`. In this case `echo` is
used.
Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
diff --git a/radicle-httpd/src/commands/web.rs b/radicle-httpd/src/commands/web.rs
index 3229ebf5a..4615bff39 100644
--- a/radicle-httpd/src/commands/web.rs
+++ b/radicle-httpd/src/commands/web.rs
@@ -192,6 +192,8 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
}
if options.open {
+ #[cfg(target_os = "windows")]
+ let cmd_name = "echo";
#[cfg(target_os = "macos")]
let cmd_name = "open";
#[cfg(target_os = "linux")]
commit 8bff6c9405eb8dee1699feb437ea29c4dfeed18d
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Wed May 8 12:58:20 2024 +0100
radicle: OS specific setting of file limits
On Windows systems the file limits are of type `i64` in comparison to `u64` on Unix
systems.
In order to attempt both, the `set_file_limit` function is duplicated to handle
the case for i64 for Windows, and u64 for Unix. Each is guarded by its
respective `target_family`.
In order to support the `usize` configuration value, the functions are modified
to accept values that can fallibly be converted to `i64` and `u64`,
respectively. If this fails an `io::Error` is returned.
Co-authored-by: Shawn Webb <shawn.webb@hardenedbsd.org>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
diff --git a/radicle-node/src/main.rs b/radicle-node/src/main.rs
index cc99ea94c..af50a3d22 100644
--- a/radicle-node/src/main.rs
+++ b/radicle-node/src/main.rs
@@ -120,7 +120,7 @@ fn execute() -> anyhow::Result<()> {
config.node.listen.clone()
};
- if let Err(e) = radicle::io::set_file_limit(config.node.limits.max_open_files as u64) {
+ if let Err(e) = radicle::io::set_file_limit(config.node.limits.max_open_files) {
log::warn!(target: "node", "Unable to set process open file limit: {e}");
}
diff --git a/radicle/src/io.rs b/radicle/src/io.rs
index 86a6db7e1..11c42be04 100644
--- a/radicle/src/io.rs
+++ b/radicle/src/io.rs
@@ -1,9 +1,58 @@
+use std::fmt;
use std::io;
use libc::{getrlimit, rlimit, setrlimit, RLIMIT_NOFILE};
+#[cfg(target_family = "unix")]
/// Sets the open file limit to the given value, or the maximum allowed value.
-pub fn set_file_limit(n: u64) -> io::Result<u64> {
+pub fn set_file_limit<N>(n: N) -> io::Result<u64>
+where
+ N: Copy + fmt::Display,
+ u64: TryFrom<N>,
+{
+ let Ok(n) = u64::try_from(n) else {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ format!("expected value that fits into u64, found: {n}"),
+ ));
+ };
+ let mut rlim = rlimit {
+ rlim_cur: 0, // Initial soft limit value
+ rlim_max: 0, // Initial hard limit value
+ };
+ // Get the current limits.
+ unsafe {
+ if getrlimit(RLIMIT_NOFILE, &mut rlim) != 0 {
+ return Err(io::Error::last_os_error());
+ }
+ }
+ if rlim.rlim_cur >= n {
+ return Ok(rlim.rlim_cur);
+ }
+ // Set the soft limit to the given value, up to the hard limit.
+ rlim.rlim_cur = n.min(rlim.rlim_max);
+ unsafe {
+ if setrlimit(RLIMIT_NOFILE, &rlim as *const rlimit) != 0 {
+ return Err(io::Error::last_os_error());
+ }
+ }
+ Ok(rlim.rlim_cur)
+}
+
+// N.b. windows uses i64 instead of u64
+#[cfg(target_family = "windows")]
+/// Sets the open file limit to the given value, or the maximum allowed value.
+pub fn set_file_limit<N>(n: N) -> io::Result<i64>
+where
+ N: Copy + fmt::Display,
+ i64: TryFrom<N>,
+{
+ let Ok(n) = u64::try_from(n) else {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ format!("expected value that fits into i64, found: {n}"),
+ ));
+ };
let mut rlim = rlimit {
rlim_cur: 0, // Initial soft limit value
rlim_max: 0, // Initial hard limit value
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name fa456731-9db1-44b3-86e6-10f8e48c312f -v /opt/radcis/ci.rad.levitte.org/cci/state/fa456731-9db1-44b3-86e6-10f8e48c312f/s:/fa456731-9db1-44b3-86e6-10f8e48c312f/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/fa456731-9db1-44b3-86e6-10f8e48c312f/w:/fa456731-9db1-44b3-86e6-10f8e48c312f/w -w /fa456731-9db1-44b3-86e6-10f8e48c312f/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /fa456731-9db1-44b3-86e6-10f8e48c312f/s/script.sh
+ cargo --version
info: syncing channel updates for '1.77-x86_64-unknown-linux-gnu'
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.77.2 (e52e36006 2024-03-26)
+ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.77-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.77-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}