Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@meipeter
Copy link

No description provided.

src/lib.rs Outdated
{
let mut help_test = crate::arch::base_dtrace_command(None);

let if_dtrace_enabled = std::env::var("DTRACE").is_ok();
Copy link
Contributor

@djc djc Oct 20, 2025

Choose a reason for hiding this comment

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

This layers a bunch of stuff on top which is not the best approach. Should probably rework the initial_command() function to do something like this:

match (workload, env::var("DTRACE")) {
     #[cfg(target_os = "windows")]
     (Workload::Command(c), Err(_)) => // do blondie
     #[cfg(not(target_os = "windows"))]
     (Workload::Command(c), Err(_)) => // dtrace on path fallback
     (Workload::Command(c), Ok(dtrace) => // do dtrace
     _ => // do dtrace
}

Copy link
Author

Choose a reason for hiding this comment

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

Ooops.Accidentally click the resolve.

@meipeter
Copy link
Author

meipeter commented Oct 20, 2025

As the fallback to PATH is in the base_dtrace_command ,if change there will be a lot of changes, I didn't change it.
Instead, i just move the DTRACE env to the match block.
Goodnight.

@djc
Copy link
Contributor

djc commented Oct 20, 2025

This set of changes makes no sense. It really needs some rethinking of the structure of the code. If you don't have the time/experience to do this, better to just close it. I don't want to do it myself since I don't have access to a Windows environment which makes testing a pain.

@meipeter meipeter closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants