Bend icon indicating copy to clipboard operation
Bend copied to clipboard

Failed installation on wsl Windows 11

Open UsmanTariq2 opened this issue 1 year ago • 11 comments

Describe the bug Updating crates.io index Installing hvm v2.0.8 Updating crates.io index Locking 29 packages to latest compatible versions Compiling libc v0.2.155 Compiling utf8parse v0.2.1 Compiling anstyle v1.0.7 Compiling anstyle-query v1.0.3 Compiling is_terminal_polyfill v1.70.0 Compiling colorchoice v1.0.1 Compiling clap_lex v0.7.0 Compiling strsim v0.11.1 Compiling anstyle-parse v0.2.4 Compiling cc v1.0.97 Compiling highlight_error v0.1.1 Compiling TSPL v0.0.12 Compiling anstream v0.6.14 error: linkercc` not found | = note: No such file or directory (os error 2)

error: could not compile libc (build script) due to 1 previous error warning: build failed, waiting for other jobs to finish... error: failed to compile hvm v2.0.8, intermediate artifacts can be found at /tmp/cargo-installz7F0B2. 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. Latest windows and WSL 2
  2. Use command cargo +nightly install hvm

UsmanTariq2 avatar May 18 '24 03:05 UsmanTariq2

Solution for linkercc not found Error on WSLThe error message linkercc not found indicates that the cc compiler (part of the build-essential package) is not installed or not available in your WSL environment. To resolve this error, follow these steps: 1.Update and Upgrade Your System: sudo apt update sudo apt upgrade -y 2.Install the Build-Essential Package: sudo apt install build-essential -y 3.Ensure pkg-config is Installed: sudo apt install pkg-config -y 4.Retry the Installation: Try to install hvm again cargo +nightly install hvm 5.Ensure Rust is Installed Correctly: Ensure that Rust and the nightly toolchain are set up correctly in your WSL environment: rustup update rustup toolchain install nightly rustup default nightly If any other specific errors come up, please provide those details.

54g0 avatar May 18 '24 06:05 54g0

Got the same error but upgrading the system fixed it, write: sudo apt-get update before sudo apt update and you can retry the installation of hvm

Thanks 54g0 :))

RagnaJok avatar May 18 '24 10:05 RagnaJok

what @54g0 said is correct @UsmanTariq2, the problem is that you're missing the libc package , which comes with build-essential, i recommend installing build-essential as that will also give you gcc, in case you don't have it, you can install it with sudo apt install build-essential. Please do report back if you manage to fix your issue.

kings177 avatar May 18 '24 16:05 kings177

Hey, installing build-essential solved the problem I generally dont install it because it has older versions of g++ installed, and i was under the impresssion that installing g++ installs everything. Manually using latest compiler with build-essential. So on me.

UsmanTariq2 avatar May 19 '24 02:05 UsmanTariq2

glad to know it worked for you :)

kings177 avatar May 19 '24 02:05 kings177

When i run the command

bend run <file.hvm> # uses the Rust interpreter (sequential)

bash: syntax error near unexpected token newline'`

A typo on the main page perhaps

UsmanTariq2 avatar May 19 '24 02:05 UsmanTariq2

assuming you typed the full bend run <file.hvm> # uses the Rust interpreter (sequential).

you're supposed to type an actual path to a file instead of <file.hvm>, so like, for example, you can create a file called test.bend with the following content:

def main:
  list = [1, 2, 3]
  return list

then just do bend run-c test.bend

kings177 avatar May 19 '24 03:05 kings177

Get an error when compiling the sorter example:

Error reading result from hvm. Output : signal: 11 (SIGSEGV)

Upon the execution /another error, i get : Errors: Error reading result from hvm. Output : signal: 9 (SIGKILL)

UsmanTariq2 avatar May 19 '24 03:05 UsmanTariq2

can you type free -h and paste me the output please?

kings177 avatar May 19 '24 03:05 kings177

           total        used        free      shared  buff/cache   available

Mem: 3.8Gi 668Mi 3.2Gi 660Ki 72Mi 3.1Gi Swap: 1.0Gi 697Mi 326Mi

UsmanTariq2 avatar May 19 '24 03:05 UsmanTariq2

do you get this error everytime you run something with run-c? even if you run something like

def main:
  return "test"

kings177 avatar May 20 '24 13:05 kings177

Closing this since the issue has been fixed and now there has been another issue that falls under https://github.com/HigherOrderCO/Bend/issues/397 and https://github.com/HigherOrderCO/HVM/issues/309

kings177 avatar May 22 '24 21:05 kings177