bazel-contrib / bazel-contrib/rules_foreign_cc

Errors during `BootstrapGNUMake` after upgrading to macos v15 sdk

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

Description

We've observed at least two separate issues during the `BootstrapGNUMake` step on users who've upgraded their machines to the latest `v15` release of the mac command line tools or the new xcode sdk.

Macos version: Venture 13.6

Bazel version: 6.2.0

rules_foreign_cc: d4b19bb010ca5d433850c1d9db0510c2fd395aae758ae37f02930944596220ec

Error 1:
```
+ cat build.cfg
# Configuration for building GNU Make in the absence of any 'make' program.
# build.cfg. Generated from build.cfg.in by configure.

# Copyright (C) 1993-2020 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see .

# See Makefile.in for comments describing these variables.

top_srcdir='.'

prefix='/private/var/tmp/_bazel_isaac.torres/a00f253b0b0fdebf676f9472a6bd7fc6/sandbox/darwin-sandbox/28/execroot/libswiftnav/bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make'
exec_prefix=`eval echo ${prefix}`

CC='/private/var/tmp/_bazel_isaac.torres/a00f253b0b0fdebf676f9472a6bd7fc6/sandbox/darwin-sandbox/28/execroot/libswiftnav/external/local_config_cc/cc_wrapper.sh'
AR='/usr/bin/libtool'
CFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted '
CPPFLAGS=''
DEFS='-DHAVE_CONFIG_H'
ARFLAGS='-static -s -o'
LDFLAGS='-rdynamic -undefined dynamic_lookup -headerpad_max_install_names -lc++ -lm -undefined error'
ALLOCA=''
LOADLIBES=' -Wl,-framework -Wl,CoreFoundation'
REMOTE='stub'
OBJEXT='o'
EXEEXT=''
+ ./build.sh
config.status: creating ./lib/alloca.h__
config.status: creating ./lib/fcntl.h__
config.status: creating ./lib/limits.h__
config.status: creating ./lib/fnmatch.h__
config.status: creating ./lib/glob.h__
config.status: creating ./lib/stdint.h__
config.status: creating ./lib/stdio.h__
config.status: creating ./lib/stdlib.h__
config.status: creating ./lib/string.h__
config.status: creating ./lib/sys/types.h__
config.status: creating ./lib/unistd.h__
compiling lib/concat-filename.c...
compiling lib/dirname-lgpl.c...
compiling lib/basename-lgpl.c...
compiling lib/stripslash.c...
compiling lib/exitfail.c...
compiling lib/fd-hook.c...
compiling lib/findprog-in.c...
./lib/findprog-in.c:137:25: error: call to undeclared function 'eaccess'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
./lib/findprog-in.c:137:25: note: did you mean 'access'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:431:6: note: 'access' declared here
int access(const char *, int);
^
./lib/findprog-in.c:211:21: error: call to undeclared function 'eaccess'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
2 errors generated.
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/BootstrapGNUMake.log

INFO: Elapsed time: 86.633s, Critical Path: 52.19s
INFO: 52 processes: 23 internal, 29 darwin-sandbox.
FAILED: Build did NOT complete successfully
```

