asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Build yields fatal error: 'concepts' file not found #118

Open samestep opened 2 years ago

samestep commented 2 years ago

I'm on Ubuntu 20.04, with clang-12 installed via sudo apt install clang-12 and Bazel 5.2.0 installed via these instructions. When I run the build instructions from this repo's README, I get this error:

INFO: Analyzed 355 targets (0 packages loaded, 0 targets configured).
INFO: Found 355 targets...
ERROR: /home/sam/github/asoffer/Icarus/ast/BUILD:91:11: Compiling ast/scope.cc failed: (Exit 1): clang-12 failed: error executing command /usr/bin/clang-12 -MD -MF bazel-out/clang-opt/bin/ast/_objs/scope/scope.d '-frandom-seed=bazel-out/clang-opt/bin/ast/_objs/scope/scope.o' -iquote . -iquote bazel-out/clang-opt/bin -iquote ... (remaining 22 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ast/scope.cc:1:
./ast/scope.h:4:10: fatal error: 'concepts' file not found
#include <concepts>
         ^~~~~~~~~~
1 error generated.
INFO: Elapsed time: 1.447s, Critical Path: 1.21s
INFO: 17 processes: 13 internal, 4 linux-sandbox.
FAILED: Build did NOT complete successfully
asoffer commented 2 years ago

Strange, Clang 12 should support concepts.

I suspect there's something in //toolchain that's making assumptions specific to my system (reasonably up-to-date Linux Mint).

A few ideas:

  1. Can you compile the code in the godbolt link above on your system?
  2. Did the .bazelrc file get cloned correctly?
  3. Try the --subcommands flag: That is, bazel build -c opt //compile:interpret --subcommands. This will build the target and emit to stderr the full commands the Bazel actions are performing. Maybe it's somehow not finding the wrong compiler path? Or not setting -std=c++2a
samestep commented 2 years ago
  1. No, I cannot; if I save that file and compile it using either clang-12 or clang++-12, I get the same error message, regardless of whether I add -std=c++2a to the command.

  2. I believe so.

  3. Running that command gives me the following error message:

    ERROR: Skipping '//compile:interpret': no such package 'compile': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
    - /home/sam/github/asoffer/Icarus/compile
    WARNING: Target pattern parsing failed.
    ERROR: no such package 'compile': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
    - /home/sam/github/asoffer/Icarus/compile
    INFO: Elapsed time: 0.213s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (0 packages loaded)
asoffer commented 2 years ago

Typo.. should be compiler:interpret, but regardless it seems like your version of clang doesn't support concepts, so the subcommands won't tell us much more. Probably worth checking the symlinks are correct by checking the version clang thinks it is (-v). It could also be your standard library is placed somewhere strange and not being picked up by $PATH or -isystem. If you can locate those files that'd be great, otherwise I'd bet this is sufficiently common that stack overflow has an answer