google / differential-privacy

Google's differential privacy libraries.
Apache License 2.0
3.07k stars 346 forks source link

Fix bazel build issues on Mac for ZetaSQL #71

Open miracvbasaran opened 3 years ago

jean-malo commented 3 years ago

@miracvbasaran Hello Could you detail the current recommended workaround for this issue ? I tried to build using Bazelisk like described in the readme but couldn't get it to work. FYI I am running MacOS BigSur 11.1 Thanks

EDIT: Nervermind I was able to get it to work using Bazelisk + re-installing the latest Command line tools Thanks for all the work you do on maintaining such useful libraries!

gracetian6 commented 3 years ago

I am also still having these bazel build issues for Mac. I followed @jean-malo comments and used Bazelisk and reinstalled the latest Command line tools, but it still isn't working. Are there any updates?

My error is this:

examples/zetasql/BUILD:19:1 error executing shell command: '/bin/bash -c function cleanup_function() {
local ecode=$?
if [ $ecode -eq 0 ]; then
cleanup_on_success
else
cleanup_on_failure
fi
}
set -e
function cleanup_on_success() {
printf "rules_foreign_cc: ...' failed (Exit 2) bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
rjwilson commented 2 years ago

Can you provide more information about the failure? Did you try building with --verbose_failures? The command.log file will also have more information.

gracetian6 commented 2 years ago

@rjwilson The verbose_failure says that this shell command failed:

/bin/bash -c function cleanup_function() {
local ecode=$?
if [ $ecode -eq 0 ]; then
cleanup_on_success
else
cleanup_on_failure
fi
}
set -e
function cleanup_on_success() {
printf "rules_foreign_cc: ...' failed (Exit 2) bash failed: error executing command 
  (cd /private/var/tmp/_bazel_gracetian/bae5cb828fdd24ed9c85e9dd230cbf42/sandbox/darwin-sandbox/9/execroot/zetasql_example && \
  exec env - \
  /bin/bash -c 'function cleanup_function() {
local ecode=$?
if [ $ecode -eq 0 ]; then
cleanup_on_success
else
cleanup_on_failure
fi
}
set -e
function cleanup_on_success() {
printf "rules_foreign_cc: Cleaning temp directories"
  rm -rf $BUILD_TMPDIR $EXT_BUILD_DEPS
}
function cleanup_on_failure() {
printf "\nrules_foreign_cc: Build failed!\nrules_foreign_cc: Keeping temp build directory $BUILD_TMPDIR and dependencies directory $EXT_BUILD_DEPS for debug.\nrules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify '\''--sandbox_debug'\'' Bazel command line flag.\n\nrules_foreign_cc: Printing build logs:\n\n_____ BEGIN BUILD LOGS _____\n"
cat "$BUILD_LOG"
printf "\n_____ END BUILD LOGS _____\n"
printf "rules_foreign_cc: Build script location: $BUILD_SCRIPT\n"
printf "rules_foreign_cc: Build log location: $BUILD_LOG\n\n"
}
trap "cleanup_function" EXIT
export BUILD_SCRIPT="bazel-out/darwin-fastbuild/bin/external/icu/icu/logs/Configure_script.sh"
export BUILD_LOG="bazel-out/darwin-fastbuild/bin/external/icu/icu/logs/Configure.log"
touch $BUILD_LOG
$BUILD_SCRIPT &> $BUILD_LOG
rjwilson commented 2 years ago

What's the error in $BUILD_LOG?