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

invalid type: map, expected a MethodSignature #478

Open
moozzi opened this issue Apr 26, 2023 · 11 comments
Open

invalid type: map, expected a MethodSignature #478

moozzi opened this issue Apr 26, 2023 · 11 comments

Comments

@moozzi
Copy link
Contributor

moozzi commented Apr 26, 2023

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?

@yhara
Copy link
Collaborator

yhara commented Apr 26, 2023

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

@moozzi
Copy link
Contributor Author

moozzi commented Apr 26, 2023

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..

@moozzi
Copy link
Contributor Author

moozzi commented Apr 26, 2023

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?

@yhara
Copy link
Collaborator

yhara commented Apr 26, 2023

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

@moozzi
Copy link
Contributor Author

moozzi commented Apr 27, 2023

I have cmake installed :/

cmake --version
cmake version 3.26.3

@moozzi
Copy link
Contributor Author

moozzi commented Apr 27, 2023

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.jparrowsec.cn-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.jparrowsec.cn-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.jparrowsec.cn-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.jparrowsec.cn-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.jparrowsec.cn-1ecc6299db9ec823/cmake-0.1.46/src/lib.rs:974:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@yhara
Copy link
Collaborator

yhara commented Apr 27, 2023

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
Copy link
Collaborator

yhara commented Apr 30, 2023

Are you using Rosetta2 on M1 mac?

@moozzi
Copy link
Contributor Author

moozzi commented Apr 30, 2023

Yup

@yhara
Copy link
Collaborator

yhara commented May 1, 2023

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

@moozzi
Copy link
Contributor Author

moozzi commented May 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants