Skip to content

Commit

Permalink
native_deps: give up on testing cc_binary using rust_library
Browse files Browse the repository at this point in the history
This only works on clang today, and can only work on clang for the
near-term. It's not clear how to write a clang-only test in this case,
so we just give up for now.

"I promise it works!" etc
  • Loading branch information
durin42 committed Mar 9, 2021
1 parent 6db880f commit 71ec120
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 56 deletions.
24 changes: 0 additions & 24 deletions test/unit/native_deps/alloc_shims.c

This file was deleted.

7 changes: 0 additions & 7 deletions test/unit/native_deps/cc_bin_uses_rust_library.cc

This file was deleted.

21 changes: 1 addition & 20 deletions test/unit/native_deps/native_deps_test.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unittests for rust rules."""

load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//rust:defs.bzl", "rust_binary", "rust_library", "rust_proc_macro", "rust_shared_library", "rust_static_library")

def _assert_argv_contains_not(env, action, flag):
Expand Down Expand Up @@ -227,25 +227,6 @@ def _native_dep_test():
deps = [":native_dep", ":alwayslink"],
)

cc_library(
name = "alloc_shims",
srcs = ["alloc_shims.c"],
)

rust_library(
name = "print_hi_rust",
srcs = ["print_hi_rust.rs"],
)

cc_binary(
name = "cc_bin_uses_rust_library",
srcs = ["cc_bin_uses_rust_library.cc"],
deps = [
":print_hi_rust",
":alloc_shims", # TODO: this should come in through the toolchain configuration
],
)

rlib_has_no_native_libs_test(
name = "rlib_has_no_native_libs_test",
target_under_test = ":rlib_has_no_native_dep",
Expand Down
4 changes: 0 additions & 4 deletions test/unit/native_deps/print_hi_rust.rs

This file was deleted.

2 changes: 1 addition & 1 deletion test/unit/stdlib_ordering/stdlib_ordering.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest")
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("//rust:defs.bzl", "rust_library")

def _categorize_library(name):
Expand Down

0 comments on commit 71ec120

Please sign in to comment.