Ardupilot 编译问题汇总

问题0001

Command ['/usr/bin/git', 'rev-parse', '--short=8', 'HEAD'] returned 128
//将来源代码中可能会有无数个位置使用git_head_hash函数调用或其变体之一。一次获得它们的任何简单方法(至少现在是这样)是编辑Tools/ardupilotwaf/git_submodule.py
def _git_head_hash(ctx, path, short=False):
    cmd = [ctx.env.get_flat('GIT'), 'rev-parse']
    if short:
        cmd.append('--short=8')
    cmd.append('HEAD')
    out = ctx.cmd_and_log(cmd, quiet=Context.BOTH, cwd=path)
    return out.strip()
    
//将其修改为立即返回一个假哈希字符串:
def _git_head_hash(ctx, path, short=False):
    return "deadc0de"

//您可以根据需要编辑此函数,该函数应处理Command ['/usr/bin/git', 'rev-parse', '--short=8', 'HEAD'] returned 128构建过程中报告的所有错误。

问题0002

Build failed
Traceback (most recent call last):
  File "/mnt/hgfs/002_Ardupilot-420/ardupilot/modules/waf/waflib/Runner.py", line 395, in task_status
    return tsk.runnable_status()
  File "Tools/ardupilotwaf/git_submodule.py", line 75, in runnable_status
    out = self.generator.bld.cmd_and_log(cmd, quiet=Context.BOTH, cwd=self.cwd)
  File "/mnt/hgfs/002_Ardupilot-420/ardupilot/modules/waf/waflib/Context.py", line 461, in cmd_and_log
    raise e
WafError: Command ('/usr/bin/git', 'submodule', 'status', '--recursive', '--', '/mnt/hgfs/002_Ardupilot-420/ardupilot/modules/ChibiOS') returned 128

git config --global --add safe.directory /mnt/hgfs/002_Ardupilot-420/ardupilot
git submodule update --init --recursive --force

问题0003

ubuntu18.04提示:cannot create temp file for here-document, no space left on device
由于虚拟机分配的存储大小不足,可用df -h 查询当前设备空间分配

问题0004

submodule更新失败:
fatal: remote error: upload-pack: not our ref 53a161966d2f0c95c04c7262e71d319be2618505 fatal: The remote end hung up unexpectedly
cd {submodule path}
git reset --hard origin/master
cd -
git clean -n
git add {submodule path}
git commit
git submodule update --init --recursive
       
link:https://stackoverflow.com/questions/61163082/why-does-git-submodule-update-fail-with-fatal-remote-error-upload-pack-not-o
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值