bazel-contrib / bazel-contrib/rules_foreign_cc
configure_make - File name too long
- Dominant language
- Starlark
- Stars
- 737
- Forks
- 270
- PR merge metrics
- No merged PRs in 30d
Description
While building xz library with configure_make on macOS BigSur I got the following error:
``` bash
_____ BEGIN BUILD LOGS _____
Bazel external C/C++ Rules. Building library lzma
Environment:______________
TMPDIR=/var/folders/9d/7jyrhm613cqg7slstfx8hy540000gn/T/
BUILD_WRAPPER_SCRIPT=bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma_scripts/Configure_wrapper_script.sh
EXT_BUILD_ROOT=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server
INSTALLDIR=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
PATH=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.
BUILD_TMPDIR=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir
PWD=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server
EXT_BUILD_DEPS=/private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.ext_build_deps
SHLVL=2
BUILD_LOG=bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma_logs/Configure.log
BUILD_SCRIPT=bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma_scripts/Configure_script.sh
_=/usr/bin/env
__________________________
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
Can not copy
mkdir: /private/var/tmp/_bazel_ivanmudrak/f75fc8c60a9e5eb41177351c0f74c835/sandbox/darwin-sandbox/434/execroot/on_server/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/darwin-fastbuild/bin/external/lzma.dev/lzma.build_tmpdir/bazel-out/host/bin/external/rules_foreign_cc: File name too long
_____ END BUILD LOGS _____
```
For some reason, it creates a few nested folder levels with the same pattern.
Build file:
```bash
load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make")
filegroup(
name = "lzma_files",
srcs = glob(
include=[
"xz-5.2.5/**/*"
]
)
)
configure_make(
name = "lzma",
lib_source = ":lzma_files",
configure_in_place = True,
autogen = True,
static_libraries = [
"liblzma.a"
],
shared_libraries = [
"liblzma.so"
],
visibility = ["//visibility:public"]
)
```
WORKSPACE:
```bash
http_archive(
name = "rules_foreign_cc",
sha256 = "d038a5cafe5faacaa79e37ca19a30c203556844356bae89fc22147eea0fd8325",
strip_prefix = "rules_foreign_cc-c309ec13192f69a46aaaba39587c3d7ff684eb35",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/c309ec13192f69a46aaaba39587c3d7ff684eb35.tar.gz",
)
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
```
...
```bash
http_archive(
name = "lzma.dev",
build_file = "//:lzma.BUILD.bazel",
sha256 = "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10",
strip_prefix = "xz-5.2.5",
urls = [
"https://tukaani.org/xz/xz-5.2.5.tar.gz",
"https://iweb.dl.sourceforge.net/project/lzmautils/xz-5.2.5.tar.gz"],
)
```
I got a similar error while building secp256k1 with configure_make.
Contributor guide
Research direction
Use the lzma BUILD file and WORKSPACE archive setup to reproduce the configure_make build. Start with the generated Configure_wrapper_script.sh and Configure_script.sh named in the log, trace why BUILD_TMPDIR is repeated in the mkdir path, and confirm the build completes without the nested path or “File name too long” error.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100