[circle-mlir/infra] Discard output from the cd command#16430
Open
arkq wants to merge 1 commit intoSamsung:masterfrom
Open
[circle-mlir/infra] Discard output from the cd command#16430arkq wants to merge 1 commit intoSamsung:masterfrom
cd command#16430arkq wants to merge 1 commit intoSamsung:masterfrom
Conversation
There was a problem hiding this comment.
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
cdto/dev/nullin the path-resolution one-liner to preventCDPATH-triggered output from pollutingDRIVER_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>
934a454 to
fbf39b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit fixes the issue when
cdis followed by thepwdin a bash one-liner for getting the location of the script. Thecdcommand can print the destination directory in case when one has theCDPATHenvironmental variable set which breaks the one-liner functionality.