shiika icon indicating copy to clipboard operation
shiika copied to clipboard

invalid type: map, expected a MethodSignature

Open AI-Mozi opened this issue 1 year ago • 11 comments

Hey! Every time I try to run tests or any other programs this error appears.

Error: builtin exports is broken

Caused by:
    invalid type: map, expected a MethodSignature at line 13 column 14

Is it a known issue or something related to my machine?

AI-Mozi avatar Apr 26 '23 10:04 AI-Mozi

Oh, you may need to rebuild the core library by cargo run -- build-corelib

yhara avatar Apr 26 '23 10:04 yhara

Thanks, that was it. Now I have to deal with other errors 😅 Like failed to run custom build command for 'bdwgc-alloc v0.6.0' when doing cargo build in skc_rustlib Sometimes I get sick of mac..

AI-Mozi avatar Apr 26 '23 13:04 AI-Mozi

Oh, I found why. It's bdwgc-alloc = { version = "0.6.0", default-features=false, features = ["cmake"] } When i change it to { version = "0.6.0" } only its working Is it a big deal to remove default-features and features?

AI-Mozi avatar Apr 26 '23 13:04 AI-Mozi

The default-features=false, features = ["cmake"] part is introduced to support Windows. So could you try brew install cmake?

yhara avatar Apr 26 '23 13:04 yhara

I have cmake installed :/

cmake --version
cmake version 3.26.3

AI-Mozi avatar Apr 27 '23 06:04 AI-Mozi

This is the whole message

error: failed to run custom build command for `bdwgc-alloc v0.6.0`

Caused by:
  process didn't exit successfully: `/Users/mozi/development/rust/shiika/target/debug/build/bdwgc-alloc-ffb3855a7bc2ccef/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-apple-darwin = None
  CMAKE_GENERATOR_aarch64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
  CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-apple-darwin = None
  CMAKE_aarch64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = None
  running: cd "/Users/mozi/development/rust/shiika/target/debug/build/bdwgc-alloc-cc6a91dd80652f6d/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/mozi/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/bdwgc" "-DBUILD_SHARED_LIBS=FALSE" "-DCMAKE_INSTALL_PREFIX=/Users/mozi/development/rust/shiika/target/debug/build/bdwgc-alloc-cc6a91dd80652f6d/out" "-DCMAKE_C_FLAGS= -I/Users/mozi/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/src -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is AppleClang 13.1.6.13160021
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc - broken
  -- Configuring incomplete, errors occurred!

  --- stderr
  CMake Error at /opt/homebrew/Cellar/cmake/3.26.3/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
    The C compiler

      "/usr/bin/cc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/mozi/development/rust/shiika/target/debug/build/bdwgc-alloc-cc6a91dd80652f6d/out/build/CMakeFiles/CMakeScratch/TryCompile-jx5T0s

      Run Build Command(s):/opt/homebrew/Cellar/cmake/3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_05c75/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_05c75.dir/build.make CMakeFiles/cmTC_05c75.dir/build
      Building C object CMakeFiles/cmTC_05c75.dir/testCCompiler.c.o
      /usr/bin/cc   -I/Users/mozi/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/src -ffunction-sections -fdata-sections -fPIC -arch arm64  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -MD -MT CMakeFiles/cmTC_05c75.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_05c75.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_05c75.dir/testCCompiler.c.o -c /Users/mozi/development/rust/shiika/target/debug/build/bdwgc-alloc-cc6a91dd80652f6d/out/build/CMakeFiles/CMakeScratch/TryCompile-jx5T0s/testCCompiler.c
      Linking C executable cmTC_05c75
      /opt/homebrew/Cellar/cmake/3.26.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05c75.dir/link.txt --verbose=1
      /usr/bin/cc  -I/Users/mozi/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/src -ffunction-sections -fdata-sections -fPIC -arch arm64  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm@12/lib  CMakeFiles/cmTC_05c75.dir/testCCompiler.c.o -o cmTC_05c75
      ld: warning: dylib (/opt/homebrew/opt/llvm@12/lib/libunwind.dylib) was built for newer macOS version (13.0) than being linked (12.3)
      ld: warning: dylib (/opt/homebrew/opt/llvm@12/lib/libunwind.dylib) was built for newer macOS version (13.0) than being linked (12.3)
      ld: in '/opt/homebrew/opt/llvm@12/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[1]: *** [cmTC_05c75] Error 1
      make: *** [cmTC_05c75/fast] Error 2





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:30 (project)


  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /Users/mozi/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.46/src/lib.rs:974:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

AI-Mozi avatar Apr 27 '23 06:04 AI-Mozi

According to the log,

  1. cargo tried to build bdwgc-alloc

  2. bdwgc-alloc needs bdwgc, so tried to build it with cmake

  3. cmake looked for a working C compiler and tried to compile a simple test program

  4. It failed with this error:

     ld: in '/opt/homebrew/opt/llvm@12/lib/libunwind.dylib', building for macOS-x86_64 
     but attempting to link with file built for macOS-arm64
    

yhara avatar Apr 27 '23 15:04 yhara

Are you using Rosetta2 on M1 mac?

yhara avatar Apr 30 '23 14:04 yhara

Yup

AI-Mozi avatar Apr 30 '23 15:04 AI-Mozi

Maybe you need to run brew install llvm@12 and cargo run -- build-corelib both on Rosetta2, or both without Rosetta2. I have not installed Rosetta2 so this is my guess though

yhara avatar May 01 '23 09:05 yhara

I've got it installed on both.. For now I can stay with autotools on my local machine, but I wouldn't close this issue, maybe there will be someone with similar problem :D

AI-Mozi avatar May 01 '23 10:05 AI-Mozi