bazel-contrib / bazel-contrib/rules_foreign_cc

failed to create need file at configure stage

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

Description

I use below code to compile jemalloc, but it not generated intermediate file at configure stage. jemalloc_defs.h was not generated. compile error msg:

```

bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/jemalloc/jemalloc_build_/include/jemalloc/jemalloc.h:246:10: fatal error: jemalloc/jemalloc_defs.h: No such file or directory
246 | #include "jemalloc/jemalloc_defs.h"

```

Configure.log
```
config.status: creating test/include/test/jemalloc_test.h
477 config.status: creating config.stamp
478 config.status: creating bin/jemalloc-config
479 config.status: creating bin/jemalloc.sh
480 config.status: creating bin/jeprof
481 config.status: creating include/jemalloc/jemalloc_defs.h
482 config.status: include/jemalloc/jemalloc_defs.h is unchanged
483 config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h
484 config.status: creating test/include/test/jemalloc_test_defs.h
485 config.status: test/include/test/jemalloc_test_defs.h is unchanged
486 config.status: executing include/jemalloc/internal/public_symbols.txt commands
487 config.status: executing include/jemalloc/internal/private_symbols.awk commands
488 config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands
489 config.status: executing include/jemalloc/internal/public_namespace.h commands
490 config.status: executing include/jemalloc/internal/public_unnamespace.h commands
491 config.status: executing include/jemalloc/jemalloc_protos_jet.h commands
492 config.status: executing include/jemalloc/jemalloc_rename.h commands
493 config.status: executing include/jemalloc/jemalloc_mangle.h commands
494 config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands
495 config.status: executing include/jemalloc/jemalloc.h commands
496 ===============================================================================

```
notice "482 config.status: include/jemalloc/jemalloc_defs.h is unchanged" is different with manually execute configure command in jemalloc.

https://github.com/jemalloc/jemalloc/archive/41e0b857bef0b787a581c7a8334b46981d5e06ed.tar.gz

```
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_foreign_cc//foreign_cc:configure.bzl", "configure_make", "configure_make_variant")
load("@bazel_skylib//lib:selects.bzl", "selects")

filegroup(
name = "all",
srcs = glob(
["**"],
exclude = [],
),
visibility = ["//visibility:public"],
)

configure_make_variant(
name = "jemalloc_build",
args = ["-j8"],
autogen = True,
autogen_options = [],
configure_in_place = True,
configure_options = [
"--enable-static",
#"--enable-prof",
#"--enable-prof-libunwind",
],
copts = [
#"-D_GNU_SOURCE",
#"-D_REENTRANT",
#"-g3",
#"-O3",
#"-funroll-loops",
#"-fvisibility=hidden",
#"-Wall",
#"-Wextra",
#"-Wimplicit-fallthrough",
#"-Wsign-compare",
#"-Wundef",
#"-Wno-format-zero-length",
#"-Wpointer-arith",
#"-Wno-missing-braces",
#"-Wno-missing-field-initializers",
#"-Wno-missing-attributes",
#"-pipe",
],
lib_source = ":all",
linkopts = [
"-lunwind",
],
out_static_libs = ["libjemalloc.a"],
toolchain = "@rules_foreign_cc//toolchains:preinstalled_make_toolchain",
)

cc_library(
name = "jemalloc",
visibility = ["//visibility:public"],
deps = [
":jemalloc_build",
],
)
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the configure_make_variant setup using the linked jemalloc archive and inspect the generated include path alongside configure.log. Compare the expected include/jemalloc/jemalloc_defs.h location with the Bazel output tree; the issue is done when the generated header is available to jemalloc.h and the build completes.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.