Skip to content

Commit 361030e

Browse files
authored
Merge pull request #2361 from elBoberido/iox-1547-fix-bazel-dependency-handling
iox-#1547 Fix bazel dependency handling
2 parents 5fd7661 + ba5e427 commit 361030e

File tree

11 files changed

+58
-60
lines changed

11 files changed

+58
-60
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ build:tsan --linkopt="-fsanitize=thread"
3838
# tsan clang
3939
build:clang_tsan --config=clang --config=tsan
4040

41+
# do not use bzlmod for now
42+
build --noenable_bzlmod
43+
4144
#
4245
# feature flags
4346
#

WORKSPACE.bazel

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616

1717
workspace(name = "org_eclipse_iceoryx")
1818

19-
# Load dependency googletest
20-
load("//bazel:deps.bzl", "iceoryx_deps")
19+
# Load iceoryx dependencies
20+
load("//bazel:load_repositories.bzl", "load_repositories")
2121

22-
iceoryx_deps()
22+
load_repositories()
23+
24+
# Setup iceoryx dependencies
25+
load("//bazel:setup_repositories.bzl", "setup_repositories")
26+
27+
setup_repositories()

bazel/bazelbuild/setup.bzl

Lines changed: 0 additions & 29 deletions
This file was deleted.

bazel/buildifier_prebuilt/repositories.bzl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ This module downloads the buildifier prebuilt project and its deps: https://gith
2121
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2222
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
2323

24-
BAZEL_SKYLIB_VERSION = "1.7.1"
25-
26-
def load_bazel_skylib_repositories():
27-
maybe(
28-
name = "bazel_skylib",
29-
repo_rule = http_archive,
30-
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
31-
urls = [
32-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
33-
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
34-
],
35-
)
36-
3724
BUILDIFIER_PREBUILT_VERSION = "7.3.1"
3825

3926
def load_buildifier_prebuilt_repositories():

bazel/buildifier_prebuilt/setup.bzl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ SPDX-License-Identifier: Apache-2.0
1818
This module prepares the buildifier prebuilt project and its deps: https://github.com/keith/buildifier-prebuilt
1919
"""
2020

21-
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2221
load("@buildifier_prebuilt//:defs.bzl", "buildifier_prebuilt_register_toolchains")
2322
load("@buildifier_prebuilt//:deps.bzl", "buildifier_prebuilt_deps")
2423

2524
def setup_buildifier_prebuilt():
2625
buildifier_prebuilt_deps()
2726

28-
bazel_skylib_workspace()
29-
3027
buildifier_prebuilt_register_toolchains()

bazel/load_repositories.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ SPDX-License-Identifier: Apache-2.0
1717
"""
1818

1919
load("//bazel/bazelbuild:repositories.bzl", "load_com_github_bazelbuild_rules_cc_repositories")
20-
load("//bazel/buildifier_prebuilt:repositories.bzl", "load_bazel_skylib_repositories", "load_buildifier_prebuilt_repositories")
20+
load("//bazel/buildifier_prebuilt:repositories.bzl", "load_buildifier_prebuilt_repositories")
2121
load("//bazel/cpptoml:repositories.bzl", "load_cpptoml_repositories")
2222
load("//bazel/googletest:repositories.bzl", "load_googletest_repositories")
23+
load("//bazel/skylib:repositories.bzl", "load_bazel_skylib_repositories")
2324

2425
def load_repositories():
2526
"""

bazel/setup_repositories.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ SPDX-License-Identifier: Apache-2.0
1717
"""
1818

1919
load("//bazel/buildifier_prebuilt:setup.bzl", "setup_buildifier_prebuilt")
20+
load("//bazel/skylib:setup.bzl", "setup_skylib")
2021

2122
def setup_repositories():
2223
"""
2324
Loads repositories for iceoryx dependencies
2425
"""
26+
setup_skylib()
2527
setup_buildifier_prebuilt()

bazel/skylib/BUILD.bazel

Whitespace-only changes.

bazel/skylib/repositories.bzl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
Copyright (c) 2024 by ekxide IO GmbH. All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache-2.0
17+
18+
Loads dependent repositories from https://github.com/bazelbuild
19+
"""
20+
21+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
23+
24+
BAZEL_SKYLIB_VERSION = "1.7.1"
25+
26+
def load_bazel_skylib_repositories():
27+
maybe(
28+
name = "bazel_skylib",
29+
repo_rule = http_archive,
30+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
31+
urls = [
32+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
33+
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
34+
],
35+
)

bazel/deps.bzl renamed to bazel/skylib/setup.bzl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
1616
SPDX-License-Identifier: Apache-2.0
17+
18+
This module prepares the skylib dependency
1719
"""
1820

19-
load("//bazel:load_repositories.bzl", "load_repositories")
20-
load("//bazel:setup_repositories.bzl", "setup_repositories")
21+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2122

22-
def iceoryx_deps():
23-
"""
24-
Loads iceoryx dependencies into workspace
25-
"""
26-
load_repositories()
27-
setup_repositories()
23+
def setup_skylib():
24+
bazel_skylib_workspace()

0 commit comments

Comments
 (0)