Skip to content

Commit

Permalink
Use rules_cc to try to clean up CI runs which are failing on gcc (#764)
Browse files Browse the repository at this point in the history
* try useing rules_cc to clean up CI runs which are failing on gcc"

* use their toolchains

* add rules_cc so the tests run

* do not do distro tests on rolling macos

* only tests tests/... for rolling_macos
  • Loading branch information
aiuto authored Oct 24, 2023
1 parent 006af3e commit 2b391f2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .bazelci/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ tasks:
<<: *rolling
rolling_macos:
name: rolling_macos
<<: *macos
# It seems there is no rolling Bazel for macos.
platform: macos
bazel: last_green
<<: *common
test_targets:
- "//tests/..."
- "-//tests/rpm/..."
rolling_windows:
name: rolling_windows
<<: *windows
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ bazel_dep(name = "rules_python", version = "0.10.2")
# Only for development
bazel_dep(name = "platforms", version = "0.0.5", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.5.3", dev_dependency = True)
bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True)
12 changes: 12 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ http_archive(
load("@bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")

rules_cc_dependencies()

rules_cc_toolchains()
14 changes: 14 additions & 0 deletions examples/rich_structure/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

workspace(name = "rich_structure")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

local_repository(
name = "rules_pkg",
path = "../..",
Expand All @@ -22,3 +24,15 @@ local_repository(
load("@rules_pkg//pkg:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")

rules_cc_dependencies()

rules_cc_toolchains()
1 change: 1 addition & 0 deletions examples/rich_structure/src/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "pkg_mklink")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//:foo_defs.bzl", "shared_object_path_selector")
Expand Down
1 change: 1 addition & 0 deletions examples/rich_structure/src/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "pkg_mkdirs")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//:foo_defs.bzl", "shared_object_path_selector")
Expand Down
1 change: 1 addition & 0 deletions tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# -*- coding: utf-8 -*-

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_python//python:defs.bzl", "py_test")
load(":my_package_name.bzl", "my_package_naming")
load(":path_test.bzl", "path_tests")
Expand Down

0 comments on commit 2b391f2

Please sign in to comment.