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

AP_HAL_SITL: work around bug in dash #27742

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

peterbarker
Copy link
Contributor

Closes #24245

// work around a bug in dash; its manpage says it searches $PATH
// but it does't. https://github.com/ArduPilot/ardupilot/issues/24245
const char *cmd_fmt = "sh %s %d >%s 2>&1";
if (getenv("AP_DASH_HACKERY")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how does this env variable get set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By the user.

They already need to be running SITL (or autotest) with their cwd set to a place we're not expecting, and to have modified their $PATH to include scripts, so I figured an additional environment variable would be OK.

This patch was designed as least-risk-to-existing-users.

Copy link

@durka durka Aug 5, 2024

Choose a reason for hiding this comment

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

I'm thinking it might be easier to understand (for the users like me w/ weird setups) if the env var was something more like AP_OVERRIDE_PATH_TO_SCRIPTS=/path/to/scripts, to just specify the full path to where dumpstack/dumpcore are to be found, rather than the two-step process of adding that dir to PATH and also setting this other var.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking it might be easier to understand (for the users like me w/ weird setups) if the env var was something more like AP_OVERRIDE_PATH_TO_SCRIPTS=/path/to/scripts, to just specify the full path to where dumpstack/dumpcore are to be found, rather than the two-step process of adding that dir to PATH and also setting this other var.

Yeah, I considered doing this approach but went with your suggestion instead as a tested solution :-)

Decided at DevCall to go with this, looking for an env variable speciying the path. The reason I prefer this one is that you don't need to modify your path to find the tool....

dash doesn't search the path for scripts, so allow user to specify path to ArduPilot scripts
@peterbarker
Copy link
Contributor Author

Fixed to use a path from the environment to the ArduPilot scripts.

@tridge tridge merged commit b642651 into ArduPilot:master Aug 7, 2024
48 checks passed
@peterbarker peterbarker deleted the pr/dash-hack branch August 8, 2024 22:06
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.

SITL: dumpstack/dumpcore do not run if PWD is not in the repository and sh != bash
5 participants