bazel - 如何解决 ONOS 控制器构建问题?
问题描述
我正在尝试从源代码构建 ONOS 控制器,但是在 bazel 构建过程的某个时刻,我得到了很多错误,如下所示:
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
INFO: Analyzed target //:onos (1728 packages loaded, 58166 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /home/kevin/.cache/bazel/_bazel_root/b80cf3299f3992e280eed8f85033340e/sandbox
ERROR: /home/kevin/onos/BUILD:52:1: Executing genrule //:onos-karaf failed (Exit 2) bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
tar: apache-karaf-4.2.9/etc/org.ops4j.pax.logging.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/java.util.logging.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.command.acl.feature.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.shell.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.kar.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/jmx.acl.osgi.compendium.cm.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/distribution.info: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.command.acl.config.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/system.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/jre.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/all.policy: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.command.acl.shell.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/users.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/startup.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/jmx.acl.org.apache.karaf.config.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.command.acl.jaas.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/scripts/shell.completion.script: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/scripts: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/jmx.acl.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/custom.properties: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/profile.cfg: Cannot change ownership to uid 1001, gid 1001: Invalid argument
tar: apache-karaf-4.2.9/etc/org.apache.karaf.features.xml: Cannot change ownership to uid 1001, gid 1001: Invalid argument
这只是一小部分,有数百行错误。尽管如此,该特定部分仍"Cannot change ownership to uid 1001, gid 1001: Invalid argument"
显示在每一行中。
我能做些什么来解决这个问题?
编辑:我尝试了这里描述的解决方案:https ://unix.stackexchange.com/questions/548108/cannot-change-ownership-to-uid-1001-gid-1001-invalid-argument 但没有变化。
解决方案
尝试将 --no-same-owner 添加到运行 tar 的脚本中
vim /opt/onos/tools/package/onos-prep-karaf
将第 22 行更改为:
tar xf $KARAF_TAR --no-same-owner
然后sudo bazel build ono
再次运行 s。
推荐阅读
- javascript - 如何在 Django 模板过滤器中注入 JavaScript 变量
- mysql - 使用 pgloader 将 rails 中的数据从 mysql 迁移到 postgres 时,每个表的 created_at 和 updated_at 字段不一致
- javascript - Highcharts 标题对齐
- python - 将 doc2vec 段落表示映射到训练后的类标签
- excel - 将字符串从 Excel 传递到 Word
- java - 如何访问嵌套的 Hashmap
- javascript - 变量值仅在“then”promise 中可见
- biztalk - 探索 BizTalk 2010 业务流程的详细信息
- gradle - 在 readme.md 文件中显示 gradle 属性
- azure - Azure 机器学习工作室中的标签编码