ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.29k stars 9.73k forks source link

How can I build rosbag_to_record with bazel? #11519

Closed baofuwu closed 4 years ago

baofuwu commented 4 years ago

I want to use rosbag_to_record in apollo.

System information

Linux Ubuntu 18.04, Jetson AGX Xavier(aarch64 base) Apollo installed from docker Apollo version r5.5.0

Steps to reproduce the issue:

Clone or pull the latest master Enter Apollo docker with non-root user (via cyber_start and cyber_into) Because qt is not installed on the system, ./apollo.sh build_cyber shows qt errors. so I commented out the qt related commands in WORKSPACE, and try the following cmd:

bazel build //modules/data/tools...  

it shows an error:

mist@in_cyber_docker:/apollo$ bazel build //modules/data/tools/...
INFO: Reading 'startup' options from /apollo/tools/bazel.rc: --batch_cpu_scheduling --host_jvm_args=-XX:-UseParallelGC --output_user_root=/apollo/.cache/bazel
ERROR: (06-21 07:20:06.502) /apollo/modules/common/math/BUILD:77:1: no such package '@eigen//': Error downloading [file:/home/tmp/eigen-3.2.10.tar.gz] to /apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/eigen/eigen-3.2.10.tar.gz: Checksum was 04f8a4fa4afedaae721c1a1c756afeea20d3cdef0ce3293982cf1c518f178502 but wanted ba4f95f9082ce99012d5ff320472a0e9fd0be921a20f11912f0bf7e6ca93f240 and referenced by '//modules/common/math:quaternion'.
ERROR: (06-21 07:20:06.762) Analysis of target '//modules/data/tools/smart_recorder:record_processor' failed; build aborted.
INFO: (06-21 07:20:06.763) Elapsed time: 6.835s
storypku commented 4 years ago

A temporary workaround:

Try replace WORKSPACE.in#L65 with

sha256 ="04f8a4fa4afedaae721c1a1c756afeea20d3cdef0ce3293982cf1c518f178502",
```.

And try 

bazel build //modules/data/tools/...


again.
baofuwu commented 4 years ago

A temporary workaround:

Try replace WORKSPACE.in#L65 with

sha256 ="04f8a4fa4afedaae721c1a1c756afeea20d3cdef0ce3293982cf1c518f178502",
```.

And try 

bazel build //modules/data/tools/...

again.

Thank you, Dalao!
But a new error shows that:

mist@in_cyber_docker:/apollo$ bazel build //modules/data/tools/... INFO: Reading 'startup' options from /apollo/tools/bazel.rc: --batch_cpu_scheduling --host_jvm_args=-XX:-UseParallelGC --output_user_root=/apollo/.cache/bazel ERROR: (06-21 09:27:18.719) /apollo/modules/common/math/BUILD:210:1: no such package '@eigen//': Prefix eigen-git-mirror-3.2.10 was given, but not found in the archive and referenced by '//modules/common/math:cartesian_frenet_conversion'. ERROR: (06-21 09:27:18.882) Analysis of target '//modules/data/tools/smart_recorder:record_processor' failed; build aborted. INFO: (06-21 09:27:18.884) Elapsed time: 5.943s

storypku commented 4 years ago

ERROR: (06-21 09:27:18.719) /apollo/modules/common/math/BUILD:210:1: no such package '@eigen//': Prefix eigen-git-mirror-3.2.10 was given, but not found in the archive and referenced by '//modules/common/math:cartesian_frenet_conversion'. ERROR: (06-21 09:27:18.882) Analysis of target '//modules/data/tools/smart_recorder:record_processor' failed; build aborted. INFO: (06-21 09:27:18.884) Elapsed time: 5.943s

run tar xzvf /home/tmp/eigen-3.2.10.tar.gz, and show me the folder created.

baofuwu commented 4 years ago

A temporary workaround: Try replace WORKSPACE.in#L65 with

sha256 ="04f8a4fa4afedaae721c1a1c756afeea20d3cdef0ce3293982cf1c518f178502",
```.

And try 

bazel build //modules/data/tools/...

again.

Thank you, Dalao! But a new error shows that: mist@in_cyber_docker:/apollo$ bazel build //modules/data/tools/... INFO: Reading 'startup' options from /apollo/tools/bazel.rc: --batch_cpu_scheduling --host_jvm_args=-XX:-UseParallelGC --output_user_root=/apollo/.cache/bazel ERROR: (06-21 09:27:18.719) /apollo/modules/common/math/BUILD:210:1: no such package '@eigen//': Prefix eigen-git-mirror-3.2.10 was given, but not found in the archive and referenced by '//modules/common/math:cartesian_frenet_conversion'. ERROR: (06-21 09:27:18.882) Analysis of target '//modules/data/tools/smart_recorder:record_processor' failed; build aborted. INFO: (06-21 09:27:18.884) Elapsed time: 5.943s

run tar xzvf /home/tmp/eigen-3.2.10.tar.gz, and show me the folder created.

The folder created is "eigen-eigen-b9cd8366d4e8",and I put it in the path: /apollo

storypku commented 4 years ago

run tar xzvf /home/tmp/eigen-3.2.10.tar.gz, and show me the folder created.

The folder created is "eigen-eigen-b9cd8366d4e8",and I put it in the path: /apollo

use it to change the strip_prefix value in master/WORKSPACE.in#L67 and try again.

storypku commented 4 years ago

We talked about this issue personally,and It turns out to be a version mismatch between dev docker image and Apollo source code as @baofuwu didn't git pull the latest code. As such, I will close this issue now. Thank you for supporting Apollo!