Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/third_party/autotools/BUILD.autoconf.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ filegroup(

configure_make(
name = "autoconf",
# Suppress help2man regeneration; it's not available in the sandbox and
# the tarball ships pre-built man pages.
args = ["HELP2MAN=true"],
build_data = [
"@m4//:m4_exe",
],
Expand Down
8 changes: 8 additions & 0 deletions examples/third_party/autotools/BUILD.m4.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ filegroup(

configure_make(
name = "m4",
# gnulib's iconv_open-*.h regeneration rules are unconditional (not
# guarded by maintainer-mode) and invoke gperf, which isn't available
# in the sandbox. configure_in_place gives us a writable source tree,
# and GPERF=true makes the regeneration a no-op (the generated headers
# are only #include'd on AIX/HP-UX/IRIX/OSF/Solaris/z/OS).
args = ["GPERF=true"],
configure_in_place = True,
env = select({
"@platforms//os:macos": {"AR": ""},
"//conditions:default": {},
Expand All @@ -20,6 +27,7 @@ configure_make(
out_binaries = [
"m4",
],
out_include_dir = "",
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
Expand Down
9 changes: 9 additions & 0 deletions examples/third_party/bison/BUILD.bison.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ filegroup(
# I tested and this builds for me on macOS and Linux, did not check Windows
configure_make(
name = "bison",
# gnulib's iconv_open-*.h regeneration rules invoke gperf unconditionally,
# and timestamp skew can trigger help2man and yacc/bison regeneration.
# configure_in_place gives us a writable copy with flattened (equal)
# timestamps, which prevents make from seeing stale outputs.
args = [
"GPERF=true",
"HELP2MAN=true",
],
build_data = [
"@m4//:m4_exe",
],
configure_in_place = True,
env = {
"M4": "$$EXT_BUILD_ROOT/$(location @m4//:m4_exe)",
"PERL": "$$EXT_BUILD_ROOT/$(PERL)",
Expand Down
14 changes: 14 additions & 0 deletions foreign_cc/private/configure_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ def create_configure_script(
configure_path = "{}/{}".format(root_path, configure_command)

script.append("##export_var## MAKE {}".format(make_path))

# When the user has not requested autotools regeneration, prevent make from
# re-running aclocal/autoconf/autoheader/automake/makeinfo if timestamps
# are skewed (common under RBE, where the CAS strips per-file mtimes).
# Setting each tool to "true" makes any accidental rerun a silent no-op —
# the standard technique used by Debian, Yocto, and rpmbuild.
if not autoconf and not autoreconf and not autogen:
script.append("##export_var## AUTOCONF true")
script.append("##export_var## AUTOHEADER true")
script.append("##export_var## AUTOMAKE true")
script.append("##export_var## ACLOCAL true")
script.append("##export_var## MAKEINFO true")
script.append("##export_var## HELP2MAN true")

script.append("##enable_tracing##")

if autogen:
Expand Down
Loading