Failing to build on MacOS 10.15.4 (19E287)

138 views
Skip to first unread message

Enosh Cohen

unread,
May 14, 2020, 3:33:59 AM5/14/20
to Verible Developers
Hi all,

I want to start to contribute to this project, I have a problem with building it though.

This could be (and probably is) a problem with bazel, and yet I can't seem to figure out what is wrong.

The build log is shown at the end of this message.

Thank you for your help.


_____ BEGIN BUILD LOGS _____

Bazel external C/C++ Rules #0.0.8. Building library 'm4'

Environment:______________DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

TMPDIR=/var/folders/sb/94bh9qzs72dg2xby3fvt2mxc0000gn/T/

SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk

EXT_BUILD_ROOT=/private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible

XCODE_VERSION_OVERRIDE=11.4.1.11E503a

INSTALLDIR=/private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/bazel-out/darwin-fastbuild/bin/bazel/m4

__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0

PATH=/private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.

BUILD_TMPDIR=/var/folders/sb/94bh9qzs72dg2xby3fvt2mxc0000gn/T/tmp.KSWzLhbh

PWD=/private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible

EXT_BUILD_DEPS=/var/folders/sb/94bh9qzs72dg2xby3fvt2mxc0000gn/T/tmp.9sx6EvK6

SHLVL=2

BUILD_LOG=bazel-out/darwin-fastbuild/bin/bazel/m4/logs/Configure.log

BUILD_SCRIPT=bazel-out/darwin-fastbuild/bin/bazel/m4/logs/Configure_script.sh

APPLE_SDK_PLATFORM=MacOSX

APPLE_SDK_VERSION_OVERRIDE=10.15

_=/usr/bin/env

__________________________PKG_CONFIG_PATH=

configure: WARNING: unrecognized options: --disable-nls

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/m4/build-aux/install-sh -c -d

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking whether make supports nested variables... yes

checking whether make supports nested variables... (cached) yes

checking for gcc... /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables... 

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang accepts -g... yes

checking for /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang option to accept ISO C89... none needed

checking whether /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang understands -c and -o together... yes

checking for style of include used by make... GNU

checking dependency style of /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang... gcc3

checking how to run the C preprocessor... /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/wrapped_clang -E

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking minix/config.h usability... no

checking minix/config.h presence... no

checking for minix/config.h... no

checking whether it is safe to define __EXTENSIONS__... yes

checking whether _XOPEN_SOURCE should be defined... no

checking for Minix Amsterdam compiler... no

checking the archiver (/private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/libtool) interface... unknown

configure: error: could not determine /private/var/tmp/_bazel_enoshcohen/7be5e4d7d73ab64decc0969700760ebc/sandbox/darwin-sandbox/1/execroot/com_google_verible/external/local_config_cc/libtool interface


_____ END BUILD LOGS _____

rules_foreign_cc: Build script location: bazel-out/darwin-fastbuild/bin/bazel/m4/logs/Configure_script.sh

rules_foreign_cc: Build log location: bazel-out/darwin-fastbuild/bin/bazel/m4/logs/Configure.log


David Fang

unread,
May 14, 2020, 4:11:49 AM5/14/20
to Enosh Cohen, Verible Developers
Hi there,
There is a known build issue at this time with GNU m4, which is in indirect dependency of Verible.
It was noted here (https://github.com/google/verible#build) but should really be a filed issue.
We could use help chasing down a remedy/workaround.
Things to try: if you happen to have gcc 7+ or can install it easily on Mac OS X, you might be able to use the GCC toolchain (which has been working on linux).
I am very interested in getting clang builds working and continuously tested, Mac or linux.

David


--
You received this message because you are subscribed to the Google Groups "Verible Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/verible-dev/ef89ff74-af1d-4363-a338-cd5703809775%40googlegroups.com.

Thingking Land

unread,
Aug 2, 2020, 1:19:59 AM8/2/20
to Verible Developers
I manually ported verible source code to macOS and debug it with Xcode. Bazel build failed at building flex not at building verible itself. macOS default flex/bison versions are indeed too old to be used. What I did was

1. brew install flex
    brew install bison

to get flex 2.6.4.1 and bison 3.6.4 on macOS.

2. Use /usr/local/opt/flex/bin/flex and /usr/local/opt/bison/bin/bison to replace /usr/bin/flex and /usr/bin/bison in custom build rules.
    Add -I/usr/local/opt/flex/include in clang options.

3. If you want to use Xcode, "git mv" two *.lex files into *.l files.  Xcode recognizes .l, .lpp, .lp, .lxx as Lex files but not .lex.

Otherwise, macOS can successfully build verible source code and debug it with Xcode.

I am not familiar with bazel so I do not know how to modify it. If there is a way to choose preinstalled flex/bison under /usr/local in bazel, the problem may be resolved.

David Fang

unread,
Aug 2, 2020, 1:43:48 AM8/2/20
to Thingking Land, Verible Developers
Hi ThinkingLand,
This is great to hear.  We've actually had some issues with Mac OS X, and you might have the first successful build.  I wasn't even sure Xcode had a chance of building, because we only support bazel at this time.  Would you mind if I shared your notes about building on Mac OS X, either in a github issue or the developer mailing list?

The WORKSPACE file is what tells bazel how to pull in external libraries, including flex and bison (does the equivalent of a local brew install).  We are aware of a problem where one of the transitive dependencies (m4) still fails to bazel build on Mac OS X with clang (which may explain your flex build failure).  

I haven't had any experience pulling in dependencies into bazel from local libraries, but others more knowledgable may be able to chime in and help.
I had to search around for notes and so far found:

Let me know if you're able to make some progress, or can share your notes publicly.

--
You received this message because you are subscribed to the Google Groups "Verible Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-dev...@googlegroups.com.

David Fang

unread,
Aug 2, 2020, 2:24:33 AM8/2/20
to Thingking Land, Verible Developers
Heh, I only now just realized, this was already on the dev-list!

Thingking Land

unread,
Aug 2, 2020, 2:26:00 AM8/2/20
to Verible Developers
I am sorry. I spent a lot of time studying Bazel documentation and searching for examples, but have not figured out how. In gnu make, to choose my own C++ compiler or flex executables, I only need one line like

     CXX := /usr/local/gcc-8.3/bin/g++-8.3
     LEX :=  /usr/local/opt/flex/bin/flex

but I don't know how to do it in bazel.



David Fang

unread,
Aug 2, 2020, 2:34:04 AM8/2/20
to Thingking Land, Verible Developers
I suggest asking on https://groups.google.com/g/bazel-discuss with a pointer to this thread.

--
You received this message because you are subscribed to the Google Groups "Verible Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages