mihaigalos / miniboot

🏗️ An I2C bootloader for Arduino.
GNU General Public License v3.0
66 stars 18 forks source link

Unrecognized option: --distinct_host_configuration=false #34

Open ajtalbot1 opened 9 months ago

ajtalbot1 commented 9 months ago

Clean install of Ubuntu 23.04, installed bazel from apt.

root@Workspace:~# bazel version
Build label: 7.0.2
.....

root@Workspace:~# mkdir workspace && cd workspace/
root@Workspace:~/workspace# git clone --recursive  https://github.com/mihaigalos/miniboot.gitcd && cd miniboot/

root@Workspace:~/workspace/miniboot# bazel build --config=328p --verbose_failures //:miniboot.elf
Starting local Bazel server and connecting to it...
INFO: Found applicable config definition build:328p in file /root/workspace/miniboot/.bazelrc: --crosstool_top=@avr_tools//tools/avr:toolchain_avr --distinct_host_configuration=false --cpu=avr --define MCU=atmega328p
ERROR: --distinct_host_configuration=false :: Unrecognized option: --distinct_host_configuration=false

root@Workspace:~/workspace/miniboot# vi .bazelrc
# Removed --distinct_host_configuration=false

root@Workspace:~/workspace/miniboot# bazel build --config=328p --verbose_failures //:miniboot.elf
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to https://github.com/bazelbuild/bazel/issues/18958.
INFO: Analyzed target //:miniboot.elf (69 packages loaded, 319 targets configured).
ERROR: /root/workspace/miniboot/BUILD:51:10: Compiling src/miniboot.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:miniboot.elf)
  (cd /root/.cache/bazel/_bazel_root/c2d1d1fca9699ae911e5d72b4f92e7cf/sandbox/processwrapper-sandbox/3/execroot/_main && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.d '-frandom-seed=bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.o' -fPIC -iquote . -iquote bazel-out/avr-fastbuild/bin -iquote external/avr-bootloader-common -iquote bazel-out/avr-fastbuild/bin/external/avr-bootloader-common -iquote external/bazel_tools -iquote bazel-out/avr-fastbuild/bin/external/bazel_tools -Ibazel-out/avr-fastbuild/bin/external/avr-bootloader-common/_virtual_includes/avr-bootloader-common -isystem src -isystem bazel-out/avr-fastbuild/bin/src -isystem external/avr-bootloader-common/include -isystem bazel-out/avr-fastbuild/bin/external/avr-bootloader-common/include '-DF_CPU=8000000UL' -fdiagnostics-color -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -g -lm '-Wl,--relax,--gc-sections,-Map=miniboot.map' '-Wl,--section-start=.text=0x7800' '-mmcu=atmega328p' -Os -pedantic '-std=gnu++14' -Wall -Werror '-Wl,-Map=miniboot.map,--cref' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/miniboot.cpp -o bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.o)
# Configuration: 5c091e33c4f4cae2263b72c5ad9270f33c6128367db4ddf13c8a3fe28c525286
# Execution platform: @@local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mmcu=atmega328p'
ERROR: /root/workspace/miniboot/BUILD:51:10: Compiling src/i2c_master.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:miniboot.elf)
  (cd /root/.cache/bazel/_bazel_root/c2d1d1fca9699ae911e5d72b4f92e7cf/sandbox/processwrapper-sandbox/2/execroot/_main && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.d '-frandom-seed=bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.o' -fPIC -iquote . -iquote bazel-out/avr-fastbuild/bin -iquote external/avr-bootloader-common -iquote bazel-out/avr-fastbuild/bin/external/avr-bootloader-common -iquote external/bazel_tools -iquote bazel-out/avr-fastbuild/bin/external/bazel_tools -Ibazel-out/avr-fastbuild/bin/external/avr-bootloader-common/_virtual_includes/avr-bootloader-common -isystem src -isystem bazel-out/avr-fastbuild/bin/src -isystem external/avr-bootloader-common/include -isystem bazel-out/avr-fastbuild/bin/external/avr-bootloader-common/include '-DF_CPU=8000000UL' -fdiagnostics-color -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -g -lm '-Wl,--relax,--gc-sections,-Map=miniboot.map' '-Wl,--section-start=.text=0x7800' '-mmcu=atmega328p' -Os -pedantic '-std=gnu++14' -Wall -Werror '-Wl,-Map=miniboot.map,--cref' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/i2c_master.cpp -o bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.o)
# Configuration: 5c091e33c4f4cae2263b72c5ad9270f33c6128367db4ddf13c8a3fe28c525286
# Execution platform: @@local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mmcu=atmega328p'
Target //:miniboot.elf failed to build
INFO: Elapsed time: 3.074s, Critical Path: 0.05s
INFO: 5 processes: 4 internal, 1 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

I am stuck. Any help would be appreciated. -Adam

mihaigalos commented 9 months ago

Hi Adam,

If you just want to run miniboot without modifying it, you can flash the hex file in the bin folder.

I'll have to dive deeper into your problem to be able to reproduce it.