Skip to content

Commit 496ce1a

Browse files
authored
Merge pull request #1 from dfinity-lab/ali-merge-upstream-0.8.1
Ali merge upstream 0.8.1
2 parents 0c6e451 + b1ac8fd commit 496ce1a

960 files changed

Lines changed: 49024 additions & 39265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelci/presubmit.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ tasks:
2525
ubuntu2004:
2626
build_targets: *default_linux_targets
2727
test_targets: *default_linux_targets
28+
coverage_targets: *default_linux_targets
2829
rbe_ubuntu1604:
2930
shell_commands:
3031
- sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
@@ -39,6 +40,7 @@ tasks:
3940
macos:
4041
build_targets: *default_macos_targets
4142
test_targets: *default_macos_targets
43+
coverage_targets: *default_macos_targets
4244
build_flags: *aspects_flags
4345
windows:
4446
build_flags:
@@ -149,13 +151,13 @@ tasks:
149151
bazel: "rolling"
150152
ubuntu1804:
151153
name: "Min Bazel Version"
152-
bazel: "4.0.0"
154+
bazel: "5.0.0"
153155
platform: ubuntu1804
154156
build_targets: *default_linux_targets
155157
test_targets: *default_linux_targets
156158
ubuntu1804_with_aspects:
157159
name: "Min Bazel Version With Aspects"
158-
bazel: "4.0.0"
160+
bazel: "5.0.0"
159161
platform: ubuntu1804
160162
build_targets: *default_linux_targets
161163
test_targets: *default_linux_targets
@@ -329,18 +331,8 @@ tasks:
329331
build_flags: *aspects_flags
330332
build_targets:
331333
- "//..."
332-
# TODO: Temporarily disable this windows build as it recently started
333-
# failing. This is likely an issue with the windows workers in CI.
334-
- "-//vendor_local_pkgs/..."
335-
- "-//vendor_remote_pkgs/..."
336-
- "-//no_cargo_manifests/..."
337334
test_targets:
338335
- "//..."
339-
# TODO: Temporarily disable this windows build as it recently started
340-
# failing. This is likely an issue with the windows workers in CI.
341-
- "-//vendor_local_pkgs/..."
342-
- "-//vendor_remote_pkgs/..."
343-
- "-//no_cargo_manifests/..."
344336
buildifier:
345337
version: latest
346338
warnings: "all"

BUILD.bazel

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2-
load("//rust:defs.bzl", "capture_clippy_output", "clippy_flags", "error_format", "extra_exec_rustc_flags", "extra_rustc_flags")
2+
load("//rust:defs.bzl", "capture_clippy_output", "clippy_flags", "error_format", "extra_exec_rustc_flag", "extra_exec_rustc_flags", "extra_rustc_flag", "extra_rustc_flags", "is_proc_macro_dep", "is_proc_macro_dep_enabled")
33

44
exports_files(["LICENSE"])
55

@@ -45,6 +45,24 @@ clippy_flags(
4545
visibility = ["//visibility:public"],
4646
)
4747

48+
# This setting may be used to identify dependencies of proc-macro-s.
49+
# This feature is only enabled if `is_proc_macro_dep_enabled` is true.
50+
# Its value controls the BAZEL_RULES_RUST_IS_PROC_MACRO_DEP environment variable
51+
# made available to the rustc invocation.
52+
is_proc_macro_dep(
53+
name = "is_proc_macro_dep",
54+
build_setting_default = False,
55+
visibility = ["//visibility:public"],
56+
)
57+
58+
# This setting enables the feature to identify dependencies of proc-macro-s,
59+
# see `is_proc_macro_dep`.
60+
is_proc_macro_dep_enabled(
61+
name = "is_proc_macro_dep_enabled",
62+
build_setting_default = False,
63+
visibility = ["//visibility:public"],
64+
)
65+
4866
# This setting may be used to pass extra options to rustc from the command line
4967
# in non-exec configuration.
5068
# It applies across all targets whereas the rustc_flags option on targets applies only
@@ -55,6 +73,12 @@ extra_rustc_flags(
5573
visibility = ["//visibility:public"],
5674
)
5775

76+
extra_rustc_flag(
77+
name = "extra_rustc_flag",
78+
build_setting_default = "",
79+
visibility = ["//visibility:public"],
80+
)
81+
5882
# This setting may be used to pass extra options to rustc from the command line
5983
# in exec configuration.
6084
# It applies across all targets whereas the rustc_flags option on targets applies only
@@ -65,6 +89,12 @@ extra_exec_rustc_flags(
6589
visibility = ["//visibility:public"],
6690
)
6791

92+
extra_exec_rustc_flag(
93+
name = "extra_exec_rustc_flag",
94+
build_setting_default = "",
95+
visibility = ["//visibility:public"],
96+
)
97+
6898
# This setting is used by the clippy rules. See https://bazelbuild.github.io/rules_rust/rust_clippy.html
6999
label_flag(
70100
name = "clippy.toml",

WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi
44

55
rules_rust_dependencies()
66

7-
rust_register_toolchains(include_rustc_srcs = True)
7+
rust_register_toolchains()
88

99
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
1010

@@ -24,9 +24,9 @@ rust_bindgen_dependencies()
2424

2525
rust_bindgen_register_toolchains()
2626

27-
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_deps")
27+
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")
2828

29-
rust_analyzer_deps()
29+
rust_analyzer_dependencies()
3030

3131
load("@rules_rust//util/import:deps.bzl", "import_deps")
3232

bindgen/3rdparty/BUILD.bazel

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
load("//crate_universe:defs.bzl", "crate", "crates_vendor")
3+
4+
crates_vendor(
5+
name = "crates_vendor",
6+
annotations = {
7+
"bindgen": [crate.annotation(
8+
gen_build_script = True,
9+
)],
10+
"clang-sys": [crate.annotation(
11+
gen_build_script = True,
12+
)],
13+
"indexmap": [crate.annotation(
14+
gen_build_script = True,
15+
)],
16+
"libloading": [crate.annotation(
17+
gen_build_script = True,
18+
)],
19+
"log": [crate.annotation(
20+
rustc_flags = ["--cfg=atomic_cas"],
21+
)],
22+
},
23+
cargo_lockfile = "Cargo.Bazel.lock",
24+
generate_build_scripts = False,
25+
mode = "remote",
26+
packages = {
27+
"bindgen": crate.spec(
28+
version = "0.60.1",
29+
),
30+
"libloading": crate.spec(
31+
version = "0.7.3",
32+
),
33+
},
34+
repository_name = "rules_rust_bindgen",
35+
tags = ["manual"],
36+
)
37+
38+
alias(
39+
name = "bindgen",
40+
actual = "//bindgen/3rdparty/crates:bindgen__bindgen",
41+
tags = ["manual"],
42+
visibility = ["//visibility:public"],
43+
)
44+
45+
bzl_library(
46+
name = "bzl_lib",
47+
srcs = glob(["**/*.bzl"]) + [
48+
"//bindgen/3rdparty/crates:defs.bzl",
49+
"//bindgen/3rdparty/crates:crates.bzl",
50+
],
51+
visibility = ["//bindgen:__pkg__"],
52+
)
53+
54+
filegroup(
55+
name = "distro",
56+
srcs = glob([
57+
"*.bzl",
58+
"*.bazel",
59+
]) + [
60+
"//bindgen/3rdparty/crates:srcs",
61+
"Cargo.Bazel.lock",
62+
],
63+
visibility = ["//bindgen:__pkg__"],
64+
)

0 commit comments

Comments
 (0)