mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
TL;DR: kill https://github.com/wpilibsuite/bzlmodRio-libssh, update versions, and make things easier for a script to update. The main motivation behind this was that libssh was out of date with the gradle version. Using these "external" dependencies can cause agita as we churn through toolchain updates. Unlike the toolchains and opencv, which can be used by external users (i.e. a all bazel robot, if a vendor wanted to use bazel) a C++ wrapper around libssh maven deps almost certainly wouldn't be pulled in, much like ceres and mrclib. As a result of vendor'ing libssh, and knowing some potential pitfalls and annoyances, this PR does the following: - Vendor libssh, akin to how mrclib is pulled in - Moves the vendor'd ceres to `shared/bazel/thirdparty`, and refactors it to better match mrclib. To me it doesn't necessarily belong in its `thirdparty` location because it is bazel only. - Due to the refactoring, libssh and ceres can now be pulled into `MODULE.bazel` instead of the `WORKSPACE.bzlmod` helper. This is good prep for a potential upgrade to killing `--enable_workspace` / bazel 9 - Write a python script that can deal with the integrity / sha256 of the http_archives. I suggested this be added to davo's mrclib PR, but this one is a little bit more robust and will actually edit the files in place. This makes upgrading versions substantially easier. - Upgrade libssh version to what gradle is using, and mrclib to the version in #8858. These changes have been tested against that PR.
61 lines
2.6 KiB
Plaintext
61 lines
2.6 KiB
Plaintext
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
################################################################################
|
|
# Generated by shared/bazel/thirdparty/integrity_helper.py
|
|
url_pattern = "https://frcmaven.wpi.edu/artifactory/development/edu/wpi/first/thirdparty/frc2026/ceres/ceres-cpp/2.2-1/ceres-cpp-2.2-1-%s.zip"
|
|
|
|
headers_integrity = "sha256-ITP1hirOrcna3tyOUQyniUGPw5JeeC8Ffm5scno865w="
|
|
|
|
_LIB_ARTIFACTS = {
|
|
"linuxarm32static": ("linux", "**/*.a", "sha256-ptlO1AuEWz84nAZn0fdXDf6fRsfj1EQu+/FR7PQO8Pk="),
|
|
"linuxarm32staticdebug": ("linux", "**/*.a", "sha256-1n5wFPsML0HYuOodbiDTT4taxo5k/IC7to7YBPQtM1Q="),
|
|
"linuxarm64static": ("linux", "**/*.a", "sha256-sBoNq7nTyllKJnOvyNm+IAxnKi8wP3YymaMwK2m8qCw="),
|
|
"linuxarm64staticdebug": ("linux", "**/*.a", "sha256-44RmHzCSx8rptaaP3DC2IbTy4p61oAHzfzvomCALk6I="),
|
|
"linuxx86-64static": ("linux", "**/*.a", "sha256-ntuu0fS01f/vkL4rMaYEuUaDvuYqQwwqLKcQy6yJwd8="),
|
|
"linuxx86-64staticdebug": ("linux", "**/*.a", "sha256-2CmV1Z+gM3AKq/+rC9WSn8Gkx/OXLnVMjHlGT1kmB/c="),
|
|
"osxuniversalstatic": ("osx", "**/*.a", "sha256-ExnU2z+kGU0iaYRmOpcPCLWdwIDKhVpQnN2g6iJ/z/U="),
|
|
"osxuniversalstaticdebug": ("osx", "**/*.a", "sha256-dnqxm5qgVBKD43ORCIkYH+mXi7oQQKbCTWDY1GdTNfQ="),
|
|
"windowsarm64static": ("windows", "**/*.lib", "sha256-obWGoORklu5g//x7CmykDX4S4g7ixy9RECdui5zy28g="),
|
|
"windowsarm64staticdebug": ("windows", "**/*.lib", "sha256-iL/rdZ2i+9+48IxQEK3Ty8/zQkp/1h9halDG9YEEXz0="),
|
|
"windowsx86-64static": ("windows", "**/*.lib", "sha256-wPhWBdyEC3AK6KgUgbvJsxWODGPSUMbAZmdEE7zSJ9Y="),
|
|
"windowsx86-64staticdebug": ("windows", "**/*.lib", "sha256-ibozSdLVUEYAuECwKtTKrqZB5pNFdajktwF2TEw+aDg="),
|
|
}
|
|
# End auto-gen
|
|
################################################################################
|
|
|
|
http_archive(
|
|
name = "ceres_headers",
|
|
build_file_content = """
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
cc_library(
|
|
name = "headers",
|
|
hdrs = glob(["ceres/**", "glog/**", "suitesparse/**", "openblas/**"]),
|
|
includes = ["."],
|
|
deps = ["@//wpimath:eigen-headers"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
""",
|
|
integrity = headers_integrity,
|
|
url = url_pattern % "headers",
|
|
)
|
|
|
|
library_build_content = """
|
|
filegroup(
|
|
name = "lib",
|
|
srcs = glob(["%s"]),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
"""
|
|
|
|
[
|
|
http_archive(
|
|
name = "ceres_" + artifact,
|
|
build_file_content = library_build_content % glob_pattern,
|
|
integrity = integrity,
|
|
strip_prefix = prefix,
|
|
url = url_pattern % artifact,
|
|
)
|
|
for artifact, (prefix, glob_pattern, integrity) in _LIB_ARTIFACTS.items()
|
|
]
|