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

Windows, sh_toolchain, bugfix: cast path to string #6508

Closed
wants to merge 1 commit into from

Conversation

laszlocsomor
Copy link
Contributor

When DetectBashOrDie [1] is commented out from
src/main/cpp/blaze.cc, and BAZEL_SH is unset,
and PATH is set and "bash" is found on the PATH,
then sh_configure successfully finds bash using
repository_ctx.which, and this method returns a
"path" object.

The code used to believe this was a string, and
called a string method on it, causing a runtime
error.

[1]

DetectBashOrDie();

Fixes #6498

Change-Id: I07fd36fd6c6e8433257b0394f1fc776bbe3e6928

When DetectBashOrDie [1] is commented out from
src/main/cpp/blaze.cc, and BAZEL_SH is unset,
and PATH is set and "bash" is found on the PATH,
then sh_configure successfully finds bash using
repository_ctx.which, and this method returns a
"path" object.

The code used to believe this was a string, and
called a string method on it, causing a runtime
error.

[1] https://github.com/bazelbuild/bazel/blob/2fda17d46088f2bb07b049fa35759002ea1dd5db/src/main/cpp/blaze.cc#L1543

Fixes bazelbuild#6498

Change-Id: I07fd36fd6c6e8433257b0394f1fc776bbe3e6928
Copy link
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix, awesome!

@laszlocsomor
Copy link
Contributor Author

laszlocsomor commented Oct 25, 2018

Thanks for helping with the repro!

@bazel-io bazel-io closed this in a0ed8c6 Oct 25, 2018
@laszlocsomor laszlocsomor deleted the fix6498 branch October 25, 2018 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants