-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
77 lines (64 loc) · 3.39 KB
/
Copy pathMODULE.bazel
File metadata and controls
77 lines (64 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module(
name = "workspace",
repo_name = "com_github_alextereshenkov_dgquery",
)
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1", dev_dependency = True)
bazel_dep(name = "rules_python", version = "1.7.0", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1", dev_dependency = True)
bazel_dep(name = "lcov", version = "2.3.2", dev_dependency = True)
bazel_dep(name = "platforms", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "tweag-credential-helper", version = "0.0.6", dev_dependency = True)
bazel_dep(name = "bazel_env.bzl", version = "0.5.0", dev_dependency = True)
# `bazel mod tidy` command relies on `buildozer` and this is declared in
# https://github.com/bazelbuild/bazel/blob/release-8.1.1/src/MODULE.tools#L9;
# to ensure that the binary of the same version is used by any other tool in
# the project, one can override its version like this. See
# https://bazel.build/rules/lib/globals/module#single_version_override
single_version_override(
module_name = "buildozer",
version = "8.2.0",
)
# a Python toolchain is a dependency for a build action that is used to run tests with code
# coverage enabled; the build in Buildkite runs under root inside a Docker container, but the
# toolchain doesn't like that; see https://github.com/bazelbuild/rules_python/pull/713
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = False,
ignore_root_user_error = True,
python_version = "3.11",
)
# https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
# using the same version as in `go.mod`
go_sdk.download(version = "1.24.0")
# this is to enable nogo static analysis checker and being able to run arbitrary Go commands
go_sdk.nogo(nogo = "//:nogo")
# avoid causing changes to the MODULE.bazel every time a new Go dependency is added
include("//:go.mod.MODULE.bazel")
# one cannot register both Windows and Linux platforms here because it means Bazel will
# attempt to download/setup Go toolchains for both platforms (e.g. running Bazel on
# Windows would attempt to download Linux Go SDK which would lead to build failure);
# the registration of platforms happens in the `.bazelrc` file instead, so for Windows
# builds, add `--config=windows` and for Linux Docker builds, add `--config=docker`.
# to add support for `--spawn_strategy=docker`
# register_execution_platforms(
# "//platforms:docker",
# "//platforms:windows"
# )
# rules_apple is a transitive dependency of rules_img and is required to avoid getting errors
# Error: 'struct' value has no field or method 'AppleDynamicFramework'
# likely because it's incompatible with the latest Bazel version used in the project;
# upgrading the rules_apple version avoids the error
bazel_dep(name = "rules_apple", version = "4.1.1")
bazel_dep(name = "rules_img", version = "0.2.12")
pull = use_repo_rule("@rules_img//img/private/repository_rules:pull.bzl", "pull")
pull(
name = "ubuntu",
digest = "sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02",
registry = "index.docker.io",
repository = "library/ubuntu",
tag = "24.04",
)