rules_foreign_cc issue as a module

119 views
Skip to first unread message

Christian

unread,
Feb 29, 2024, 8:15:29 AM2/29/24
to bazel-discuss
Hello,

I am building libelf using rules_foreign_cc using the following BUILD file:

load("@rules_foreign_cc//foreign_cc:configure.bzl", "configure_make")

filegroup(
    name = "all",
    srcs = glob(["**"]),
)

configure_make(
    name = "libelf",
    configure_options = [
        "--enable-shared=no",
        "--enable-static=yes",
        "--enable-compat",
        "--enable-elf64",
        "--enable-versioning",
        "--enable-nls",
        "--enable-shared",
        "--enable-gnu-names",
        "--with-pic",
    ],
    lib_source = ":all",
    out_lib_dir = "lib",
    out_static_libs = ["libelf.a"],
    visibility = ["//visibility:public"],
)

All things being equal (bazel version 7.0.2 and rules_foreign_cc 0.10.1), the build succeeds when using WORKSPACE, and fails with MODULES with the given error:

/home/christian/.cache/bazel/_bazel_christian/056ab22a9a4b1bb903ae40e263f5ff42/execroot/_main/external/libelf~0.8.12/configure --prefix=/home/christian/.cache/bazel/_bazel_christian/056ab22a9a4b1bb903ae40e263f5ff42/execroot/_main/bazel-out/k8-opt/bin/external/libelf~0.8.12/libelf.build_tmpdir/libelf --enable-shared=no --enable-static=yes --enable-compat --enable-elf64 --enable-versioning --enable-nls --enable-shared --enable-gnu-names --with-pic
creating cache ./config.cache
checking whether /home/christian/.cache/bazel/_bazel_christian/056ab22a9a4b1bb903ae40e263f5ff42/execroot/_main/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/rules_foreign_cc~0.10.1/toolchains/make/bin/make sets ${MAKE}... /home/christian/.cache/bazel/_bazel_christian/056ab22a9a4b1bb903ae40e263f5ff42/execroot/_main/external/libelf~0.8.12/configure: 1: eval: Bad substitution



Actually running /home/christian/.cache/bazel/_bazel_christian/056ab22a9a4b1bb903ae40e263f5ff42/execroot/_main/external/libelf~0.8.12/configure does succeed.

Any pointers would be appreciated,

Simon Au-Yong

unread,
Feb 29, 2024, 9:41:30 PM2/29/24
to bazel-discuss
Is there a problem with the MAKE variable substitution? eval is choking on your command.
Reply all
Reply to author
Forward
0 new messages