Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add global -j, --threads #9367

Merged
merged 3 commits into from
Nov 21, 2024
Merged

feat: add global -j, --threads #9367

merged 3 commits into from
Nov 21, 2024

Conversation

DaniPopes
Copy link
Member

Closes #8408

@@ -898,10 +882,6 @@ impl Provider for TestArgs {
dict.insert("show_progress".to_string(), true.into());
}

if let Some(threads) = self.threads {
dict.insert("threads".to_string(), threads.into());
Copy link
Member Author

Choose a reason for hiding this comment

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

we have threads in config but I don't really know where it should spawn the thread pool, and also it would conflict with the CLI arg if both are present

jobs: Option<NonZeroUsize>,
/// Number of threads to use. Zero specifies the number of logical cores.
#[arg(global = true, long, short = 'j', visible_alias = "jobs")]
threads: Option<usize>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Has the same value as the global one

Comment on lines 68 to 70
/// Include the global options.
#[command(flatten)]
pub global: GlobalOpts,
Copy link
Member

Choose a reason for hiding this comment

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

This is required for the CLI tests that use TestArgs directly, same for ScriptArgs

See: https://github.com/foundry-rs/foundry/actions/runs/11935815335/job/33268041175?pr=9367#step:12:434

@DaniPopes DaniPopes force-pushed the dani/global-threads branch 2 times, most recently from c63c13a to bca4ec3 Compare November 20, 2024 18:32
@DaniPopes DaniPopes merged commit fef2098 into master Nov 21, 2024
22 checks passed
@DaniPopes DaniPopes deleted the dani/global-threads branch November 21, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat: add global Rayon thread pool (--jobs) to GlobalOpts
2 participants