VoltLang / Volta

Compiler for the Volt Programming Language
151 stars 8 forks source link

error: No valid LLVM Toolchains found! #57

Closed theAkito closed 3 years ago

theAkito commented 3 years ago

I followed the Getting Started guide for trying out Volt.

After installing the needed dependencies on Debian inside WSL2, I am getting the following output from battery config /path/to/Volta /path/to/Watt:

battery config /usr/bin/volta /usr/bin/watt
native compile
Using LLVM-9.0.1 toolchain from path.
        boot cmd llvm-config: '/usr/bin/llvm-config' from path.
        boot cmd llvm-ar: '/usr/bin/llvm-ar' from path.
Various tools needed by bootstrapping.
        boot cmd rdmd: '/usr/bin/rdmd' from path.
error: No valid LLVM Toolchains found!
        See log in: .battery/config-log.txt

.battery/config-log.txt

driver: starting config
frontend.batteryConf: BatConf parser online, lets parse some battery.conf.toml files!
frontend.batteryConf: The file '' doesn't excist or is not a file!
detect.llvm: Searching for LLVM toolchains.
detect.llvm: Could not find 'llvm-config-10' nor 'clang-10' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-8' nor 'clang-8' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-7' nor 'clang-7' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-6.0' nor 'clang-6.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-5.0' nor 'clang-5.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-4.0' nor 'clang-4.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-3.9' nor 'clang-3.9' on the path, skipping other commands.
detect.llvm: Found
    from = path
    ver = 9.0.1
    configCmd = '/usr/bin/llvm-config'
    configArgs = []
    arCmd = '/usr/bin/llvm-ar'
    arArgs = []
detect.llvm: Found
    from = path
    ver = 9.0.1
    configCmd = '/usr/bin/llvm-config-9'
    configArgs = []
    arCmd = '/usr/bin/llvm-ar-9'
    arArgs = []
detect.llvm: Was not given 'llvm-config' nor 'clang', skipping other commands.
detect.llvm: Checking llvm from ''.
detect.llvm: Was not given 'llvm-config' nor 'clang', skipping other commands.
detect.gdc: Detecting GDC fron path.
detect.gdc: Failed to find 'gdc' on path.
detect.gdc: Failed to find 'gdc-6' on path.
detect.gdc: Failed to find 'gdc-7' on path.
detect.gdc: Failed to find 'gdc-8' on path.
detect.gdc: Failed to find 'gdc-9' on path.
detect.rdmd: Detecting rdmd on path.
detect.rdmd: Found rdmd '/usr/bin/rdmd'
detect.rdmd: Found
    from = path
    cmd = /usr/bin/rdmd
    args = []
detect.llvm: Searching for LLVM toolchains.
detect.llvm: Could not find 'llvm-config-10' nor 'clang-10' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-8' nor 'clang-8' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-7' nor 'clang-7' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-6.0' nor 'clang-6.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-5.0' nor 'clang-5.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-4.0' nor 'clang-4.0' on the path, skipping other commands.
detect.llvm: Could not find 'llvm-config-3.9' nor 'clang-3.9' on the path, skipping other commands.
detect.llvm: Found
    from = path
    ver = 9.0.1
    configCmd = '/usr/bin/llvm-config'
    configArgs = []
    arCmd = '/usr/bin/llvm-ar'
    arArgs = []
detect.llvm: Found
    from = path
    ver = 9.0.1
    configCmd = '/usr/bin/llvm-config-9'
    configArgs = []
    arCmd = '/usr/bin/llvm-ar-9'
    arArgs = []
detect.llvm: Was not given 'llvm-config' nor 'clang', skipping other commands.
detect.llvm: Checking llvm from ''.
detect.llvm: Was not given 'llvm-config' nor 'clang', skipping other commands.
bhelyer commented 3 years ago

Hey, thanks for leaving an issue. I assume this is when trying to build a standard project? (Hello world or w/e). And is /usr/bin/watt a directory? (Rather than an executable, as /usr/bin would suggest. I've never tried using WSL before. I'm not particularly active in the project any more, but if I can get some time this weekend* I might give it a try and get back to you.

(*I'm based in Auckland, New Zealand, and we're all back in lockdown, so it looks I'll be stuck at home anyway...)

theAkito commented 3 years ago

@bhelyer

Greetings and thank you for the response!

I've replicated the "Getting started" section in the documentation. That means, that /usr/bin/volta is the directory, as it has been in the tutorial. I copy the entire folder to /usr/bin to have a contained space for the projects dependencies, as they shouldn't ever interfere with the dependencies of other projects. So usually I have custom binaries saved in their own project folder, within /usr/bin, like this: /usr/bin/julia/bin/julia which is the path to the julia binary, which is in its own project folder called julia.

I am actually trying to just compile a single a file, but I have not found anything close to rustc mymodule.rs in the documentation, which is what I was actually looking for. So I resorted to the solution provided, which depends on battery.

WSL2 is pretty much a 97% Linux system. Only deep hardware components are obviously missing, but everything above that low level layer is present and should act precisely the same as on a native system.

Is the project still alive, though?

Wallbraker commented 3 years ago

@theAkito Hello, I think that the getting started page is missing some dependencies, can you please try and install clang.

theAkito commented 3 years ago

@Wallbraker

That seems to be the missing dependency. However, now when running battery config /usr/bin/volta /usr/bin/watt and then battery build module.volt, then it apparently gets built, but I couldn't find the result anywhere. Tried searching manually and with find, but there was ne executable to be found. That is strange, since running battery build module.volt again yields no log output and takes no time, so it apparently sees the result in a cache and considers the job done.

Then I noticed that one should actually issue battery config /usr/bin/volta /usr/bin/watt . and then I get error: path '.' does not have a 'src' folder. But this is just expanding another problem I have since the beginning. I just want to compile a single file, without any boilerplate hanging around. I want to use the equivalent of rustc module.rs and I do not want a whole Volt-only project, because the Volt source file is actually in a folder mixed with other languages. I just want to compile this single file easily, I do not want to set up a whole project for a small test file.

However, this specific dependency-caused issue is technically resolved, so I should close this issue.

Wallbraker commented 3 years ago

@theAkito Due to time limitations we choose to first get a "project" based setup supported. There is a lot of setup logic that needs to be coded somewhere and we choose to put it in battery first. If you want to see what battery does when it builds you can type battery build --verbose. Note that the module.volt argument you added is currently silently ignored.