How can trigger Tensorflow build to build third-party dependencies in sequence?

Hi,
I am trying to build TF2.12 with some additional third-party dependencies. During the build of Tensorflow from the source, it is not consistent. I have faced three scenarios.

  1. Sometimes, TF2.12 builds appropriately with additional third-party dependencies.
  2. Sometimes, TF2.12 gives a middleman error for additional third-party library build.
  3. Sometimes, TF2.12 gives a missing header for additional third-party library build.

I think that TF2.12 build system tries to build a third-party tool by executing the third-party Bazel scripts with multiple instances that cause race conditions (resulting in the three above scenarios). How can I run a single build instance of third-party dependency to avoid build inconsistency?

Bazel build commands:
bazel build --cxxopt=“-D_GLIBCXX_USE_CXX11_ABI=1” --copt=“-O3” -c opt --copt=-march=‘znver2’ //tensorflow/tools/pip_package:build_pip_package --noincompatible_do_not_split_linking_cmdline

Thanks,
Alok.