bazeldrake

Checksum error for eigen when building Drake wheel


When building the drake wheel via: bazel run //tools/wheel:builder -- --snopt-path=/path/to/libsnopt7_cpp.zip VERSION on Ubuntu 24.04, the build is failing with the following error:

INFO: Analyzed target //tools/wheel:builder (84 packages loaded, 1067 targets configured).
INFO: Found 1 target...
Target //tools/wheel:builder up-to-date:
  bazel-bin/tools/wheel/builder
INFO: Elapsed time: 0.768s, Critical Path: 0.01s
INFO: 5 processes: 5 internal.
INFO: Build completed successfully, 5 total actions
INFO: Running command line: bazel-bin/tools/wheel/builder <args omitted>
[-] Creating source archive.............................................. done
[-] Build pip-drake:20250419031055-089da91d95af8789-jammy-py310 ['--build-arg', 'DRAKE_VERSION=1.40', '--build-arg', 'DRAKE_GIT_SHA=0596a5eb8717b677c573118bc5e2558c1f1f07ba', '--build-arg', 'PLATFORM=ubuntu:22.04', '--build-arg', 'PYTHON=3.10', '--force-rm']
[+] Building 88.5s (14/18)                                                                                                                                                                                                                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                 0.0s
 => => transferring dockerfile: 1.70kB                                                                                                                                                                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                                                                                                                                                                                                                                                      0.3s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                    0.0s
 => => transferring context: 63B                                                                                                                                                                                                                                                                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                                                                                                                                                                                    0.3s
 => => transferring context: 56.42MB                                                                                                                                                                                                                                                                                                                                 0.2s
 => [base 1/4] FROM docker.io/library/ubuntu:22.04@sha256:d80997daaa3811b175119350d84305e1ec9129e1799bba0bd1e3120da3ff52c3                                                                                                                                                                                                                                           1.1s
 => => resolve docker.io/library/ubuntu:22.04@sha256:d80997daaa3811b175119350d84305e1ec9129e1799bba0bd1e3120da3ff52c3                                                                                                                                                                                                                                                0.0s
 => => sha256:d80997daaa3811b175119350d84305e1ec9129e1799bba0bd1e3120da3ff52c3 6.69kB / 6.69kB                                                                                                                                                                                                                                                                       0.0s
 => => sha256:a76d0e9d99f0e91640e35824a6259c93156f0f07b7778ba05808c750e7fa6e68 424B / 424B                                                                                                                                                                                                                                                                           0.0s
 => => sha256:cc934a90cd99a939f3922f858ac8f055427300ee3ee4dfcd303c53e571d0aeab 2.30kB / 2.30kB                                                                                                                                                                                                                                                                       0.0s
 => => sha256:30a9c22ae099393b0131322d7f50d8a9d7cd06c5e518cd27a19ac960a4d0aba3 29.53MB / 29.53MB                                                                                                                                                                                                                                                                     0.4s
 => => extracting sha256:30a9c22ae099393b0131322d7f50d8a9d7cd06c5e518cd27a19ac960a4d0aba3                                                                                                                                                                                                                                                                            0.5s
 => [base 2/4] ADD image/packages-* /image/                                                                                                                                                                                                                                                                                                                          0.1s
 => [base 3/4] ADD image/provision-base.sh /image/                                                                                                                                                                                                                                                                                                                   0.1s
 => [base 4/4] RUN /image/provision-base.sh                                                                                                                                                                                                                                                                                                                         45.5s
 => [clean 1/5] ADD image/provision-python.sh image/build-python.sh /image/                                                                                                                                                                                                                                                                                          0.1s
 => [clean 2/5] RUN /image/provision-python.sh 3.10                                                                                                                                                                                                                                                                                                                  5.5s
 => [clean 3/5] ADD image/build-drake.sh /image/                                                                                                                                                                                                                                                                                                                     0.1s
 => [clean 4/5] ADD image/drake-src.tar /opt/drake-wheel-build/drake/                                                                                                                                                                                                                                                                                                0.3s
 => [clean 5/5] COPY image/snopt.tar.gz /opt/drake-wheel-build/src/                                                                                                                                                                                                                                                                                                  0.1s
 => ERROR [wheel 1/5] RUN --mount=type=cache,target=/var/cache/bazel     /image/build-drake.sh                                                                                                                                                                                                                                                                      35.3s
------
 > [wheel 1/5] RUN --mount=type=cache,target=/var/cache/bazel     /image/build-drake.sh:
