aspect-build / aspect-workflows-template

Scaffolding for new Aspect workspace
1 stars 1 forks source link

[Bug]: Do not assume a system cc toolchain #74

Closed jab closed 1 month ago

jab commented 1 month ago

What happened?

❯ aspect run //:requirements.update
INFO: Repository bazel_tools~cc_configure_extension~local_config_cc instantiated at:
  <builtin>: in <toplevel>
Repository rule cc_autoconf defined at:
  /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/cc_configure.bzl:109:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'bazel_tools~cc_configure_extension~local_config_cc':
   Traceback (most recent call last):
    File "/home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/cc_configure.bzl", line 91, column 33, in cc_autoconf_impl
        configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools)
    File "/home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 349, column 17, in configure_unix_toolchain
        cc = find_cc(repository_ctx, overriden_tools)
    File "/home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 314, column 23, in find_cc
        cc = _find_generic(repository_ctx, "gcc", "CC", overriden_tools)
    File "/home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 310, column 32, in _find_generic
        auto_configure_fail(msg)
    File "/home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
        fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail:
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/BUILD:58:19: @@bazel_tools//tools/cpp:current_cc_toolchain depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to fetch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/BUILD:89:11: @@bazel_tools//tools/cpp:malloc depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to fetch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/BUILD:67:11: @@bazel_tools//tools/cpp:empty_lib depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to f
etch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/tools/cpp/BUILD:81:11: @@bazel_tools//tools/cpp:link_extra_lib depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to fetch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/.cache/bazel/_bazel_jab/6a2f0679cfe8885659d29312e4c630d6/external/bazel_tools/src/tools/launcher/BUILD:65:14: @@bazel_tools//src/tools/launcher:launcher_maker depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to fetch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
ERROR: /home/jab/tmp/hello_bazel/BUILD.bazel:25:25: //:requirements.update depends on @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-k8 in repository @@bazel_tools~cc_configure_extension~local_config_cc which failed to fetch. no such package '@@bazel_tools~cc_configure_extension~local_config_cc//':
Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
INFO: Analyzed target //:requirements.update (140 packages loaded, 4784 targets configured).
WARNING: errors encountered while analyzing target '//:requirements.update', it will not be built.
Analysis failed
INFO: Found 0 targets...
ERROR: command succeeded, but there were loading phase errors
INFO: Elapsed time: 5.714s, Critical Path: 0.07s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

Version

Development (host) and target OS/architectures:

Output of bazel --version: aspect 5.10.1

How to reproduce

0. Log into a system with no cc toolchain installed
1. Run `aspect init`
2. Opt into Python support. (Responses to other prompts should not matter.)
3. Run `aspect run //:requirements.update`

Any other information?

No response

alexeagle commented 1 month ago

Dupe of #32?

jab commented 1 month ago

Thanks, yes, missed that.