[PATCH] D119547: [libc][bazel] Add tests to the bazel build

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 11:14:20 PST 2022


GMNGeoffrey added a comment.

In D119547#3369973 <https://reviews.llvm.org/D119547#3369973>, @gchatelet wrote:

> @GMNGeoffrey I'm having an issue that you may know how to solve.
> .bazelrc <https://github.com/llvm/llvm-project/blob/7c385c4b2f653d6853fe4601f02bbc7fcd60cd91/utils/bazel/.bazelrc#L37-L38> automatically appends `-Wall -Werror` to everything that is built.
>
> - Math tests depend on `mpfr`,
> - `mpfr` (and `gmp`) are built from source using `rules_foreign_cc`,
> - For hermeticity `rules_foreign_cc` compiles `make`
>
> I could tweak the `./configure` options for `mpfr` and `gmp` and explicitly disable `-Werror` (see file "mpfr.BUILD" and "gmp.BUILD") but I cannot tweak the compile options for when `rules_foreign_cc` compiles `make`.
> I could work around this by preventing `rules_foreign_cc` to compiles `make` in the first place, but then the build is not hermetic anymore...
>
>   register_built_tools = False,
>   register_default_tools = False,
>
> What do you think? Is `.bazelrc` too strict? Is there a clean way to work around this without lowering the error level?

You can use per_file_copt to limit where copts get applied, and for clang specifically the system_header_prefix copt. I think using the make on a user's machine instead of compiling it from source is entirely reasonable though. Only at Google would that be considered a good idea


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119547/new/

https://reviews.llvm.org/D119547



More information about the llvm-commits mailing list