ltekieli / bazel_cross_compile

20 stars 8 forks source link

build more than one directories code #4

Closed wssbygone closed 1 year ago

wssbygone commented 1 year ago

I just put this package to the root directory, and untar the package, then exec the CMD below: $bazel build --config=rpi //doexec:hello-world INFO: Analyzed target //doexec:hello-world (26 packages loaded, 102 targets configured). INFO: Found 1 target... ERROR: /home/wss/bazel_cross_compile-master/04_platforms/doexec/BUILD:11:11: Linking doexec/libhello-greet.a failed: (Exit 1): aarch64-rpi3-linux-gnu-ar failed: error executing command bazel/toolchain/aarch64-rpi3-linux-gnu/wrappers/aarch64-rpi3-linux-gnu-ar @bazel-out/aarch64-fastbuild/bin/doexec/libhello-greet.a-2.params

Use --sandbox_debug to see verbose messages from the sandbox src/main/tools/linux-sandbox-pid1.cc:478: "execvp(bazel/toolchain/aarch64-rpi3-linux-gnu/wrappers/aarch64-rpi3-linux-gnu-ar, 0x104cc90)": No such file or directory Target //doexec:hello-world failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 0.818s, Critical Path: 0.57s INFO: 10 processes: 7 internal, 3 linux-sandbox. FAILED: Build did NOT complete successfully

If I just build the origin main.cpp with bazel build --config=rpi //:hello, I will be OK. I don't know how to do next with the error above.

doexec.tar.gz

ltekieli commented 1 year ago

The ar_files of the cc_toolchain was missing, thanks for the examples. I included a small library to reproduce the problem.

wssbygone commented 1 year ago

thanks a lot