From 6f41f114c7f9270383a94893b11ab906e0fc2105 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 1 Nov 2023 13:13:55 -0700 Subject: [PATCH] Minimal set of changes to get CI green (#65) * Minimal set of changes to get CI green. Split from #63 Signed-off-by: Michael Carroll * Use default fuel_tools branch Signed-off-by: Michael Carroll * apt update Signed-off-by: Michael Carroll --------- Signed-off-by: Michael Carroll --- .github/actions/bazel-ci-jammy/run.sh | 1 + BUILD.bazel | 4 +++- example/bazel.repos | 4 ++-- skylark/build_defs.bzl | 15 +++++++++++++++ workspace/default.bzl | 3 +++ workspace/rules_license/BUILD.bazel | 3 +++ workspace/rules_license/repository.bzl | 14 ++++++++++++++ 7 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 workspace/rules_license/BUILD.bazel create mode 100644 workspace/rules_license/repository.bzl diff --git a/.github/actions/bazel-ci-jammy/run.sh b/.github/actions/bazel-ci-jammy/run.sh index addeda4..6f921b6 100755 --- a/.github/actions/bazel-ci-jammy/run.sh +++ b/.github/actions/bazel-ci-jammy/run.sh @@ -43,6 +43,7 @@ EXCLUDE_APT="libignition|libgz|libsdformat|libogre|dart" UBUNTU_VERSION=`lsb_release -cs` ALL_PACKAGES=$( \ sort -u $(find . -iname 'packages-'$UBUNTU_VERSION'.apt' -o -iname 'packages.apt') | grep -Ev $EXCLUDE_APT | tr '\n' ' ') +sudo apt update sudo apt install --no-install-recommends --quiet --yes $ALL_PACKAGES echo ::endgroup:: diff --git a/BUILD.bazel b/BUILD.bazel index dcfe33f..4819fe4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,8 +3,8 @@ load( "@gz//bazel/skylark:build_defs.bzl", "GZ_FEATURES", "GZ_VISIBILITY", + "add_lint_tests", ) -load("@gz//bazel/lint:lint.bzl", "add_lint_tests") package( default_visibility = GZ_VISIBILITY, @@ -13,4 +13,6 @@ package( licenses(["notice"]) +exports_files(["LICENSE"]) + add_lint_tests() diff --git a/example/bazel.repos b/example/bazel.repos index e33d7cd..48df445 100644 --- a/example/bazel.repos +++ b/example/bazel.repos @@ -14,7 +14,7 @@ repositories: fuel_tools: type: git url: https://github.com/gazebosim/gz-fuel-tools - version: mjcarroll/garden_bazel + version: gz-fuel-tools8 math: type: git url: https://github.com/gazebosim/gz-math @@ -22,7 +22,7 @@ repositories: msgs: type: git url: https://github.com/gazebosim/gz-msgs - version: gz-msgs9 + version: gz-msgs9 physics: type: git url: https://github.com/gazebosim/gz-physics diff --git a/skylark/build_defs.bzl b/skylark/build_defs.bzl index 0516847..64086d8 100644 --- a/skylark/build_defs.bzl +++ b/skylark/build_defs.bzl @@ -14,6 +14,16 @@ load( ":gz_include_header.bzl", _gz_include_header = "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + _add_lint_tests = "add_lint_tests", +) +load( + "@rules_python//python:defs.bzl", + _py_binary = "py_binary", + _py_library = "py_library", + _py_test = "py_test", +) GZ_ROOT = "@gz//" @@ -32,3 +42,8 @@ cmake_configure_file = _cmake_configure_file gz_configure_header = _gz_configure_header gz_export_header = _gz_export_header gz_include_header = _gz_include_header +add_lint_tests = _add_lint_tests + +gz_py_binary = _py_binary +gz_py_library = _py_library +gz_py_test = _py_test diff --git a/workspace/default.bzl b/workspace/default.bzl index 9d7b03c..e367282 100644 --- a/workspace/default.bzl +++ b/workspace/default.bzl @@ -26,6 +26,7 @@ load("@gz//bazel/workspace/nlopt:repository.bzl", "nlopt_repository") # noqa load("@gz//bazel/workspace/ode:repository.bzl", "ode_repository") # noqa load("@gz//bazel/workspace/osg:repository.bzl", "osg_repository") # noqa load("@gz//bazel/workspace/pycodestyle:repository.bzl", "pycodestyle_repository") # noqa +load("@gz//bazel/workspace/rules_license:repository.bzl", "rules_license_repository") # noqa load("@gz//bazel/workspace/rules_proto:repository.bzl", "rules_proto_repository") # noqa load("@gz//bazel/workspace/rules_python:repository.bzl", "rules_python_repository") # noqa load("@gz//bazel/workspace/rules_qt:repository.bzl", "rules_qt_repository") # noqa @@ -98,6 +99,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): osg_repository(name = "osg") if "pycodestyle" not in excludes: pycodestyle_repository(name = "pycodestyle", mirrors = mirrors) + if "rules_license" not in excludes: + rules_license_repository(name = "rules_license", mirrors = mirrors) if "rules_proto" not in excludes: rules_proto_repository(name = "rules_proto", mirrors = mirrors) if "rules_python" not in excludes: diff --git a/workspace/rules_license/BUILD.bazel b/workspace/rules_license/BUILD.bazel new file mode 100644 index 0000000..1f52546 --- /dev/null +++ b/workspace/rules_license/BUILD.bazel @@ -0,0 +1,3 @@ +load("@gz//bazel/lint:lint.bzl", "add_lint_tests") + +add_lint_tests() diff --git a/workspace/rules_license/repository.bzl b/workspace/rules_license/repository.bzl new file mode 100644 index 0000000..d007bf5 --- /dev/null +++ b/workspace/rules_license/repository.bzl @@ -0,0 +1,14 @@ +# -*- python -*- + +load("@gz//bazel/workspace:github.bzl", "github_archive") + +def rules_license_repository( + name, + mirrors = None): + github_archive( + name = name, + repository = "bazelbuild/rules_license", # License: Apache-2.0 + commit = "0.0.7", + sha256 = "7626bea5473d3b11d44269c5b510a210f11a78bca1ed639b0f846af955b0fe31", # noqa + mirrors = mirrors, + )