Skip to content

[circle-mlir/infra] Discard output from the cd command#16430

Open
arkq wants to merge 1 commit intoSamsung:masterfrom
arkq:fix-circle-mlir-infra
Open

[circle-mlir/infra] Discard output from the cd command#16430
arkq wants to merge 1 commit intoSamsung:masterfrom
arkq:fix-circle-mlir-infra

Conversation

@arkq
Copy link
Contributor

@arkq arkq commented Mar 10, 2026

This commit fixes the issue when cd is followed by the pwd in a bash one-liner for getting the location of the script. The cd command can print the destination directory in case when one has the CDPATH environmental variable set which breaks the one-liner functionality.

Copilot AI review requested due to automatic review settings March 10, 2026 12:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a subtle portability bug in the prepare-venv script where the cd command, when the CDPATH environment variable is set, prints the destination directory to stdout. This spurious output gets captured in the command substitution $(...) alongside pwd, corrupting the value of DRIVER_PATH. The fix redirects cd's stdout to /dev/null.

Changes:

  • Redirect stdout of cd to /dev/null in the path-resolution one-liner to prevent CDPATH-triggered output from polluting DRIVER_PATH.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This commit fixes the issue when `cd` is followed by the `pwd` in a
bash one-liner for getting the location of the script. The `cd` command
can print the destination directory in case when one has the CDPATH
environmental variable set which breaks the one-liner functionality.

ONE-DCO-1.0-Signed-off-by: Arkadiusz Bokowy <a.bokowy@samsung.com>
@arkq arkq force-pushed the fix-circle-mlir-infra branch from 934a454 to fbf39b3 Compare March 10, 2026 13:14
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