Skip to content

Migrate buildifier to MODULE [IO-410] #163

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion .bazeliskrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
USE_BAZEL_VERSION=6.2.0
USE_BAZEL_VERSION=7.6.1
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier",
Expand Down
17 changes: 17 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (C) 2022 Swift Navigation Inc.
# Contact: Swift Navigation <dev@swift-nav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

module(
name = "rules_swiftnav",
version = "0.1.0",
Expand Down Expand Up @@ -47,3 +57,10 @@ register_toolchains(

yocto_generic_ext = use_extension("@rules_swiftnav//cc/toolchains/yocto_generic:yocto_generic_extension.bzl", "yocto_generic_extension")
use_repo(yocto_generic_ext, "yocto_generic")

# Register the buildifier toolchain
bazel_dep(
name = "buildifier_prebuilt",
version = "8.2.0.2",
dev_dependency = True,
)
1,046 changes: 268 additions & 778 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

70 changes: 0 additions & 70 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1,70 +0,0 @@
# Copyright (C) 2022 Swift Navigation Inc.
# Contact: Swift Navigation <dev@swift-nav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

workspace(name = "rules_swiftnav")

# Everything below this comment is for buildifier

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

# buildifier is written in Go and hence needs rules_go to be built.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
name = "io_bazel_rules_go",
sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")

go_rules_dependencies()

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")

go_register_toolchains(version = "1.17.2")

http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

# If you use WORKSPACE.bazel, use the following line instead of the bare gazelle_dependencies():
gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel")

http_archive(
name = "com_google_protobuf",
sha256 = "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568",
strip_prefix = "protobuf-3.19.4",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v3.19.4.tar.gz",
],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

http_archive(
name = "com_github_bazelbuild_buildtools",
sha256 = "ae34c344514e08c23e90da0e2d6cb700fcd28e80c02e23e4d5715dddcb42f7b3",
strip_prefix = "buildtools-4.2.2",
urls = [
"https://github.com/bazelbuild/buildtools/archive/refs/tags/4.2.2.tar.gz",
],
)
2 changes: 1 addition & 1 deletion cc/toolchains/gcc_arm_embedded/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

def _impl(ctx):
SDK_PATH_PREFIX = "wrappers/arm-none-eabi-{}"
Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/gcc_arm_gnu_8_3/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

def _impl(ctx):
SDK_PATH_PREFIX = "wrappers/aarch64-linux-gnu-{}"
Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/llvm/swift_custom_features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Bug fixes, ports of features from newer versions, etc.. should be put as they
appear in upstream in unix_cc_toolchain_config.bzl.
"""

load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"flag_group",
"flag_set",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")

_all_compile_actions = [
ACTION_NAMES.c_compile,
Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/llvm/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""A Starlark cc_toolchain configuration rule"""

load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
Expand All @@ -27,7 +28,6 @@ load(
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"swift_custom_features.bzl",
"c11_standard_feature",
Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/llvm_x86_64_windows/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

def _impl(ctx):
SDK_PATH_PREFIX = "wrappers/x86_64-w64-mingw32uwp-{}"
Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/musl/aarch64/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

SDK_PATH_PREFIX = "wrappers/aarch64-linux-musl-{}"

Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/musl/armhf/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

SDK_PATH_PREFIX = "wrappers/arm-linux-musleabihf-{}"

Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/musl/x86_64/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")

SDK_PATH_PREFIX = "wrappers/x86_64-linux-musl-{}"

Expand Down
2 changes: 1 addition & 1 deletion cc/toolchains/yocto_generic/config.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "feature", "flag_group", "flag_set", "tool_path", "with_feature_set")
load(
"@yocto_generic//:toolchain.bzl",
"AR",
Expand Down
2 changes: 1 addition & 1 deletion clang_tidy/clang_tidy.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("//cc:defs.bzl", "BINARY", "LIBRARY")
load("//cc_files:get_cc_files.bzl", "get_cc_srcs")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")

def _flatten(input_list):
return [item for sublist in input_list for item in sublist]
Expand Down
2 changes: 1 addition & 1 deletion image/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_swiftnav//image:transition.bzl", "multi_arch")
load("@rules_oci//oci:defs.bzl", "oci_image_index")
load("@rules_swiftnav//image:transition.bzl", "multi_arch")

def swift_image_index(name, image, platforms, **kwargs):
"""
Expand Down
6 changes: 3 additions & 3 deletions third_party/netcdf-c.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
netcdf-c@4.9.0
"""

load("@rules_swiftnav//tools:configure_file.bzl", "configure_file")
load("@rules_swiftnav//third_party/netcdf-c:aarch64-darwin-config.bzl", "AARCH64_DARWIN_CONFIG")
load("@rules_swiftnav//third_party/netcdf-c:x86_64-darwin-config.bzl", "X86_64_DARWIN_CONFIG")
load("@rules_swiftnav//third_party/netcdf-c:linux-config.bzl", "LINUX_CONFIG")
load("@rules_swiftnav//third_party/netcdf-c:attr.bzl", "attr")
load("@rules_swiftnav//third_party/netcdf-c:linux-config.bzl", "LINUX_CONFIG")
load("@rules_swiftnav//third_party/netcdf-c:ncx.bzl", "ncx")
load("@rules_swiftnav//third_party/netcdf-c:putget.bzl", "putget")
load("@rules_swiftnav//third_party/netcdf-c:x86_64-darwin-config.bzl", "X86_64_DARWIN_CONFIG")
load("@rules_swiftnav//tools:configure_file.bzl", "configure_file")

configure_file(
name = "netcdf_dispatch",
Expand Down
Loading