Bend icon indicating copy to clipboard operation
Bend copied to clipboard

Can't install Bend lang on Mac

Open rucin93 opened this issue 2 years ago • 3 comments

Describe the bug I'm trying to install Bend lang as given in docs, but during installation i'm getting error. I have installed clang, llvm. I've downloaded specific version of nightly (nightly-2024-01-27) to be the same as inside rust-toolchain. Stacktrace:

❯ cargo +nightly install bend-lang
    Updating crates.io index
  Installing bend-lang v0.2.9
    Updating crates.io index
     Locking 60 packages to latest compatible versions
      Adding TSPL v0.0.9 (latest: v0.0.12)
      Adding itertools v0.11.0 (latest: v0.13.0)
   Compiling proc-macro2 v1.0.82
   Compiling unicode-ident v1.0.12
   Compiling cc v1.0.98
   Compiling libc v0.2.155
   Compiling utf8parse v0.2.1
   Compiling autocfg v1.3.0
   Compiling cfg-if v1.0.0
   Compiling parking_lot_core v0.9.10
   Compiling anstyle-parse v0.2.4
   Compiling anstyle v1.0.7
   Compiling anstyle-query v1.0.3
   Compiling colorchoice v1.0.1
   Compiling is_terminal_polyfill v1.70.0
   Compiling thiserror v1.0.61
   Compiling scopeguard v1.2.0
   Compiling anstream v0.6.14
   Compiling lock_api v0.4.12
   Compiling clap_lex v0.7.0
   Compiling heck v0.5.0
   Compiling highlight_error v0.1.1
   Compiling smallvec v1.13.2
   Compiling strsim v0.11.1
   Compiling clap_builder v4.5.2
   Compiling TSPL v0.0.9
   Compiling arrayvec v0.7.4
   Compiling quote v1.0.36
   Compiling psm v0.1.21
   Compiling stacker v0.1.15
   Compiling nohash-hasher v0.2.0
   Compiling syn v2.0.64
   Compiling equivalent v1.0.1
   Compiling either v1.12.0
   Compiling hashbrown v0.14.5
   Compiling itertools v0.11.0
   Compiling parking_lot v0.12.2
   Compiling TSPL v0.0.12
   Compiling loaned v0.1.1
   Compiling interner v0.2.1
The following warnings were emitted during compilation:

warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `/usr/local/opt/llvm/bin/clang` installed?
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `/usr/local/opt/llvm/bin/clang` installed?

error: failed to run custom build command for `psm v0.1.21`

Caused by:
  process didn't exit successfully: `/var/folders/ql/6g7sngkx3z36x7_9905f30_40000gp/T/cargo-installexBI5w/release/build/psm-7354c53ec1bd3d0e/build-script-build` (exit status: 1)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
  CC_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
  CC_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/usr/local/opt/llvm/bin/clang")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `/usr/local/opt/llvm/bin/clang` installed?
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
  CFLAGS_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
  CFLAGS_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rustc-cfg=asm
  cargo:rustc-cfg=switchable_stack
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `/usr/local/opt/llvm/bin/clang` installed?

  --- stderr


  error occurred: Failed to find tool. Is `clang` installed?


warning: build failed, waiting for other jobs to finish...
error: failed to compile `bend-lang v0.2.9`, intermediate artifacts can be found at `/var/folders/ql/6g7sngkx3z36x7_9905f30_40000gp/T/cargo-installexBI5w`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

To Reproduce Steps to reproduce the behavior:

  1. Running command: cargo +nightly install bend-lang
  2. Error as in given stacktrace

Expected behavior I can install Bend language on my computer without getting error.

Desktop (please complete the following information):

  • OS: MacOS Sonoma 14.4.1 (23E224)
  • CPU: Apple M1 Pro
  • GPU: Integrated in Apple M1 Pro
  • Cuda Version - none

rucin93 avatar May 19 '24 17:05 rucin93

Looks like it's not finding the binary for clang What is the output of which clang? Can you try running CC=$(which clang) cargo +nightly install bend-lang?

nicolas-abril avatar May 20 '24 07:05 nicolas-abril

FWIW, clang is usually installed through the Xcode Command Line Tools (xcode-select --install).

Installation did work on my M2, 14.4.1, those tools installed.

haslo avatar May 20 '24 11:05 haslo

CC=$(which clang) cargo +nightly install bend-lang

What worked fine :) Thanks!

rucin93 avatar May 20 '24 11:05 rucin93