fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreSilence warnings for example/test dependencies (#1312)bddc4bd9

0.9.0
1.3 KiB40 linesraw
1"""A module defining dependencies of the `rules_rust` tests"""
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
5load("//test/load_arbitrary_tool:load_arbitrary_tool_test.bzl", "load_arbitrary_tool_test")
6
7_LIBC_BUILD_FILE_CONTENT = """\
8load("@rules_rust//rust:defs.bzl", "rust_library")
9
10rust_library(
11    name = "libc",
12    srcs = glob(["src/**/*.rs"]),
13    edition = "2015",
14    rustc_flags = [
15        # In most cases, warnings in 3rd party crates are not interesting as
16        # they're out of the control of consumers. The flag here silences
17        # warnings. For more details see:
18        # https://doc.rust-lang.org/rustc/lints/levels.html
19        "--cap-lints=allow",
20    ],
21    visibility = ["//visibility:public"],
22)
23"""
24
25def rules_rust_test_deps():
26    """Load dependencies for rules_rust tests"""
27
28    load_arbitrary_tool_test()
29
30    maybe(
31        http_archive,
32        name = "libc",
33        build_file_content = _LIBC_BUILD_FILE_CONTENT,
34        sha256 = "1ac4c2ac6ed5a8fb9020c166bc63316205f1dc78d4b964ad31f4f21eb73f0c6d",
35        strip_prefix = "libc-0.2.20",
36        urls = [
37            "https://mirror.bazel.build/github.com/rust-lang/libc/archive/0.2.20.zip",
38            "https://github.com/rust-lang/libc/archive/0.2.20.zip",
39        ],
40    )