acmcarther/cargo-raze

General problem with toolchain.bzl

Opened this issue · 5 comments

Not sure if that is in the modifications you made, but I run into trouble with this line in toolchain.bzl:

["if [[ -v TMPDIR ]]; then mkdir -p $TMPDIR; fi;"] +

With it in, nothing builds on mac os due some shell snafu. Commenting it out makes the build work for me:

$ bazel build //cargo/vendor:pbr
INFO: Analysed target //cargo/vendor:pbr (6 packages loaded).
INFO: Found 1 target...
ERROR: /Users/hrapp/Desktop/Programming/rust/point_cloud_viewer/cargo/vendor/winapi-0.2.8/BUILD:16:1: error executing shell command: 'set -e; if [[ -v TMPDIR ]]; then mkdir -p $TMPDIR; fi; rm -rf bazel-out/darwin-fastbuild/bin/cargo/vendor/winapi-0.2.8/winapi.deps; mkdir bazel-out/darwin-fastbuild/bin/cargo/vendor/winapi-0.2.8/wi...' failed (Exit 2)
/bin/bash: -c: line 0: conditional binary operator expected
/bin/bash: -c: line 0: syntax error near `TMPDIR'
/bin/bash: -c: line 0: `set -e; if [[ -v TMPDIR ]]; then mkdir -p $TMPDIR; fi; rm -rf bazel-out/darwin-fastbuild/bin/cargo/vendor/winapi-0.2.8/winapi.deps; mkdir bazel-out/darwin-fastbuild/bin/cargo/vendor/winapi-0.2.8/winapi.deps'
Target //cargo/vendor/pbr-1.0.0:pbr failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.250s, Critical Path: 0.10s
FAILED: Build did NOT complete successfully

Can you use "--verbose_failures" (scrubbing out anything you need to).

That doesn't look like a change I made. Are you on an interesting platform at all? Weird version of bash? Will look into.

The PR is here: bazelbuild/rules_rust#61, and I suggested a fix.

That fix went into the PR (though it remains unpushed), that should close this thread.