Bend icon indicating copy to clipboard operation
Bend copied to clipboard

Can't install bend-lang

Open Robocraft999 opened this issue 1 year ago • 10 comments

Describe the bug I'm currently trying to install bend with cargo as said in the README, but it's crashing with the following error: https://gist.github.com/Robocraft999/034e7f45073c77f6117a338522e38ad4 I have installed following rust versions:

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

To Reproduce Steps to reproduce the behavior:

  1. Running command: cargo +nightly install bend-lang
  2. Error: https://gist.github.com/Robocraft999/034e7f45073c77f6117a338522e38ad4

Expected behavior describe the expected behavior.

Desktop (please complete the following information):

  • OS: Linux (OpenSUSE Leap 15.5)
  • CPU: Intel® Core™ i5-4200M
  • GPU: Intel® HD Graphics 4600
  • Cuda Version: not installed i think

Additional context

Robocraft999 avatar May 18 '24 17:05 Robocraft999

you are missing the libc package, can you do sudo apt install build-essential and try installing again, please?

kings177 avatar May 18 '24 17:05 kings177

opensuse uses zypper not apt. I looked up if there is a 'build-essential' package, but there isn't. Same thing for libc (but there is a 'libc++' one). But i have 'glibc' installed and 'gcc'

Robocraft999 avatar May 18 '24 17:05 Robocraft999

oh sorry. from what i can see, i guess is the gnu toolchain trying to use the lld linker, which gcc doesn't recognize, can you, either try using the default nightly toolchain, or make sure that the CC env var is set to gcc, i guess also installing the binutils for opensuse, however, i do recommend using the default nightly toolchain. let me know if you still try making it do with the -gnu toolchain and it get an error.

kings177 avatar May 18 '24 18:05 kings177

So i set the CC enc var to gcc now (binutils is also installed). What do you mean with using the 'default nightly toolchain'? I thought 'nightly-x86_64-unknown-linux-gnu' is the default (I installed it with 'rustup toolchain install nightly') but maybe I'm misunderstanding something. Having this toolchain installed and using the provided install command results in the same error as before. Nevertheless thanks for your help so far!

Robocraft999 avatar May 18 '24 18:05 Robocraft999

no problems :), can you try doing rustup toolchain install nightly again, then rustup default nightly and reinstalling the Bend? maybe i'm the one mistaken. even with the CC var to gcc does it still returns the same error?

kings177 avatar May 18 '24 18:05 kings177

Yes, but I think that it still tries to use cc and not gcc. I also noticed that the env var was reset after I restarted the terminal. I set it like this: 'export CC=/usr/bin/gcc'. When reading it like this: 'echo $CC' it outputs the path I set, but after terminal restart its gone. I also tried to set it in the same terminal I ran the install command in, but still the same error (I think). I can append it here again in the case I overlooked something and its different now:

cargo +nightly install bend-lang
    Updating crates.io index
  Installing bend-lang v0.2.7
    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.97
   Compiling libc v0.2.155
   Compiling utf8parse v0.2.1
   Compiling autocfg v1.3.0
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/home/admin/.cargo/bin:/home/admin/.local/bin:/home/admin/bin:/usr/local/bin:/usr/bin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcaNuynF/symbols.o" "/tmp/cargo-installPh6Esn/release/build/proc-macro2-ed8ccc6393a5bc3c/build_script_build-ed8ccc6393a5bc3c.build_script_build.82932413c0031f8c-cgu.0.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/proc-macro2-ed8ccc6393a5bc3c/build_script_build-ed8ccc6393a5bc3c.build_script_build.82932413c0031f8c-cgu.1.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/proc-macro2-ed8ccc6393a5bc3c/build_script_build-ed8ccc6393a5bc3c.evourf8wuu3qve7933m71ol0h.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installPh6Esn/release/deps" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-de48b8168d6cf4fa.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-9f3477fb95a0bba7.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-210d920812faea91.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-f3d3451767410a17.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-1a79dd36d08251de.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-886230e7120831b2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-2caea079085a58a2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-a9d7d97cdc65a449.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-5727477b0a78105a.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-7e555563aa211118.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c8f13465f1a795b2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-ee5b5774583426df.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-14df174c91007922.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-e8bfe52be756260a.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-6275035a459b3ada.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b6892f3c52c68f01.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-f72b956e24d1de70.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-632ae0f28c5e55ff.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e8b7e96e438f08f6.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/self-contained" "-o" "/tmp/cargo-installPh6Esn/release/build/proc-macro2-ed8ccc6393a5bc3c/build_script_build-ed8ccc6393a5bc3c" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: cc: error: unrecognized command line option '-fuse-ld=lld'; did you mean '-fuse-ld=bfd'?
          

error: could not compile `proc-macro2` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/home/admin/.cargo/bin:/home/admin/.local/bin:/home/admin/bin:/usr/local/bin:/usr/bin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcqj2eAc/symbols.o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf.build_script_build.e0982981f1722a6c-cgu.0.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf.build_script_build.e0982981f1722a6c-cgu.1.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf.build_script_build.e0982981f1722a6c-cgu.2.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf.build_script_build.e0982981f1722a6c-cgu.3.rcgu.o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf.134gf7om9pa4o14zabq5dh3f6.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installPh6Esn/release/deps" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-de48b8168d6cf4fa.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-9f3477fb95a0bba7.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-210d920812faea91.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-f3d3451767410a17.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-1a79dd36d08251de.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-886230e7120831b2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-2caea079085a58a2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-a9d7d97cdc65a449.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-5727477b0a78105a.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-7e555563aa211118.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c8f13465f1a795b2.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-ee5b5774583426df.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-14df174c91007922.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-e8bfe52be756260a.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-6275035a459b3ada.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b6892f3c52c68f01.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-f72b956e24d1de70.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-632ae0f28c5e55ff.rlib" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e8b7e96e438f08f6.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/admin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/self-contained" "-o" "/tmp/cargo-installPh6Esn/release/build/libc-f1f660812ad9ccaf/build_script_build-f1f660812ad9ccaf" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: cc: error: unrecognized command line option '-fuse-ld=lld'; did you mean '-fuse-ld=bfd'?
          

error: could not compile `libc` (build script) due to 1 previous error
error: failed to compile `bend-lang v0.2.7`, intermediate artifacts can be found at `/tmp/cargo-installPh6Esn`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

EDIT: I have cc installed too btw.

Robocraft999 avatar May 18 '24 18:05 Robocraft999

So, good news. Today I had the idea to just try to clone this repo and compile Bend from source with cargo. It downloaded rust nightly 1.77.0 (nightly-2024-01-27-x86_64-unknown-linux-gnu (override)) and the compilation worked (newest nightly is 1.80.0, so that could be the problem). I can now use bend like this: cargo run run helloworld.bend or theoretically by using the compiled binary.

Robocraft999 avatar May 19 '24 08:05 Robocraft999

oh nice, does running bend run-c helloworld.bend also work normally for you?

kings177 avatar May 20 '24 13:05 kings177

also, basically, when you tried to install with cargo +nightly install bend-lang you got that error, but when you installed with directly from the repo it worked? @Robocraft999

kings177 avatar May 20 '24 14:05 kings177

oh nice, does running bend run-c helloworld.bend also work normally for you?

Yes and yes (second message) I think installing is not quite right, I'm just running it with cargo in the cloned repo, it's not runnable like bend run ..., but it works fine.

Robocraft999 avatar May 20 '24 16:05 Robocraft999

i guess there could be some bug with rust at the time, closing this issue since the problem is fixed.

kings177 avatar May 24 '24 14:05 kings177