diff --git a/.bazelrc b/.bazelrc index 5ad9311a32..08fd10222d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -38,6 +38,9 @@ build:tsan --linkopt="-fsanitize=thread" # tsan clang build:clang_tsan --config=clang --config=tsan +# do not use bzlmod for now +build --noenable_bzlmod + # # feature flags # diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 76d740b401..cf307cf179 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -16,7 +16,12 @@ workspace(name = "org_eclipse_iceoryx") -# Load dependency googletest -load("//bazel:deps.bzl", "iceoryx_deps") +# Load iceoryx dependencies +load("//bazel:load_repositories.bzl", "load_repositories") -iceoryx_deps() +load_repositories() + +# Setup iceoryx dependencies +load("//bazel:setup_repositories.bzl", "setup_repositories") + +setup_repositories() diff --git a/bazel/bazelbuild/setup.bzl b/bazel/bazelbuild/setup.bzl deleted file mode 100644 index 4dcc07e104..0000000000 --- a/bazel/bazelbuild/setup.bzl +++ /dev/null @@ -1,29 +0,0 @@ -""" -Copyright (c) 2022 by Apex.AI Inc. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -SPDX-License-Identifier: Apache-2.0 - -Macro for setting the dependencies for the buildtools of bazel -""" - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -def setup_go_protobuf_for_bazelbuild(): - go_rules_dependencies() - - go_register_toolchains(version = "1.17.2") - - protobuf_deps() diff --git a/bazel/buildifier_prebuilt/repositories.bzl b/bazel/buildifier_prebuilt/repositories.bzl index 3ff4e3c0c3..a873c9f8a5 100644 --- a/bazel/buildifier_prebuilt/repositories.bzl +++ b/bazel/buildifier_prebuilt/repositories.bzl @@ -21,19 +21,6 @@ This module downloads the buildifier prebuilt project and its deps: https://gith load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -BAZEL_SKYLIB_VERSION = "1.7.1" - -def load_bazel_skylib_repositories(): - maybe( - name = "bazel_skylib", - repo_rule = http_archive, - sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), - "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), - ], - ) - BUILDIFIER_PREBUILT_VERSION = "7.3.1" def load_buildifier_prebuilt_repositories(): diff --git a/bazel/buildifier_prebuilt/setup.bzl b/bazel/buildifier_prebuilt/setup.bzl index 37836213c7..c0444b59b4 100644 --- a/bazel/buildifier_prebuilt/setup.bzl +++ b/bazel/buildifier_prebuilt/setup.bzl @@ -18,13 +18,10 @@ SPDX-License-Identifier: Apache-2.0 This module prepares the buildifier prebuilt project and its deps: https://github.com/keith/buildifier-prebuilt """ -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@buildifier_prebuilt//:defs.bzl", "buildifier_prebuilt_register_toolchains") load("@buildifier_prebuilt//:deps.bzl", "buildifier_prebuilt_deps") def setup_buildifier_prebuilt(): buildifier_prebuilt_deps() - bazel_skylib_workspace() - buildifier_prebuilt_register_toolchains() diff --git a/bazel/load_repositories.bzl b/bazel/load_repositories.bzl index 7ed8e0e36f..7e81e86af4 100644 --- a/bazel/load_repositories.bzl +++ b/bazel/load_repositories.bzl @@ -17,9 +17,10 @@ SPDX-License-Identifier: Apache-2.0 """ load("//bazel/bazelbuild:repositories.bzl", "load_com_github_bazelbuild_rules_cc_repositories") -load("//bazel/buildifier_prebuilt:repositories.bzl", "load_bazel_skylib_repositories", "load_buildifier_prebuilt_repositories") +load("//bazel/buildifier_prebuilt:repositories.bzl", "load_buildifier_prebuilt_repositories") load("//bazel/cpptoml:repositories.bzl", "load_cpptoml_repositories") load("//bazel/googletest:repositories.bzl", "load_googletest_repositories") +load("//bazel/skylib:repositories.bzl", "load_bazel_skylib_repositories") def load_repositories(): """ diff --git a/bazel/setup_repositories.bzl b/bazel/setup_repositories.bzl index e85213cc83..6c303434ea 100644 --- a/bazel/setup_repositories.bzl +++ b/bazel/setup_repositories.bzl @@ -17,9 +17,11 @@ SPDX-License-Identifier: Apache-2.0 """ load("//bazel/buildifier_prebuilt:setup.bzl", "setup_buildifier_prebuilt") +load("//bazel/skylib:setup.bzl", "setup_skylib") def setup_repositories(): """ Loads repositories for iceoryx dependencies """ + setup_skylib() setup_buildifier_prebuilt() diff --git a/bazel/skylib/BUILD.bazel b/bazel/skylib/BUILD.bazel new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bazel/skylib/repositories.bzl b/bazel/skylib/repositories.bzl new file mode 100644 index 0000000000..b24e221155 --- /dev/null +++ b/bazel/skylib/repositories.bzl @@ -0,0 +1,35 @@ +""" +Copyright (c) 2024 by ekxide IO GmbH. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +SPDX-License-Identifier: Apache-2.0 + +Loads dependent repositories from https://github.com/bazelbuild +""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +BAZEL_SKYLIB_VERSION = "1.7.1" + +def load_bazel_skylib_repositories(): + maybe( + name = "bazel_skylib", + repo_rule = http_archive, + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), + "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), + ], + ) diff --git a/bazel/deps.bzl b/bazel/skylib/setup.bzl similarity index 71% rename from bazel/deps.bzl rename to bazel/skylib/setup.bzl index fe9142763c..4c359b54f9 100644 --- a/bazel/deps.bzl +++ b/bazel/skylib/setup.bzl @@ -14,14 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 + +This module prepares the skylib dependency """ -load("//bazel:load_repositories.bzl", "load_repositories") -load("//bazel:setup_repositories.bzl", "setup_repositories") +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") -def iceoryx_deps(): - """ - Loads iceoryx dependencies into workspace - """ - load_repositories() - setup_repositories() +def setup_skylib(): + bazel_skylib_workspace() diff --git a/tools/scripts/iceoryx_release.sh b/tools/scripts/iceoryx_release.sh index b01939861e..b4d2641073 100755 --- a/tools/scripts/iceoryx_release.sh +++ b/tools/scripts/iceoryx_release.sh @@ -22,7 +22,7 @@ set -e WORKSPACE=$(git rev-parse --show-toplevel) -echo "Did you updated the changelogs?" +echo "Did you update the changelogs?" select yn in "Yes" "No"; do case $yn in Yes ) break;; @@ -30,7 +30,7 @@ select yn in "Yes" "No"; do esac done -echo "Did you updated the VERSION file with the new version number?" +echo "Did you update the VERSION file with the new version number?" select yn in "Yes" "No"; do case $yn in Yes ) break;; @@ -38,7 +38,7 @@ select yn in "Yes" "No"; do esac done -echo "Did you updated the VERSION in MODULE.bazel?" +echo "Did you update the version number in MODULE.bazel?" select yn in "Yes" "No"; do case $yn in Yes ) break;;