Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-#1547 Fix bazel dependency handling #2361

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
11 changes: 8 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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()
29 changes: 0 additions & 29 deletions bazel/bazelbuild/setup.bzl

This file was deleted.

13 changes: 0 additions & 13 deletions bazel/buildifier_prebuilt/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 0 additions & 3 deletions bazel/buildifier_prebuilt/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 2 additions & 1 deletion bazel/load_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down
2 changes: 2 additions & 0 deletions bazel/setup_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Empty file added bazel/skylib/BUILD.bazel
Empty file.
35 changes: 35 additions & 0 deletions bazel/skylib/repositories.bzl
Original file line number Diff line number Diff line change
@@ -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),
],
)
13 changes: 5 additions & 8 deletions bazel/deps.bzl → bazel/skylib/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 3 additions & 3 deletions tools/scripts/iceoryx_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ 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;;
No ) exit 0;;
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;;
No ) exit 0;;
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;;
Expand Down
Loading