bazel-contrib / bazel-contrib/rules_foreign_cc

Several builds under examples/third_party fail at HEAD

Open
#1,135 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

The stuff under `examples/third_party` looks like it could be a highly valuable resource, but I'm not actually sure *any* of it works. Which is annoying.

# Reproduction:
```
T=rules_foreign_cc
git clone https://github.com/bazelbuild/rules_foreign_cc.git $T
cd $T/examples/third_party

bazel build -k :all
# More complete:
bazel build -k ...
# Most (likely too) complete:
bazel query 'kind("http_archive|git_repository",//external:*)' |
sed "/:.*[/]/d;s/.*:/@/;s~$~//:all~" |
bazel build -k $(cat)
```

# ERRORS

## `@rules_perl//` (needed by `@openssl//`)
```
ERROR: [...]/external/rules_perl/BUILD:74:23: While resolving toolchains for target @rules_perl//:current_toolchain: No matching toolchains found for types @rules_perl//:toolchain_type.
To debug, rerun with --toolchain_resolution_debug='@rules_perl//:toolchain_type'
```
See fix(?) in PR https://github.com/bazelbuild/rules_foreign_cc/pull/1137

## `@mesa//`
```
Error in download_and_extract: java.io.IOException: Error downloading [https://archive.mesa3d.org//mesa-22.1.4.tar.xz] to [...]/external/mesa/temp12780688070917179032/mesa-22.1.4.tar.xz: No route to host (Host unreachable)
```

## `@libpng//`
```
ERROR: [...]/external/libpng/BUILD.bazel:13:6: Foreign Cc - CMake: Building libpng failed:
[...]
external/libpng/contrib/libtests/pngstest.c:3216:24: error: '%d' directive writing between 1 and 11 bytes into a region of size between 10 and 32 [-Werror=format-overflow=]
3216 | sprintf(name, "%s%d.png", tmpf, ++counter);
| ^~
[...]
```

## `@gperftools//`
```
ERROR: [...]/external/gperftools/BUILD.bazel:11:15: Foreign Cc - Configure: Building gperftools_build failed:
[...]
external/gperftools/src/tcmalloc.cc:2098:36: error: 'void tc_delete_aligned_nothrow(void*, std::align_val_t, const std::nothrow_t&)' alias between functions of incompatible types 'void(void*, std::align_val_t, const std::nothrow_t&)' and 'void(void*)' [-Werror=attribute-alias=]
2098 | extern "C" PERFTOOLS_DLL_DECL void tc_delete_aligned_nothrow(void* p, std::align_val_t, const std::nothrow_t&) PERFTOOLS_NOTHROW
| ^~~~~~~~~~~~~~~~~~~~~~~~~
[...]
```
ERROR: [...]/external/iconv/BUILD.bazel:8:15: Foreign Cc - Configure: Building iconv failed:

## `@iconv//`
```
WARNING: The target pattern '@iconv//:all' is ambiguous: ':all' is both a wildcard, and the name of an existing filegroup rule; using the latter interpretation
WARNING: The target pattern '@iconv_macos//:all' is ambiguous: ':all' is both a wildcard, and the name of an existing filegroup rule; using the latter interpretation
```

```
ERROR: [...]/external/iconv/BUILD.bazel:8:15: Foreign Cc - Configure: Building iconv failed:
[...]
In file included from ./iconv.c:73,
from ./iconv_no_i18n.c:2:
./iconv.c: In function 'main':
../srclib/gettext.h:86:34: error: statement with no effect [-Werror=unused-value]
86 | # define textdomain(Domainname) ((const char *) (Domainname))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./iconv.c:863:3: note: in expansion of macro 'textdomain'
863 | textdomain("libiconv");
| ^~~~~~~~~~
[...]
```

(And a few more)

Contributor guide

Open the contributing guide

Research direction

Reproduce from examples/third_party with bazel build -k :all, then inspect the failures for rules_perl, mesa, libpng, gperftools, and iconv. Read the referenced PR 1137 for the rules_perl context and compare each external build definition with its reported toolchain, download, and compiler errors. Done means the affected examples build successfully or their remaining failures are explicitly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, git
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.