chipsalliance / verible

Verible is a suite of SystemVerilog developer tools, including a parser, style-linter, formatter and language server
https://chipsalliance.github.io/verible/
Other
1.35k stars 206 forks source link

Installation not working on macOS after building the binaries #1404

Closed LegendaryPredz closed 1 year ago

LegendaryPredz commented 2 years ago

WARNING: Download from https://mirror.bazel.build/ftp.gnu.org/gnu/bison/bison-3.3.2.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://mirror.bazel.build/github.com/jmillikin/rules_bison/releases/download/v0.1/bison-gnulib-788db09a9f88abbef73c97e8d7291c40455336d8.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://mirror.bazel.build/ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://mirror.bazel.build/github.com/jmillikin/rules_m4/releases/download/v0.1/m4-gnulib-788db09a9f88abbef73c97e8d7291c40455336d8.tar.xz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://mirror.bazel.build/github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found INFO: Analyzed target //:install (0 packages loaded, 0 targets configured). INFO: Found 1 target... Target //:install up-to-date: bazel-bin/_install_gen.sh bazel-bin/install INFO: Elapsed time: 0.742s, Critical Path: 0.48s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action INFO: Build completed successfully, 1 total action

It says that it was successful but there is nothing being installed. Any help?

hzeller commented 2 years ago

How did you invoke bazel ?

LegendaryPredz commented 2 years ago

@hzeller

Getting nothing in bin, usr/bin, or usr/local/bin folder.

hzeller commented 2 years ago

And then the binaries did not show up in ~/bin or /usr/local/bin (your two installation locations), so that it is not working ?

LegendaryPredz commented 2 years ago

Correct. There are no binaries showing in either installation location

hzeller commented 2 years ago

the install routine should've been more resilient after https://github.com/chipsalliance/verible/pull/1396 because it uses the short options for the install program needed in BSD installations (such as macOS). Since you filed this after that was merged it sounds like there might be another reason why this is not working yet.

The strange thing is that there is no error message when you run install. Question: does the directory ~/bin or /usr/local/bin pre-exist on your machine ? It could be that install does not create the directories on your machine and just creates a file with that name containing the binary...

LegendaryPredz commented 2 years ago

The directories ~/bin and ~/usr/local/bin already exist on my machine.

ytliu74 commented 2 years ago

I have a similar problem on m1 MacBook Air as well. Build and test work fine, but installation do not work. No related file is added to ~/bin or /usr/local/bin. Below is the output:

bazel run -c opt :install -- ~/bin WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. INFO: Analyzed target //:install (0 packages loaded, 0 targets configured). INFO: Found 1 target... INFO: From BazelWorkspaceStatusAction stable-status.txt: fatal: No annotated tags can describe '694974a68f104ef5d13d1a105d5e29f5a5f2db61'. However, there were unannotated tags: try --tags. Target //:install up-to-date: bazel-bin/_install_gen.sh bazel-bin/install INFO: Elapsed time: 0.173s, Critical Path: 0.04s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action INFO: Build completed successfully, 1 total action

tymcauley commented 1 year ago

Ya, I just tried this myself. The problem happens at the very start of the install script:

