Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lychee-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ tokio-stream = "0.1.18"
toml = "1.0.6"
url = "2.5.8"
quick-junit = "0.5.2"
rlimit = "0.11.0"


[dev-dependencies]
Expand Down
7 changes: 7 additions & 0 deletions lychee-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ enum ExitCode {
const LYCHEEIGNORE_COMMENT_MARKER: &str = "#";

fn main() -> Result<()> {
// Increase the maximum number of open files on macOS and Linux.
// This is helpful because lychee opens many files concurrently during
// link extraction and checking, which can exceed the default limit
// of 256 open files on macOS. See https://github.com/lycheeverse/lychee/issues/1248
#[cfg(any(target_os = "macos", target_os = "linux"))]
Copy link
Member

@thomas-zahner thomas-zahner Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peeking inside the function I see the guard #[cfg(unix)] { ... } #[cfg(windows)] { Ok(lim) }. So I would remove our config guard completely. It's less code and will handle all cases for us, including all Unixes, not just macOS and Linux.

let _ = rlimit::increase_nofile_limit(u64::MAX);

// std::process::exit doesn't guarantee that all destructors will be run,
// therefore we wrap the main code in another function to ensure that.
// See: https://doc.rust-lang.org/stable/std/process/fn.exit.html
Expand Down
Loading