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

bazel build //source/exe:envoy-static FAILED in macOS Mojave 10.14.6 #8148

Closed
ShannonDing opened this issue Sep 4, 2019 · 3 comments
Closed
Labels
question Questions that are neither investigations, bugs, nor enhancements

Comments

@ShannonDing
Copy link

Maybe this is same as #7557
Title: bazel build fail:zlib FAILED in macOS Mojave 10.14.6
Env:
clang -v
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Descrition: bazel build //source/exe:envoy-static

_____ BEGIN BUILD LOGS _____
Bazel external C/C++ Rules #0.0.8. Building library 'zlib'
Environment:______________TMPDIR=/var/folders/6x/0fj6rnr108zdyp13mv6klv4m0000gn/T/
EXT_BUILD_ROOT=/private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy
INSTALLDIR=/private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy/bazel-out/host/bin/external/envoy/bazel/foreign_cc/zlib
__CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34
PATH=/private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.
BUILD_TMPDIR=/var/folders/6x/0fj6rnr108zdyp13mv6klv4m0000gn/T/tmp.DdKsTAPE
PWD=/private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy
EXT_BUILD_DEPS=/private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy/bazel_foreign_cc_deps_zlib
SHLVL=2
BUILD_LOG=bazel-out/host/bin/external/envoy/bazel/foreign_cc/zlib/logs/CMake.log
BUILD_SCRIPT=bazel-out/host/bin/external/envoy/bazel/foreign_cc/zlib/logs/CMake_script.sh
_=/usr/bin/env
__________________________-- The C compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy/external/local_config_cc/cc_wrapper.sh
-- Check for working C compiler: /var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy/external/local_config_cc/cc_wrapper.sh -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Renaming
-- /var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/sandbox/darwin-sandbox/127/execroot/envoy/external/net_zlib/zconf.h
-- to 'zconf.h.included' because this file is included with zlib
-- but CMake generates it automatically in the build directory.
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

zlib

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /var/folders/6x/0fj6rnr108zdyp13mv6klv4m0000gn/T/tmp.DdKsTAPE
[1/37] Building C object CMakeFiles/zlibstatic.dir/compress.o
[2/37] Building C object CMakeFiles/zlibstatic.dir/gzclose.o
[3/37] Building C object CMakeFiles/zlibstatic.dir/adler32.o
[4/37] Building C object CMakeFiles/zlibstatic.dir/gzlib.o
[5/37] Building C object CMakeFiles/zlibstatic.dir/crc32.o
[6/37] Building C object CMakeFiles/zlibstatic.dir/inftrees.o
[7/37] Building C object CMakeFiles/zlibstatic.dir/gzwrite.o
[8/37] Building C object CMakeFiles/zlibstatic.dir/uncompr.o
[9/37] Building C object CMakeFiles/zlibstatic.dir/gzread.o
[10/37] Building C object CMakeFiles/zlibstatic.dir/zutil.o
[11/37] Building C object CMakeFiles/zlibstatic.dir/inffast.o
[12/37] Building C object CMakeFiles/zlib.dir/compress.o
[13/37] Building C object CMakeFiles/zlib.dir/gzclose.o
[14/37] Building C object CMakeFiles/minigzip.dir/test/minigzip.o
[15/37] Building C object CMakeFiles/zlib.dir/adler32.o
[16/37] Building C object CMakeFiles/example.dir/test/example.o
[17/37] Building C object CMakeFiles/zlibstatic.dir/infback.o
[18/37] Building C object CMakeFiles/zlib.dir/crc32.o
[19/37] Building C object CMakeFiles/zlib.dir/gzlib.o
[20/37] Building C object CMakeFiles/zlib.dir/gzread.o
[21/37] Building C object CMakeFiles/zlib.dir/gzwrite.o
[22/37] Building C object CMakeFiles/zlib.dir/inftrees.o
[23/37] Building C object CMakeFiles/zlib.dir/uncompr.o
[24/37] Building C object CMakeFiles/zlib.dir/zutil.o
[25/37] Building C object CMakeFiles/zlibstatic.dir/trees.o
[26/37] Building C object CMakeFiles/zlib.dir/inffast.o
[27/37] Building C object CMakeFiles/zlib.dir/infback.o
[28/37] Building C object CMakeFiles/zlibstatic.dir/deflate.o
[29/37] Building C object CMakeFiles/zlib.dir/trees.o
[30/37] Building C object CMakeFiles/zlibstatic.dir/inflate.o
[31/37] Linking C static library libz.a
FAILED: libz.a
: && /usr/local/Cellar/cmake/3.12.4/bin/cmake -E remove libz.a && /usr/bin/libtool qc libz.a CMakeFiles/zlibstatic.dir/adler32.o CMakeFiles/zlibstatic.dir/compress.o CMakeFiles/zlibstatic.dir/crc32.o CMakeFiles/zlibstatic.dir/deflate.o CMakeFiles/zlibstatic.dir/gzclose.o CMakeFiles/zlibstatic.dir/gzlib.o CMakeFiles/zlibstatic.dir/gzread.o CMakeFiles/zlibstatic.dir/gzwrite.o CMakeFiles/zlibstatic.dir/inflate.o CMakeFiles/zlibstatic.dir/infback.o CMakeFiles/zlibstatic.dir/inftrees.o CMakeFiles/zlibstatic.dir/inffast.o CMakeFiles/zlibstatic.dir/trees.o CMakeFiles/zlibstatic.dir/uncompr.o CMakeFiles/zlibstatic.dir/zutil.o && :
error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output)
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
[32/37] Building C object CMakeFiles/zlib.dir/deflate.o
[33/37] Building C object CMakeFiles/zlib.dir/inflate.o
ninja: build stopped: subcommand failed.

_____ END BUILD LOGS _____
rules_foreign_cc: Build script location: bazel-out/host/bin/external/envoy/bazel/foreign_cc/zlib/logs/CMake_script.sh
rules_foreign_cc: Build log location: bazel-out/host/bin/external/envoy/bazel/foreign_cc/zlib/logs/CMake.log

Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /private/var/tmp/_bazel_shannon/4330a4ee54ae7f0b50221c0a8ef7a635/external/envoy_api/envoy/type/BUILD:15: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 1) bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
INFO: Elapsed time: 6.197s, Critical Path: 5.96s
INFO: 8 processes: 8 darwin-sandbox.
FAILED: Build did NOT complete successfully

@htuch
Copy link
Member

htuch commented Sep 4, 2019

@htuch htuch added the question Questions that are neither investigations, bugs, nor enhancements label Sep 4, 2019
@zuercher
Copy link
Member

zuercher commented Sep 4, 2019

I don't have a machine I can test this on, but the doc change suggested by @LisaLudique in #8139 implies that this error occurs when Xcode is not installed.

@ShannonDing
Copy link
Author

I don't have a machine I can test this on, but the doc change suggested by @LisaLudique in #8139 implies that this error occurs when Xcode is not installed.

Thanks a lot.
After Xcode is installed, the envoy-static can be built success.
[Step 1]: bazel clean --expunge
[Step 2]: bazel build //source/exe:envoy-static

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that are neither investigations, bugs, nor enhancements
Projects
None yet
Development

No branches or pull requests

4 participants