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-#2325 support bzlmod #2338

Merged
merged 10 commits into from
Sep 9, 2024
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
2 changes: 0 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
build --noenable_bzlmod

build --enable_platform_specific_config
build:linux --cxxopt="-std=c++17"
build:macos --cxxopt="-std=c++17"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ tools/website/generated/
*.project
__pycache__
/bazel-*
MODULE.bazel.lock
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
elBoberido marked this conversation as resolved.
Show resolved Hide resolved

exports_files(["LICENSE"])

Expand Down
15 changes: 15 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module(
name = "org_eclipse_iceroyx",
version = "2.95.0",
)

bazel_dep(name = "cpptoml", version = "0.1.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.9")

bazel_dep(
name = "buildifier_prebuilt",
version = "7.1.2",
dev_dependency = True,
)
bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True)
Empty file added WORKSPACE.bzlmod
Empty file.
Empty file.
48 changes: 48 additions & 0 deletions bazel/buildifier_prebuilt/repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
Copyright 2024, Eclipse Foundation and the iceoryx contributors. 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

This module downloads the buildifier prebuilt project and its deps: https://github.com/keith/buildifier-prebuilt
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
elBoberido marked this conversation as resolved.
Show resolved Hide resolved
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():
maybe(
name = "buildifier_prebuilt",
repo_rule = http_archive,
sha256 = "7f85b688a4b558e2d9099340cfb510ba7179f829454fba842370bccffb67d6cc",
strip_prefix = "buildifier-prebuilt-{version}".format(version = BUILDIFIER_PREBUILT_VERSION),
urls = [
"http://github.com/keith/buildifier-prebuilt/archive/{version}.tar.gz".format(version = BUILDIFIER_PREBUILT_VERSION),
],
)
30 changes: 30 additions & 0 deletions bazel/buildifier_prebuilt/setup.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Copyright 2024, Eclipse Foundation and the iceoryx contributors. 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

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()
8 changes: 4 additions & 4 deletions bazel/load_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ limitations under the License.
SPDX-License-Identifier: Apache-2.0
"""

load("//bazel/bazelbuild:repositories.bzl", "load_com_github_bazelbuild_buildtools_repositories", "load_com_github_bazelbuild_rules_cc_repositories", "load_com_google_protobuf_repositories", "load_io_bazel_rules_go_repositories")
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/cpptoml:repositories.bzl", "load_cpptoml_repositories")
load("//bazel/googletest:repositories.bzl", "load_googletest_repositories")

Expand All @@ -25,8 +26,7 @@ def load_repositories():
Loads repositories for iceoryx dependencies
"""
load_com_github_bazelbuild_rules_cc_repositories()
load_io_bazel_rules_go_repositories()
load_com_google_protobuf_repositories()
load_com_github_bazelbuild_buildtools_repositories()
load_bazel_skylib_repositories()
load_buildifier_prebuilt_repositories()
load_googletest_repositories()
load_cpptoml_repositories()
4 changes: 2 additions & 2 deletions bazel/setup_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ limitations under the License.
SPDX-License-Identifier: Apache-2.0
"""

load("//bazel/bazelbuild:setup.bzl", "setup_go_protobuf_for_bazelbuild")
load("//bazel/buildifier_prebuilt:setup.bzl", "setup_buildifier_prebuilt")

def setup_repositories():
"""
Loads repositories for iceoryx dependencies
"""
setup_go_protobuf_for_bazelbuild()
setup_buildifier_prebuilt()
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
- Make iceoryx resource prefix a compile time option [#2272](https://github.com/eclipse-iceoryx/iceoryx/issues/2272)
- Improve introspection-client interface by adding the number of ports in parentheses [#2299](https://github.com/eclipse-iceoryx/iceoryx/issues/2299)
- Add std::atomic abstraction [#2329](https://github.com/eclipse-iceoryx/iceoryx/issues/2329)
- Port iceoryx to bzlmod [#2325](https://github.com/eclipse-iceoryx/iceoryx/issues/2325)

**Bugfixes:**

Expand Down
1 change: 1 addition & 0 deletions iceoryx_hoofs/test/moduletests/test_utility_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <cmath>
#include <cstdint>
#include <iomanip>
#include <tuple>
namespace
{
Expand Down
Loading