Error 2:
```
+ cat build.cfg
# Configuration for building GNU Make in the absence of any 'make' program.
# build.cfg. Generated from build.cfg.in by configure.

# Copyright (C) 1993-2020 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see .

# See Makefile.in for comments describing these variables.

top_srcdir='.'

prefix='/private/var/tmp/_bazel_isaac.torres/d66fcbe6a777458f4c1d3687ee3816a5/sandbox/darwin-sandbox/1522/execroot/foo/bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make'
exec_prefix=`eval echo ${prefix}`

CC='/private/var/tmp/_bazel_isaac.torres/d66fcbe6a777458f4c1d3687ee3816a5/sandbox/darwin-sandbox/1522/execroot/starling/external/rules_swiftnav/cc/toolchains/llvm/x86_64-darwin/wrappers/clang --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
AR='/usr/bin/libtool'
CFLAGS='-U_FORTIFY_SOURCE --target=x86_64-apple-macosx -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -ffp-contract=off -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -g0 -O3 -D_FORTIFY_SOURCE=1 -ffunction-sections -fdata-sections -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted '
CPPFLAGS=''
DEFS='-DHAVE_CONFIG_H'
ARFLAGS='-static -s -o'
LDFLAGS='-rdynamic --target=x86_64-apple-macosx -lm -no-canonical-prefixes -headerpad_max_install_names -undefined dynamic_lookup -Wl,-no_fixup_chains -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lc++ -lc++abi -L/private/var/tmp/_bazel_isaac.torres/d66fcbe6a777458f4c1d3687ee3816a5/sandbox/darwin-sandbox/1522/execroot/foo/external/x86_64-darwin-llvm/lib -undefined error'
ALLOCA=''
LOADLIBES=' '
REMOTE='stub'
OBJEXT='o'
EXEEXT=''
+ ./build.sh
config.status: creating ./lib/alloca.h__
config.status: creating ./lib/fcntl.h__
config.status: creating ./lib/limits.h__
config.status: creating ./lib/fnmatch.h__
config.status: creating ./lib/glob.h__
config.status: creating ./lib/stdint.h__
config.status: creating ./lib/stdio.h__
config.status: creating ./lib/stdlib.h__
config.status: creating ./lib/string.h__
config.status: creating ./lib/sys/types.h__
config.status: creating ./lib/unistd.h__
compiling lib/concat-filename.c...
compiling lib/dirname-lgpl.c...
compiling lib/basename-lgpl.c...
compiling lib/stripslash.c...
compiling lib/exitfail.c...
compiling lib/fd-hook.c...
compiling lib/findprog-in.c...
./lib/findprog-in.c:137:25: warning: implicit declaration of function 'eaccess' is invalid in C99 [-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
./lib/findprog-in.c:211:21: warning: implicit declaration of function 'eaccess' is invalid in C99 [-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
2 warnings generated.
compiling lib/getprogname.c...
compiling lib/fnmatch.c...
compiling lib/glob.c...
./lib/glob.c:823:27: warning: incompatible pointer types passing 'char **' to parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
= (char **) realloc (pglob->gl_pathv,
^~~~~~~~~~~~~~~
*
./lib/glob.c:942:24: warning: incompatible pointer types passing 'char **' to parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
= (char **) realloc (pglob->gl_pathv,
^~~~~~~~~~~~~~~
*
./lib/glob.c:997:39: warning: incompatible pointer types passing 'char **' to parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
new_pathv = (char **) realloc (pglob->gl_pathv,
^~~~~~~~~~~~~~~
*
./lib/glob.c:1388:23: warning: incompatible pointer types passing 'char **' to parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
= (char **) realloc (pglob->gl_pathv,
^~~~~~~~~~~~~~~
*
4 warnings generated.
compiling lib/unistd.c...
compiling lib/xmalloc.c...
compiling lib/xalloc-die.c...
compiling lib/xconcat-filename.c...
compiling lib/close.c...
compiling lib/error.c...
compiling lib/msvc-inval.c...
./lib/msvc-inval.c:124:7: warning: implicit declaration of function '_set_invalid_parameter_handler' is invalid in C99 [-Wimplicit-function-declaration]
_set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
^
1 warning generated.
compiling lib/msvc-nothrow.c...
./lib/msvc-nothrow.c:25:10: fatal error: 'windows.h' file not found
#include
^~~~~~~~~~~
1 error generated.
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make_tool_foreign_cc/BootstrapGNUMake.log

INFO: Elapsed time: 727.325s, Critical Path: 92.92s
INFO: 2122 processes: 405 internal, 1717 darwin-sandbox.
FAILED: Build did NOT complete successfully
```

Contributor guide

Open the contributing guide

Research direction

Start with BootstrapGNUMake.log and the referenced wrapper_build_script.sh and build_script.sh to reproduce the failures on the reported macOS SDKs. Inspect the GNU Make sources named in the logs, especially lib/findprog-in.c and lib/msvc-nothrow.c, along with the bootstrap configuration. Done means BootstrapGNUMake completes successfully on the affected SDK configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
build-system, operating-systems
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.