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

Migrate to bzlmod #56

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.1.0
13 changes: 13 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module(name = "clodl")

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
bazel_dep(name = "stardoc", version = "0.6.2")

nix_repo = use_extension("@rules_nixpkgs_core//extensions:repository.bzl", "nix_repo")
nix_repo.nixpkgs_local_repository(
name = "nixpkgs",
nix_file = "//:nixpkgs.nix",
)
use_repo(nix_repo, "nixpkgs")
95 changes: 0 additions & 95 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,95 +0,0 @@
workspace(name = "io_tweag_clodl")

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

http_archive(
name = "io_bazel_stardoc",
sha256 = "6d07d18c15abb0f6d393adbd6075cd661a2219faab56a9517741f0fc755f6f3c",
strip_prefix = "stardoc-0.4.0",
urls = ["https://github.com/bazelbuild/stardoc/archive/0.4.0.tar.gz"],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

##################################################################
# buildifier setup
##################################################################

# 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 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
],
)

http_archive(
name = "bazel_skylib",
sha256 = "e5d90f0ec952883d56747b7604e2a15ee36e288bb556c3d0ed33e818a4d971f2",
strip_prefix = "bazel-skylib-1.0.2",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/1.0.2.tar.gz"],
)

http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "5c80f5ed7b399a857dd04aa81e66efcb012906b268ce607aaf491d8d71f456c8",
strip_prefix = "rules_nixpkgs-0.7.0",
urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.7.0.tar.gz"],
)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl",
"nixpkgs_go_configure",
)
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_local_repository",
)

nixpkgs_local_repository(
name = "nixpkgs",
nix_file = "//:nixpkgs.nix",
)

nixpkgs_go_configure(repository = "@nixpkgs")

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

go_rules_dependencies()

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

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

gazelle_dependencies()

http_archive(
name = "com_google_protobuf",
sha256 = "e8c7601439dbd4489fe5069c33d374804990a56c2f710e00227ee5d8fd650e67",
strip_prefix = "protobuf-3.11.2",
urls = [
"https://github.com/google/protobuf/archive/v3.11.2.tar.gz",
],
)

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

protobuf_deps()

http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-master",
url = "https://github.com/bazelbuild/buildtools/archive/master.zip",
)
11 changes: 0 additions & 11 deletions buildifier/BUILD

This file was deleted.

17 changes: 17 additions & 0 deletions buildifier/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier-diff",
exclude_patterns = [
"./.git/*",
],
mode = "diff",
)

buildifier(
name = "buildifier",
exclude_patterns = [
"./.git/*",
],
lint_mode = "warn",
)
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/BUILD → docs/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@stardoc//stardoc:stardoc.bzl", "stardoc")

stardoc(
name = "docs",
Expand Down
3 changes: 2 additions & 1 deletion nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import (fetchTarball "https://github.com/nixos/nixpkgs/archive/46113713d4f25579e07b78116a61ab6f178f4153.tar.gz")
# NixOS 24.05 (2024-06-14)
import (fetchTarball "https://github.com/nixos/nixpkgs/archive/cc54fb41d13736e92229c21627ea4f22199fee6b.tar.gz")
22 changes: 0 additions & 22 deletions serve-docs.sh

This file was deleted.

2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mkShell {
# See: https://github.com/bazelbuild/bazel/issues/4231
BAZEL_USE_CPP_ONLY_TOOLCHAIN=1;
buildInputs = [
bazel
bazel_7
binutils
cacert
git
Expand Down
File renamed without changes.
Loading