# --- begin runfiles.bash initialization v2 ---
# Copy-pasted from the Bazel Bash runfiles library v2.
f=bazel_tools/tools/bash/runfiles/runfiles.bash
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
  source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
  source "$0.runfiles/$f" 2>/dev/null || \
  source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
  source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
  { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=;
# --- end runfiles.bash initialization v2 ---

If you remove all of the redirects to /dev/null, then you get this output when running the install script:

$ ./bazel-bin/install ~/.local/bin
./bazel-bin/install: line 35: /dev/null/bazel_tools/tools/bash/runfiles/runfiles.bash: Not a directory
$ echo $?
1

Line 35 corresponds to that very first call to source. Not sure why, but it looks like the exit-code-chaining isn't working.

Changing this to supply RUNFILES_DIR gets a bit further:

$ RUNFILES_DIR=./bazel-bin/install.runfiles ./bazel-bin/install ~/.local/bin
install: illegal option -- T
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

This looks like an issue with using BSD install vs GNU install. If you edit ./bazel-bin/install to use ginstall as the binary (the GNU binary, provided by the homebrew formula coreutils), then the script succeeds, and installs the binaries as desired.

hzeller commented 1 year ago

Does it help to just remove the -T flag in the ./baze-bin/install ? Ideally that way we then can keep using the system install instead of relying on ginstall.

This is issue https://github.com/google/bazel_rules_install/issues/31 that I filed with bazel_rules_install a while back. Maybe pinging that could help.

tymcauley commented 1 year ago

Yup, removing the -T flag made it work. I still had to set that environment variable to make that source ... || ... chain work.

hzeller commented 1 year ago

I've now automatically remove the -T in the install script. I don't have a Mac to test; can you try if now building and installing on MacOS works smoothly from latest git ?

tymcauley commented 1 year ago

Thanks @hzeller! That resolved the install: illegal option -- T error. At this point, we still have to deal with the source issue in bazel-bin/install. This comment shows how I worked around that issue: https://github.com/chipsalliance/verible/issues/1404#issuecomment-1400726752

However, this does mean that I can't just run bazel run -c opt :install -- ~/.local/bin, that command still errors out. I have to use that workaround, manually running the command RUNFILES_DIR=./bazel-bin/install.runfiles ./bazel-bin/install ~/.local/bin. The good news now is that running RUNFILES_DIR=./bazel-bin/install.runfiles ./bazel-bin/install ~/.local/bin succeeds, and installs all of the binaries.

hzeller commented 1 year ago

Unfortunately, I don't have access to a Mac, so can't really iterate on a solution here that works here and elsewhere. Ideally, this is something that would be fixed https://github.com/google/bazel_rules_install by someone who knows their way around the MacOS environment.

The homebrew package of Verible side-steps the installation by manually enumerating all the binaries to install:

https://github.com/chipsalliance/homebrew-verible/blob/46664b28ed8f0dfe2d709faf45691cf42d9628b6/Formula/verible.rb#L34-L44

zhutmost commented 1 year ago

I have tried to install from homebrew, or compile from the code. But neither works (same error during compilation). If you can compile one on the CI, I will be glad to help test the executable on my Mac.

hzeller commented 1 year ago

What are the compilation errors you are seeing ?

It should be possible to release binaries built on the CI; until we have #1904 implemented, that is probably the best idea anyway.

zhutmost commented 1 year ago

Hi @hzeller , thanks for you quick reply. I recompiled today. It looks a bit different two days ago (still fail but other bugs). See below:

image

I am not familiar with Bazel/C++ compilation, so I have no idea to fix it. :(

I mean that, can we provide a prebuilt binary for homebrew (maybe one for intel and one for apple silicon)? Current installation from brew (i.e. compiling from code with Bazel) often fails.

hzeller commented 1 year ago

Interesting, it looks like the compilation picks up a header from the system (/usr/local/include) in addition to the actual header it should use (external/com_google_boringssl/...). I have a suspicion, addressed in #1970

hzeller commented 1 year ago

can you git pull and try again ?

zhutmost commented 1 year ago
image
zhutmost commented 1 year ago

@hzeller Still fail but other bugs (It seems that I have met these bugs).

Note that I used local bison & flex installed by brew.

hzeller commented 1 year ago

Can you tell me the version number of flex and bison on your machine ?

flex --version
bison --version
zhutmost commented 1 year ago

OS: Darwin XXXX-MacBookPro.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64

bison: 3.8.2 flex: 2.6.4 I just downloaded them form homebrew and then added to PATH.

I have downloaded the prebuilt binary from the GITHUB Release page. I tried the verible-verlog-ls, and it looks good.

zhutmost commented 1 year ago

@hzeller I tried lang server downloaded from release on a custom IDE platform, and it works (at least lint). But Verible extension in VSCode cannot support downloaded binary on macOS.

image
hzeller commented 1 year ago

Ah good point. Now that I have added the macOS binaries in the release it should be possible to modify

verilog/tools/ls/vscode/src/download-ls.ts to not write the message anymore for macos, but downloads the published version instead.

Then build it locally to test it it now downloads.

Since I don't have a mac to test, would you like to get this going and then send a pull request ?

zhutmost commented 1 year ago

So are these messages just ignorable warning messages?! I have added binary to PATH, but vscode do not use them in PATH. Looks that the function checkIfBinaryExists(binaryPath: string) doesn't work on macOS?

hzeller commented 1 year ago

Yes, if the binary is in your path, it would just work. If it does not find verible in the $PATH, it attempts to download it, so that is when the message is happening.

zhutmost commented 1 year ago

ignore me. When I change the extension settings from the default “verible-verilog-ls” to a specific path “/...../...../...../bin/verible-verilog-ls”. it can use my downloaded one automatically. Let me try your proposal. but tomorrow, it is too late today. :D

zhutmost commented 1 year ago

Yes, if the binary is in your path, it would just work. If it does not find verible in the $PATH, it attempts to download it, so that is when the message is happening.

Ahh, but I have added them to PATH. and it cannot find it, until I tell vscode its complete path. command -v works well.

image
zhutmost commented 1 year ago

I am not sure whether it is just due to my local environment. So you can ignore it temporarily, if nobody else reports.

zhutmost commented 1 year ago

@hzeller The situation is strange. I cloned the variable repo (master branch), and run bazel build:

bazel build --jobs=12 -c opt //...

and it failed. (still the multi header definition bug:

~/Workspace/linter/verible master ························································ 6s  base 01:01:36
❯ bazel build --jobs=12 -c opt //...
Starting local Bazel server and connecting to it...
INFO: Analyzed 1898 targets (146 packages loaded, 6269 targets configured).
INFO: Found 1898 targets...
INFO: From Linking external/com_google_absl/absl/base/libbase.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/base/_objs/base/unscaledcycleclock.o has no symbols
INFO: From Linking external/com_google_absl/absl/types/libbad_optional_access.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/_objs/bad_optional_access/bad_optional_access.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/libbad_optional_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/flags/libflag.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/flags/_objs/flag/flag.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_absl/absl/flags/libflag.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/debugging/libdebugging_internal.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/debugging/_objs/debugging_internal/elf_mem_image.o has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/debugging/_objs/debugging_internal/vdso_support.o has no symbols
INFO: From Linking external/com_google_absl/absl/crc/libcrc32c.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/crc/_objs/crc32c/crc_memcpy_x86_64.o has no symbols
INFO: From Linking external/com_google_absl/absl/types/libbad_any_cast_impl.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/_objs/bad_any_cast_impl/bad_any_cast.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/libbad_any_cast_impl.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/types/libbad_variant_access.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/_objs/bad_variant_access/bad_variant_access.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_absl/absl/types/libbad_variant_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/log/liblog_entry.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/log/_objs/log_entry/log_entry.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_absl/absl/log/liblog_entry.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/strings/libcord.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_absl/absl/strings/_objs/cord/cord_buffer.o has no symbols
INFO: From Compiling gnulib/lib/vasnprintf.c [for tool]:
external/m4_v1.4.18/gnulib/lib/vasnprintf.c:3185:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf ((char *) p, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/m4_v1.4.18/gnulib/lib/vasnprintf.c:3193:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf (expbuf, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/m4_v1.4.18/gnulib/lib/vasnprintf.c:3336:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf ((char *) p, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/m4_v1.4.18/gnulib/lib/vasnprintf.c:3344:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf (expbuf, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
4 warnings generated.
INFO: From Compiling gnulib/lib/vasnprintf.c [for tool]:
external/bison_v3.3.2/gnulib/lib/vasnprintf.c:3185:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf ((char *) p, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/bison_v3.3.2/gnulib/lib/vasnprintf.c:3193:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf (expbuf, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/bison_v3.3.2/gnulib/lib/vasnprintf.c:3336:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf ((char *) p, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
external/bison_v3.3.2/gnulib/lib/vasnprintf.c:3344:35: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                                  sprintf (expbuf, "%+d", exponent);
                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
4 warnings generated.
INFO: From Compiling src/parse-gram.c [for tool]:
src/parse-gram.c:2029:9: warning: variable 'gram_nerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs;
        ^
src/parse-gram.c:80:25: note: expanded from macro 'yynerrs'
#define yynerrs         gram_nerrs
                        ^
1 warning generated.
INFO: From Compiling src/misc.c [for tool]:
external/flex_v2.6.4/src/misc.c:515:40: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                        esc_char = (unsigned char) strtoul (array + 1, NULL, 8);
                                                            ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:175:23: note: passing argument to parameter '__str' here
         strtoul(const char *__str, char **__endptr, int __base);
                             ^
external/flex_v2.6.4/src/misc.c:537:40: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                        esc_char = (unsigned char) strtoul (array + 2, NULL, 16);
                                                            ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:175:23: note: passing argument to parameter '__str' here
         strtoul(const char *__str, char **__endptr, int __base);
                             ^
2 warnings generated.
INFO: From Executing genrule //verilog/parser:verilog-lex:
verilog/parser/verilog.lex:303: warning, rule cannot be matched
verilog/parser/verilog.lex:943: warning, rule cannot be matched
INFO: From Linking external/com_google_absl/absl/log/liblog_entry.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/log/_objs/log_entry/log_entry.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/log/liblog_entry.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/types/libbad_optional_access.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/types/_objs/bad_optional_access/bad_optional_access.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/types/libbad_optional_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/base/libbase.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/base/_objs/base/unscaledcycleclock.o has no symbols
INFO: From Linking verilog/CST/libverilog-matchers.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/verilog/CST/_objs/verilog-matchers/verilog_matchers.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/verilog/CST/libverilog-matchers.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/crc/libcrc32c.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/crc/_objs/crc32c/crc_memcpy_x86_64.o has no symbols
INFO: From Linking external/com_google_absl/absl/strings/libcord.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/strings/_objs/cord/cord_buffer.o has no symbols
INFO: From Linking external/com_google_absl/absl/types/libbad_variant_access.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/types/_objs/bad_variant_access/bad_variant_access.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/types/libbad_variant_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/debugging/libdebugging_internal.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/debugging/_objs/debugging_internal/elf_mem_image.o has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/debugging/_objs/debugging_internal/vdso_support.o has no symbols
INFO: From Linking external/com_google_absl/absl/flags/libflag.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/flags/_objs/flag/flag.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_absl/absl/flags/libflag.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Compiling verilog/parser/verilog-final.tab.cc:
bazel-out/darwin-opt/bin/verilog/parser/verilog.tab.cc:12998:9: warning: variable 'verilog_nerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs;
        ^
bazel-out/darwin-opt/bin/verilog/parser/verilog-final.tab.cc:72:25: note: expanded from macro 'yynerrs'
#define yynerrs         verilog_nerrs
                        ^
1 warning generated.
INFO: From Executing genrule //verilog/parser:verilog-lex [for tool]:
verilog/parser/verilog.lex:303: warning, rule cannot be matched
verilog/parser/verilog.lex:943: warning, rule cannot be matched
INFO: From Compiling verilog/parser/verilog-final.tab.cc [for tool]:
bazel-out/darwin-opt-exec-2B5CBBC6/bin/verilog/parser/verilog.tab.cc:12998:9: warning: variable 'verilog_nerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs;
        ^
bazel-out/darwin-opt-exec-2B5CBBC6/bin/verilog/parser/verilog-final.tab.cc:72:25: note: expanded from macro 'yynerrs'
#define yynerrs         verilog_nerrs
                        ^
1 warning generated.
INFO: From Executing genrule //common/analysis:command-file-lex [for tool]:
common/analysis/command_file.lex:77: warning, rule cannot be matched
INFO: From Linking verilog/CST/libverilog-matchers.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/verilog/CST/_objs/verilog-matchers/verilog_matchers.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/verilog/CST/libverilog-matchers.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Compiling verilog/parser/verilog-final.tab.cc:
bazel-out/darwin-opt/bin/verilog/parser/verilog.tab.cc:12998:9: warning: variable 'verilog_nerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs;
        ^
bazel-out/darwin-opt/bin/verilog/parser/verilog-final.tab.cc:72:25: note: expanded from macro 'yynerrs'
#define yynerrs         verilog_nerrs
                        ^
1 warning generated.
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a [for tool]:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/io/_objs/io_win32/io_win32.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: bazel-out/darwin-opt/bin/external/com_google_protobuf/src/google/protobuf/io/_objs/io_win32/io_win32.o has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin-opt/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Executing genrule //common/analysis:command-file-lex:
common/analysis/command_file.lex:77: warning, rule cannot be matched
ERROR: /private/var/tmp/_bazel_zhutmost/26c0866f5dae2ba95d124db1b727a739/external/com_google_boringssl/BUILD:136:11: Compiling err_data.c failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target @com_google_boringssl//:crypto) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 43 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:21:
/usr/local/include/openssl/e_os2.h:183:11: error: 'OPENSSL_EXPORT' macro redefined [-Werror,-Wmacro-redefined]
#  define OPENSSL_EXPORT extern
          ^
external/com_google_boringssl/src/include/openssl/base.h:135:9: note: previous definition is here
#define OPENSSL_EXPORT
        ^
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:28:
/usr/local/include/openssl/types.h:74:13: error: typedef redefinition with different types ('int' vs 'struct asn1_null_st')
typedef int ASN1_NULL;
            ^
external/com_google_boringssl/src/include/openssl/base.h:261:29: note: previous definition is here
typedef struct asn1_null_st ASN1_NULL;
                            ^
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:28:
/usr/local/include/openssl/types.h:106:26: error: typedef redefinition with different types ('struct evp_md_st' vs 'struct env_md_st')
typedef struct evp_md_st EVP_MD;
                         ^
external/com_google_boringssl/src/include/openssl/base.h:328:26: note: previous definition is here
typedef struct env_md_st EVP_MD;
                         ^
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:28:
/usr/local/include/openssl/types.h:107:30: error: typedef redefinition with different types ('struct evp_md_ctx_st' vs 'struct env_md_ctx_st')
typedef struct evp_md_ctx_st EVP_MD_CTX;
                             ^
external/com_google_boringssl/src/include/openssl/base.h:327:30: note: previous definition is here
typedef struct env_md_ctx_st EVP_MD_CTX;
                             ^
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:28:
/usr/local/include/openssl/types.h:133:34: error: typedef redefinition with different types ('struct evp_Encode_Ctx_st' vs 'struct evp_encode_ctx_st')
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
                                 ^
external/com_google_boringssl/src/include/openssl/base.h:333:34: note: previous definition is here
typedef struct evp_encode_ctx_st EVP_ENCODE_CTX;
                                 ^
In file included from external/com_google_boringssl/err_data.c:18:
In file included from /usr/local/include/openssl/err.h:29:
In file included from /usr/local/include/openssl/bio.h:30:
/usr/local/include/openssl/crypto.h:308:3: error: typedef redefinition with different types ('struct crypto_threadid_st' vs 'int')
} CRYPTO_THREADID;
  ^
external/com_google_boringssl/src/include/openssl/base.h:257:13: note: previous definition is here
typedef int CRYPTO_THREADID;
            ^
external/com_google_boringssl/err_data.c:33:1: error: static_assert failed due to requirement '13 == 12' "library value changed"
static_assert(ERR_LIB_ASN1 == 12, "library value changed");
^             ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:34:1: error: static_assert failed due to requirement '14 == 13' "library value changed"
static_assert(ERR_LIB_CONF == 13, "library value changed");
^             ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:35:1: error: static_assert failed due to requirement '15 == 14' "library value changed"
static_assert(ERR_LIB_CRYPTO == 14, "library value changed");
^             ~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:36:1: error: static_assert failed due to requirement '16 == 15' "library value changed"
static_assert(ERR_LIB_EC == 15, "library value changed");
^             ~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:37:1: error: static_assert failed due to requirement '20 == 16' "library value changed"
static_assert(ERR_LIB_SSL == 16, "library value changed");
^             ~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:38:1: error: static_assert failed due to requirement '32 == 17' "library value changed"
static_assert(ERR_LIB_BIO == 17, "library value changed");
^             ~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:39:1: error: static_assert failed due to requirement '33 == 18' "library value changed"
static_assert(ERR_LIB_PKCS7 == 18, "library value changed");
^             ~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:40:15: error: use of undeclared identifier 'ERR_LIB_PKCS8'
static_assert(ERR_LIB_PKCS8 == 19, "library value changed");
              ^
external/com_google_boringssl/err_data.c:41:1: error: static_assert failed due to requirement '34 == 20' "library value changed"
static_assert(ERR_LIB_X509V3 == 20, "library value changed");
^             ~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:42:1: error: static_assert failed due to requirement '36 == 21' "library value changed"
static_assert(ERR_LIB_RAND == 21, "library value changed");
^             ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:43:1: error: static_assert failed due to requirement '38 == 22' "library value changed"
static_assert(ERR_LIB_ENGINE == 22, "library value changed");
^             ~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:44:1: error: static_assert failed due to requirement '39 == 23' "library value changed"
static_assert(ERR_LIB_OCSP == 23, "library value changed");
^             ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
external/com_google_boringssl/err_data.c:45:1: error: static_assert failed due to requirement '40 == 24' "library value changed"
static_assert(ERR_LIB_UI == 24, "library value changed");
^             ~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:113:23: note: expanded from macro 'static_assert'
#define static_assert _Static_assert
                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
INFO: Elapsed time: 311.015s, Critical Path: 32.43s
INFO: 2936 processes: 1105 internal, 1831 darwin-sandbox.
FAILED: Build did NOT complete successfully

This is my path:

❯ echo $PATH
/Users/zhutmost/Software/verible/bin:/Users/zhutmost/Software/circt/bin:/Users/zhutmost/Software/mill:/Users/zhutmost/Software/svls:/Users/zhutmost/Software/jetbrains-toolbox/scripts:/usr/local/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/zhutmost/Software/verible/bin:/Users/zhutmost/Software/circt/bin:/Users/zhutmost/Software/mill:/Users/zhutmost/Software/svls:/Users/zhutmost/Software/jetbrains-toolbox/scripts:/usr/local/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin:/Users/zhutmost/Library/pnpm:/usr/local/Caskroom/miniforge/base/bin:/usr/local/Caskroom/miniforge/base/condabin

I am not sure which part is different from your CI environment. And I also forked your repo, but the CI cannot run on my account, due to the deployment setting.

zhutmost commented 1 year ago

I am not sure whether it is just due to my local environment. So you can ignore it temporarily, if nobody else reports.

The issue about that vscode cannot find lang server from PATH, is fixed. It is due to that VScode won't update its PATH environment, until its process is completely killed and restarted.

I still cannot compile from scratch.

hzeller commented 1 year ago

Are you building from head ? The openssl issue should've been fixed with #1970

zhutmost commented 1 year ago

@hzeller yes I am sure.

zhutmost commented 1 year ago

Anyway we can change the homebrew rb setting to the prebuilt macOS binary now.

zhutmost commented 1 year ago

It looks good on my Mac. Lint on the fly:

image

Format also works.