---
title: 获取org_boost子仓依赖时失败的解决办法
description: "编译TF-Serving时构建依赖org_boost提示“error running 'git -c protocol.file.allow=always submodule update --init --recursive --checkout --force' while working with @org_boost”。详细信息如下："
url: https://www.hikunpeng.com/document/detail/zh/SRA/ecosystemEnable/TensorFlowServing/kunpengtfserving_02_0015.html
sourcePath: /source/zh/SRA/ecosystemEnable/TensorFlowServing/kunpengtfserving_02_0015.html
indexId: 6faea6c64f5d63281a5fd0bef49df2659829df5e306879656b137e7d250d8de678
---
# 获取org_boost子仓依赖时失败的解决办法

#### 问题现象描述

编译TF-Serving时构建依赖org_boost提示“error running 'git -c protocol.file.allow=always submodule update --init --recursive --checkout --force' while working with @org_boost”。详细信息如下：

```
ERROR: /home/cya/boss/tfserving/serving/output/ba6572d0268f10026d9549fa2ae08318/external/ydf/yggdrasil_decision_forests/metric/BUILD:11:15: @ydf//yggdrasil_decision_forests/metric:metric depends on @org_boost//:boost in repository @org_boost which failed to fetch. no such package '@org_boost//': error running 'git -c protocol.file.allow=always submodule update --init --recursive --checkout --force' while working with @org_boost:
Timed out
WARNING: /home/cya/boss/tfserving/serving/tensorflow_serving/servables/tensorflow/BUILD:1062:22: in cc_library rule //tensorflow_serving/servables/tensorflow:thread_pool_factory_config_proto: target '//tensorflow_serving/servables/tensorflow:thread_pool_factory_config_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
WARNING: errors encountered while analyzing target '//tensorflow_serving/model_servers:tensorflow_model_server': it will not be built
```


#### 关键过程、根本原因分析

网络不稳定导致org_boost子仓不能完整下载。


#### 结论、解决方案及效果

1. 进入--distdir指定目录即“path/to/tfserving/serving/proxy”目录，使用以下方法下载。
  1 2 3 4 5 cd proxy git clone https://github.com/boostorg/boost.git cd boost git checkout b7b1371294b4bdfc8d85e49236ebced114bc1d8f git submodule update --init --recursive

2. 修改工程构建文件“./tensorflow_serving/workspace.bzl”，删除第128行以下内容。

```
new_git_repository(
name = "org_boost",
commit = "b7b1371294b4bdfc8d85e49236ebced114bc1d8f",  # boost-1.75.0
build_file = "//third_party/boost:BUILD",
init_submodules = True,
recursive_init_submodules = True,
remote = "https://github.com/boostorg/boost",
)
```


  修改为以下内容（请根据实际情况修改path）。

```
native.new_local_repository(
name="org_boost",
build_file="//third_party/boost:BUILD",
path="/path/to/tfserving/serving/proxy/boost",
)
```


3. 重新编译。
