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

Compilation failed on macOS Sonoma, Apple Silicon #12920

Closed
laofan13 opened this issue Oct 17, 2023 · 7 comments
Closed

Compilation failed on macOS Sonoma, Apple Silicon #12920

laofan13 opened this issue Oct 17, 2023 · 7 comments
Labels
type/bug Something isn't working

Comments

@laofan13
Copy link

Describe the bug

Environment:
Homebrew clang version 17.0.2
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin

Error message/log

ld: warning: -bind_at_load is deprecated on macOS
  ld: warning: -bind_at_load is deprecated on macOS
  ld: multiple errors: archive member '/' not a mach-o file in '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotoc.a'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [protoc] Error 1
  make: *** [install-recursive] Error 1
  thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/autotools-0.2.6/src/lib.rs:781:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:619:5
     1: core::panicking::panic_fmt
               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/panicking.rs:72:14
     2: autotools::fail
     3: autotools::Config::build
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[cargo-make] ERROR - Unable to execute script.
[cargo-make] WARN - Build Failed.

To Reproduce

No response

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

No response

@laofan13 laofan13 added the type/bug Something isn't working label Oct 17, 2023
@github-actions github-actions bot added this to the release-1.4 milestone Oct 17, 2023
@laofan13 laofan13 changed the title Compilation failed on macos Compilation failed on macOS Sonoma, Apple Silicon Oct 17, 2023
@xxchan
Copy link
Member

xxchan commented Oct 17, 2023 via email

@laofan13
Copy link
Author

laofan13 commented Oct 17, 2023

Can you post the full log here? Don't know if it's because Apple introduced a new linker in xcode 15.