0.378 -- The C compiler identification is GNU 11.4.0
0.449 -- The CXX compiler identification is GNU 11.4.0
0.455 -- Detecting C compiler ABI info
0.565 -- Detecting C compiler ABI info - done
0.578 -- Check for working C compiler: /usr/bin/cc - skipped
0.578 -- Detecting C compile features
0.579 -- Detecting C compile features - done
0.582 -- Detecting CXX compiler ABI info
0.708 -- Detecting CXX compiler ABI info - done
0.716 -- Check for working CXX compiler: /usr/bin/c++ - skipped
0.717 -- Detecting CXX compile features
0.717 -- Detecting CXX compile features - done
0.751 -- Could NOT find Bazel (missing: Bazel_EXECUTABLE) (Required is at least version "7.4.1")
0.751 -- Using Bazelisk as Bazel_EXECUTABLE to fetch Bazel on demand
0.991 -- Found Python: /usr/local/bin/python (found suitable exact version "3.10.12") found components: Development Interpreter Development.Module Development.Embed
0.993 -- Could NOT find Git (missing: GIT_EXECUTABLE)
0.993 -- Configuring done
1.000 -- Generating done
1.001 -- Build files have been written to: /opt/drake-wheel-build/drake-build
1.089 Built target drake_version
2.010 Downloading https://github.com/bazelbuild/bazel/releases/download/8.2.1/bazel-8.2.1-linux-x86_64...
3.734 Downloading https://github.com/bazelbuild/bazel/releases/download/8.2.1/bazel-8.2.1-linux-x86_64.sha256...
4.080 Extracting Bazel installation...
7.337 Starting local Bazel server (8.2.1) and connecting to it...
8.249 INFO: Invocation ID: 03508e6e-af5e-4b01-b904-563bc36cf137
8.251 INFO: Reading 'startup' options from /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc: --output_base=/opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1
8.251 INFO: Options provided by the client:
8.251   Inherited 'common' options: --isatty=0 --terminal_columns=80
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc:
8.251   Inherited 'common' options: --announce_rc
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake/tools/bazel.rc:
8.251   Inherited 'common' options: --@drake//tools/flags:public_repo_default=pkgconfig --@drake//tools/flags:private_runtime_repo_default=external --incompatible_autoload_externally=
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc:
8.251   Inherited 'common' options: --@drake//tools/flags:public_repo_default=module --@drake//tools/flags:private_runtime_repo_default=internal --repo_env=CC=/usr/bin/cc --repo_env=CXX=/usr/bin/c++
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake/tools/bazel.rc:
8.251   'build' options: --@@spdlog+//:header_only=False -c opt --strip=never --strict_system_includes --extra_toolchains=@python//:all --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 --incompatible_default_to_explicit_init_py --test_output=errors --test_summary=terse --test_tag_filters=-gurobi,-mosek,-snopt --test_env=GRB_LICENSE_FILE --test_env=MOSEKLM_LICENSE_FILE --test_env=LCM_DEFAULT_URL=memq:// --test_env=MPLBACKEND=Template
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake/tools/ubuntu.bazelrc:
8.251   'build' options: --force_pic --fission=dbg --features=per_object_debug_info --action_env=PATH=/usr/bin:/bin --action_env=PYTHONNOUSERSITE=1 --test_env=PYTHONNOUSERSITE=1
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake/tools/ubuntu-jammy.bazelrc:
8.251   'build' options: --define=UBUNTU_VERSION=22.04
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc:
8.251   'build' options: --symlink_prefix=/ --notrim_test_configuration --action_env=CCACHE_DISABLE=1 --@drake//tools/cc_toolchain:compiler_major=11 --@drake//tools/flags:with_clarabel=True --@drake//tools/flags:with_clp=True --@drake//tools/flags:with_csdp=True --@drake//tools/flags:with_ipopt=True --@drake//tools/flags:with_nlopt=True --@drake//tools/flags:with_osqp=True --@drake//tools/flags:with_scs=True --config=Release
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake-build/drake.bazelrc:
8.251   'build' options: --disk_cache=/var/cache/bazel/disk_cache --repository_cache=/var/cache/bazel/repository_cache --repo_env=DRAKE_WHEEL=1 --repo_env=SNOPT_PATH=/opt/drake-wheel-build/src/snopt.tar.gz --config=packaging --define=LCM_INSTALL_JAVA=OFF --java_runtime_version=remotejdk_11
8.251 INFO: Reading rc options for 'build' from /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc:
8.251   'build' options: --stamp --workspace_status_command=sed 's/^/STABLE_VERSION /' '/opt/drake-wheel-build/drake-build/VERSION.TXT'
8.251 INFO: Found applicable config definition build:Release in file /opt/drake-wheel-build/drake-build/drake_build_cwd/.bazelrc: --compilation_mode=opt
8.251 INFO: Found applicable config definition build:packaging in file /opt/drake-wheel-build/drake/tools/bazel.rc: --test_tag_filters=-gurobi --@drake//tools/flags:with_mosek=True --@drake//tools/flags:with_snopt=True
8.251 INFO: Found applicable config definition build:packaging in file /opt/drake-wheel-build/drake/tools/ubuntu.bazelrc: --config=omp
8.251 INFO: Found applicable config definition build:omp in file /opt/drake-wheel-build/drake/tools/ubuntu.bazelrc: --copt=-DEIGEN_DONT_PARALLELIZE --copt=-fopenmp --linkopt=-fopenmp
8.287 Computing main repo mapping:
9.289 Computing main repo mapping:
11.29 Computing main repo mapping:
11.40 Loading:
11.41 Loading: 3 packages loaded
11.64 Analyzing: target @@drake+//:install (4 packages loaded, 0 targets configured)
11.66 Analyzing: target @@drake+//:install (4 packages loaded, 0 targets configured)
11.66
12.72 Analyzing: target @@drake+//:install (49 packages loaded, 7 targets configured)
12.72
14.29 Analyzing: target @@drake+//:install (50 packages loaded, 7 targets configured)
14.29
33.96 Analyzing: target @@drake+//:install (50 packages loaded, 7 targets configured)
33.96
34.88 WARNING: Download from https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was sha256-66Pz1BTS+MuikZx47G2qsI/HG6K6SuUCt+XU2Z/ALNo= but wanted sha256-HMqrv+hw9grz1qUZxT4J89z2MCBzId/6VTVkqOdcT8g=
34.89 INFO: Repository eigen+ instantiated at:
34.89   <builtin>: in <toplevel>
34.89 Repository rule http_archive defined at:
34.89   /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/bazel_tools/tools/build_defs/repo/http.bzl:392:31: in <toplevel>
34.89 ERROR: /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/bazel_tools/tools/build_defs/repo/http.bzl:137:45: An error occurred during the fetch of repository 'eigen+':
34.89    Traceback (most recent call last):
34.89   File "/opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/bazel_tools/tools/build_defs/repo/http.bzl", line 137, column 45, in _http_archive_impl
34.89       download_info = ctx.download_and_extract(
34.89 Error in download_and_extract: java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip] to /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/eigen+/temp5696972740384926688/eigen-3.4.0.zip: Checksum was sha256-66Pz1BTS+MuikZx47G2qsI/HG6K6SuUCt+XU2Z/ALNo= but wanted sha256-HMqrv+hw9grz1qUZxT4J89z2MCBzId/6VTVkqOdcT8g=
34.95 ERROR: no such package '@@eigen+//': java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip] to /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/eigen+/temp5696972740384926688/eigen-3.4.0.zip: Checksum was sha256-66Pz1BTS+MuikZx47G2qsI/HG6K6SuUCt+XU2Z/ALNo= but wanted sha256-HMqrv+hw9grz1qUZxT4J89z2MCBzId/6VTVkqOdcT8g=
34.95 ERROR: /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/drake+/tools/workspace/eigen/BUILD.bazel:83:16: @@drake+//tools/workspace/eigen:install_license depends on @@eigen+//:license.MPL2 in repository @@eigen+ which failed to fetch. no such package '@@eigen+//': java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip] to /opt/drake-wheel-build/drake-build/_bazel_/3b6b6375bf687155420c1562741ac8e1/external/eigen+/temp5696972740384926688/eigen-3.4.0.zip: Checksum was sha256-66Pz1BTS+MuikZx47G2qsI/HG6K6SuUCt+XU2Z/ALNo= but wanted sha256-HMqrv+hw9grz1qUZxT4J89z2MCBzId/6VTVkqOdcT8g=
34.96 Analyzing: target @@drake+//:install (203 packages loaded, 3187 targets configured)
34.96
34.97 ERROR: Analysis of target '@@drake+//:install' failed; build aborted: Analysis failed
34.99 INFO: Elapsed time: 30.876s, Critical Path: 0.04s
34.99 INFO: 1 process: 1 internal.
34.99 ERROR: Build did NOT complete successfully
34.99 FAILED:
35.03 make[2]: *** [CMakeFiles/drake_cxx_python.dir/build.make:70: CMakeFiles/drake_cxx_python] Error 1
35.03 make[1]: *** [CMakeFiles/Makefile2:867: CMakeFiles/drake_cxx_python.dir/all] Error 2
35.03 make: *** [Makefile:146: all] Error 2
------
Dockerfile:50
--------------------
  49 |
  50 | >>> RUN --mount=type=cache,target=/var/cache/bazel \
  51 | >>>     /image/build-drake.sh
  52 |
--------------------

Which seems to imply that the checksum is not matching for the downloaded version of eigen 3.4. Are there any extra steps needed to build the whl or is it likely an issue with my network?

I'm using the v1.40.0 commit and tried this build on a clean install of Ubuntu.


Solution

  • GitLab broke the stability of their zipfile downloads. See bazel-central-registry#4355 for details and tracking on the fix.

    I imagine there is a way to edit drake/MODULE.bazel to adjust the bazel_dep on Eigen to refer to a valid source archive, but I don't immediately know what it is.

    Edited to add: The fix now is to edit drake/MODULE.bazel to specify an Eigen version of 3.4.0.bcr.3 instead of 3.4.0.bcr.2.