tensorflow: Fail to compile TF 2.12.0 with XCode 14.3 due to Compiler flag in boringssl/src/crypto/x509

Click to expand!

Issue Type

Bug

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

2.12.0

Custom Code

No

OS Platform and Distribution

macOS 13.3

Mobile device

No response

Python version

3.10

Bazel version

5.3.0

GCC/Compiler version

XCode 14.3

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

Using standard compiling procedure (no special flags), compilation of the external library: boringssl/src/crypto/x509 fails. Log attached below.

Standalone code to reproduce the issue

Compile TF 2.12.0 using MacOS 13.x and XCode 14.3 (not earlier).

Relevant log output

: /private/var/tmp/_bazel_alex/dc1a9368c8e4ba5b96348c2850b37ab0/external/boringssl/BUILD:161:11: Compiling src/crypto/x509/t_x509.c [for host] failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 44 arguments skipped)
external/boringssl/src/crypto/x509/t_x509.c:321:18: error: variable 'l' set but not used [-Werror,-Wunused-but-set-variable]
    int ret = 0, l, i;
                 ^
1 error generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@feranick ,

Thanks for all your effort and time in resolving and raising the PR. Our Team will review and update.

Thanks!

I can confirm that compilation proceeds correctly on any platform I tried (MacOSX, linux).

I am doing a test build where I replaced the strings above from main. Will report shortly.

Could you please elaborate more and provide detailed steps to replicate the issue reported here ?

  1. Make sure you have XCode 14.3 installed (earlier versions won’t compile TF as per issue: https://github.com/tensorflow/tensorflow/issues/58368 )
  2. git clone TF and checkout version 2.12.0 (or 2.11.1)
  3. cd in the folder tensorflow run ./configure with all default options.
  4. run compilation: bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package --verbose_failures

At some point compilation will stop with the error in this issue.

To fix it:

  1. run your text editor (I use nano) into the external folder with the problematic library boringssl: nano /private/var/tmp/_bazel_YOU-AS-USER/SOME_ALPHANUMERIC/external/boringssl/src/crypto/x509/t_x509.c
  2. modify the code according to the patch attached (essentially remove all references to the unused variable l)
  3. restart compilation: bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package --verbose_failures

Patch: issue_60191_patch.txt