Hi, here are all log

 running: cd "~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build" && MAKEFLAGS="-j --jobserver-fds=7,8 --jobserver-auth=7,8" "sh" "-c" "exec \"$0\" \"$@\"" "make" "install"
  Making install in .
  make[2]: Nothing to be done for `install-exec-am'.
   ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/install-sh -c -d '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/lib/pkgconfig'
   /usr/bin/install -c -m 644 protobuf.pc protobuf-lite.pc '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/lib/pkgconfig'
  Making install in src
    CXX      google/protobuf/wire_format.lo
    CXX      google/protobuf/wrappers.pb.lo
    CXX      google/protobuf/compiler/code_generator.lo
    CXX      google/protobuf/compiler/command_line_interface.lo
    CXX      google/protobuf/compiler/plugin.lo
    CXX      google/protobuf/compiler/plugin.pb.lo
    CXX      google/protobuf/compiler/subprocess.lo
    CXX      google/protobuf/compiler/zip_writer.lo
    CXX      google/protobuf/compiler/main.o
    CXX      google/protobuf/any_lite.lo
    CXX      google/protobuf/arena.lo
    CXX      google/protobuf/arenastring.lo
    CXX      google/protobuf/arenaz_sampler.lo
    CXX      google/protobuf/extension_set.lo
    CXX      google/protobuf/generated_enum_util.lo
    CXX      google/protobuf/generated_message_tctable_lite.lo
    CXX      google/protobuf/generated_message_util.lo
    CXX      google/protobuf/implicit_weak_message.lo
    CXX      google/protobuf/inlined_string_field.lo
    CXX      google/protobuf/io/coded_stream.lo
    CXX      google/protobuf/io/io_win32.lo
    CXX      google/protobuf/io/strtod.lo
    CXX      google/protobuf/io/zero_copy_stream.lo
    CXX      google/protobuf/io/zero_copy_stream_impl.lo
    CXX      google/protobuf/io/zero_copy_stream_impl_lite.lo
    CXX      google/protobuf/map.lo
    CXX      google/protobuf/message_lite.lo
    CXX      google/protobuf/parse_context.lo
    CXX      google/protobuf/repeated_field.lo
    CXX      google/protobuf/repeated_ptr_field.lo
    CXX      google/protobuf/stubs/bytestream.lo
    CXX      google/protobuf/stubs/common.lo
    CXX      google/protobuf/stubs/int128.lo
    CXX      google/protobuf/stubs/status.lo
    CXX      google/protobuf/stubs/statusor.lo
    CXX      google/protobuf/stubs/stringpiece.lo
    CXX      google/protobuf/stubs/stringprintf.lo
    CXX      google/protobuf/stubs/structurally_valid.lo
    CXX      google/protobuf/stubs/strutil.lo
    CXX      google/protobuf/stubs/time.lo
    CXX      google/protobuf/wire_format_lite.lo
    CXX      google/protobuf/any.lo
    CXX      google/protobuf/any.pb.lo
    CXX      google/protobuf/api.pb.lo
    CXX      google/protobuf/compiler/importer.lo
    CXX      google/protobuf/compiler/parser.lo
    CXX      google/protobuf/descriptor.lo
    CXX      google/protobuf/descriptor.pb.lo
    CXX      google/protobuf/descriptor_database.lo
    CXX      google/protobuf/duration.pb.lo
    CXX      google/protobuf/dynamic_message.lo
    CXX      google/protobuf/empty.pb.lo
    CXX      google/protobuf/extension_set_heavy.lo
    CXX      google/protobuf/field_mask.pb.lo
    CXX      google/protobuf/generated_message_bases.lo
    CXX      google/protobuf/generated_message_reflection.lo
    CXX      google/protobuf/generated_message_tctable_full.lo
    CXX      google/protobuf/io/gzip_stream.lo
    CXX      google/protobuf/io/printer.lo
    CXX      google/protobuf/io/tokenizer.lo
    CXX      google/protobuf/map_field.lo
    CXX      google/protobuf/message.lo
    CXX      google/protobuf/reflection_ops.lo
    CXX      google/protobuf/service.lo
    CXX      google/protobuf/source_context.pb.lo
    CXX      google/protobuf/struct.pb.lo
    CXX      google/protobuf/stubs/substitute.lo
    CXX      google/protobuf/text_format.lo
    CXX      google/protobuf/timestamp.pb.lo
    CXX      google/protobuf/type.pb.lo
    CXX      google/protobuf/unknown_field_set.lo
    CXX      google/protobuf/util/delimited_message_util.lo
    CXX      google/protobuf/util/field_comparator.lo
    CXX      google/protobuf/util/field_mask_util.lo
    CXX      google/protobuf/util/internal/datapiece.lo
    CXX      google/protobuf/util/internal/default_value_objectwriter.lo
    CXX      google/protobuf/util/internal/error_listener.lo
    CXX      google/protobuf/util/internal/field_mask_utility.lo
    CXX      google/protobuf/util/internal/json_escaping.lo
    CXX      google/protobuf/util/internal/json_objectwriter.lo
    CXX      google/protobuf/util/internal/json_stream_parser.lo
    CXX      google/protobuf/util/internal/object_writer.lo
    CXX      google/protobuf/util/internal/proto_writer.lo
    CXX      google/protobuf/util/internal/protostream_objectsource.lo
    CXX      google/protobuf/util/internal/protostream_objectwriter.lo
    CXX      google/protobuf/util/internal/type_info.lo
    CXX      google/protobuf/util/internal/utility.lo
    CXX      google/protobuf/util/json_util.lo
    CXX      google/protobuf/util/message_differencer.lo
    CXX      google/protobuf/util/time_util.lo
    CXX      google/protobuf/util/type_resolver_util.lo
    CXX      google/protobuf/compiler/cpp/enum.lo
    CXX      google/protobuf/compiler/cpp/extension.lo
    CXX      google/protobuf/compiler/cpp/enum_field.lo
    CXX      google/protobuf/compiler/cpp/field.lo
    CXX      google/protobuf/compiler/cpp/file.lo
    CXX      google/protobuf/compiler/cpp/generator.lo
    CXX      google/protobuf/compiler/cpp/helpers.lo
    CXX      google/protobuf/compiler/cpp/map_field.lo
    CXX      google/protobuf/compiler/cpp/message.lo
    CXX      google/protobuf/compiler/cpp/message_field.lo
    CXX      google/protobuf/compiler/cpp/padding_optimizer.lo
    CXX      google/protobuf/compiler/cpp/parse_function_generator.lo
    CXX      google/protobuf/compiler/cpp/primitive_field.lo
    CXX      google/protobuf/compiler/cpp/service.lo
    CXX      google/protobuf/compiler/cpp/string_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_doc_comment.lo
    CXX      google/protobuf/compiler/csharp/csharp_enum.lo
    CXX      google/protobuf/compiler/csharp/csharp_enum_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_field_base.lo
    CXX      google/protobuf/compiler/csharp/csharp_generator.lo
    CXX      google/protobuf/compiler/csharp/csharp_helpers.lo
    CXX      google/protobuf/compiler/csharp/csharp_map_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_message.lo
    CXX      google/protobuf/compiler/csharp/csharp_message_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_primitive_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_reflection_class.lo
    CXX      google/protobuf/compiler/csharp/csharp_repeated_enum_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_repeated_message_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_repeated_primitive_field.lo
    CXX      google/protobuf/compiler/csharp/csharp_source_generator_base.lo
    CXX      google/protobuf/compiler/csharp/csharp_wrapper_field.lo
    CXX      google/protobuf/compiler/java/context.lo
    CXX      google/protobuf/compiler/java/doc_comment.lo
    CXX      google/protobuf/compiler/java/enum.lo
    CXX      google/protobuf/compiler/java/enum_field.lo
    CXX      google/protobuf/compiler/java/enum_field_lite.lo
    CXX      google/protobuf/compiler/java/enum_lite.lo
    CXX      google/protobuf/compiler/java/extension.lo
    CXX      google/protobuf/compiler/java/extension_lite.lo
    CXX      google/protobuf/compiler/java/field.lo
    CXX      google/protobuf/compiler/java/file.lo
    CXX      google/protobuf/compiler/java/generator.lo
    CXX      google/protobuf/compiler/java/generator_factory.lo
    CXX      google/protobuf/compiler/java/helpers.lo
    CXX      google/protobuf/compiler/java/kotlin_generator.lo
    CXX      google/protobuf/compiler/java/map_field.lo
    CXX      google/protobuf/compiler/java/map_field_lite.lo
    CXX      google/protobuf/compiler/java/message.lo
    CXX      google/protobuf/compiler/java/message_builder.lo
    CXX      google/protobuf/compiler/java/message_builder_lite.lo
    CXX      google/protobuf/compiler/java/message_field.lo
    CXX      google/protobuf/compiler/java/message_field_lite.lo
    CXX      google/protobuf/compiler/java/message_lite.lo
    CXX      google/protobuf/compiler/java/name_resolver.lo
    CXX      google/protobuf/compiler/java/primitive_field.lo
    CXX      google/protobuf/compiler/java/primitive_field_lite.lo
    CXX      google/protobuf/compiler/java/service.lo
    CXX      google/protobuf/compiler/java/shared_code_generator.lo
    CXX      google/protobuf/compiler/java/string_field.lo
    CXX      google/protobuf/compiler/java/string_field_lite.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_enum.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_enum_field.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_extension.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_field.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_file.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_generator.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_helpers.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_map_field.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_message.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_message_field.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_oneof.lo
    CXX      google/protobuf/compiler/objectivec/objectivec_primitive_field.lo
    CXX      google/protobuf/compiler/php/php_generator.lo
    CXX      google/protobuf/compiler/python/generator.lo
    CXX      google/protobuf/compiler/python/helpers.lo
    CXX      google/protobuf/compiler/python/pyi_generator.lo
    CXX      google/protobuf/compiler/ruby/ruby_generator.lo
    CXXLD    libprotobuf-lite.la
    CXXLD    libprotobuf.la
    CXXLD    libprotoc.la
  copying selected object files to avoid basename conflicts...
    CXXLD    protoc

  --- stderr
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  In file included from ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:36:
 ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_impl.h:256:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    256 | }
        | ^
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:57:15: note: in instantiation of function template specialization 'google::protobuf::internal::AlignFail<4UL>' requested here
     57 | template void AlignFail<4>(uintptr_t);
        |               ^
  In file included from ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:36:
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_impl.h:256:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    256 | }
        | ^
 ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:58:15: note: in instantiation of function template specialization 'google::protobuf::internal::AlignFail<8UL>' requested here
     58 | template void AlignFail<8>(uintptr_t);
        |               ^
  In file included from ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:36:
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_impl.h:256:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    256 | }
        | ^
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_impl.h:384:7: note: in instantiation of function template specialization 'google::protobuf::internal::AlignFail<1UL>' requested here
    384 |       AlignFail<alignof(T)>(reinterpret_cast<uintptr_t>(target));
        |       ^
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:1515:5: note: in instantiation of function template specialization 'google::protobuf::internal::TcParser::RefAt<bool>' requested here
   1515 |     RefAt<bool>(msg, entry.offset) = static_cast<bool>(tmp);
        |     ^
 ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:347:14: warning: unused function 'Offset' [-Wunused-function]
    347 | inline void* Offset(void* base, uint32_t offset) {
        |              ^~~~~~
  4 warnings generated.
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/stubs/strutil.cc:506:11: 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]
    506 |           sprintf(dest + used, (use_hex ? "\\x%02x" : "\\%03o"),
        |           ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
    180 | __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/MacOSX14.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
    215 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
        |                                                       ^
  1 warning generated.
  ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protobuf-src-1.1.0+21.5/protobuf/src/google/protobuf/compiler/cpp/helpers.cc:197:25: warning: unused function 'VerifyInt32TypeToVerifyCustom' [-Wunused-function]
    197 | inline VerifySimpleType VerifyInt32TypeToVerifyCustom(VerifyInt32Type t) {
        |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.
  ld: warning: -bind_at_load is deprecated on macOS
  ld: warning: -bind_at_load is deprecated on macOS
  ld: multiple errors: archive member '/' not a mach-o file in '~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in ''~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in ''~/risingwave/target/debug/build/protobuf-src-d9b7156dc4fddede/out/install/build/src/.libs/libprotoc.a'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [protoc] Error 1
  make: *** [install-recursive] Error 1
  thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/autotools-0.2.6/src/lib.rs:781:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:619:5
     1: core::panicking::panic_fmt
               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/panicking.rs:72:14
     2: autotools::fail
     3: autotools::Config::build
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[cargo-make] ERROR - Unable to execute script.
[cargo-make] WARN - Build Failed.

@rybalkoss
Copy link

"archive member '/' not a mach-o file" - I have the same error when building some small project, seems that macos issue

@fuyufjh fuyufjh modified the milestones: release-1.4, release-1.5 Nov 8, 2023
@fuyufjh fuyufjh added the help wanted Issues that need help from contributors label Nov 8, 2023
@fuyufjh
Copy link
Member

fuyufjh commented Nov 9, 2023

Cannot reproduce locally. We also develop RisingWave on M1 mac.

Googled and found similar issues on other projects, such as https://stackoverflow.com/a/74335326

There may be some bugs in Rust macos-arm64 target.

@fuyufjh fuyufjh removed the help wanted Issues that need help from contributors label Nov 9, 2023
@fuyufjh fuyufjh removed this from the release-1.5 milestone Nov 9, 2023
@rybalkoss
Copy link

@fuyufjh I've reproduced issue on minimal build example, https://stackoverflow.com/q/77444892/11335766

@xxchan
Copy link
Member

xxchan commented Nov 20, 2023

I cannot reproduce on Sonoma. Did you have any config in ~/.cargo/config.toml?

@xxchan
Copy link
Member

xxchan commented Dec 6, 2023

Close for now since no updates and not reproducible. Feel free to leave new comments or create a new issue if there's update!

@xxchan xxchan closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants