【问题标题】:COPR fedoraproject.org builder refuses to download sources specified in my .spec fileCOPR fedoraproject.org 构建器拒绝下载我的 .spec 文件中指定的源
【发布时间】:2022-10-04 17:58:32
【问题描述】:

我在https://copr.fedoraproject.org 中有一个包构建。我的spec for rpkg is here。构建失败并出现以下问题

Generated rpkg config:
[rpkg]
preprocess_spec = True

[git]
anon_clone_url = https://github.com/%(repo_path)s

[lookaside]
download_url = https://${git_props:remote_netloc}/repo/pkgs/%(repo_path)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s

Writing config into /var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/.config/rpkg.conf
Running: rpkg srpm --outdir /var/lib/copr-rpmbuild/results --spec /var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/skupper-router

cmd: ['rpkg', 'srpm', '--outdir', '/var/lib/copr-rpmbuild/results', '--spec', '/var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/skupper-router']
cwd: /var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/skupper-router
rc: 1
stdout: Wrote: /var/lib/copr-rpmbuild/results/skupper-router.spec
stderr: git_dir_pack: archiving /var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/skupper-router:
commit cb2a29004b1660168cc4a6894e521b0cf71cb25d (HEAD -> jd_2022_03_15_rpm, origin/jd_2022_03_15_rpm)
Date:   Sat Apr 9 01:04:32 2022 +0200

    add static build rpm
git_dir_pack: Wrote: /var/lib/copr-rpmbuild/results/skupper-router-cb2a2900.tar.gz
error: Bad source: /var/lib/copr-rpmbuild/results/qpid-proton-0.37.0.tar.gz: No such file or directory

Copr build error: git_dir_pack: archiving /var/lib/copr-rpmbuild/workspace/workdir-ce16hwto/skupper-router:
commit cb2a29004b1660168cc4a6894e521b0cf71cb25d (HEAD -> jd_2022_03_15_rpm, origin/jd_2022_03_15_rpm)
Date:   Sat Apr 9 01:04:32 2022 +0200

    add static build rpm
git_dir_pack: Wrote: /var/lib/copr-rpmbuild/results/skupper-router-cb2a2900.tar.gz
error: Bad source: /var/lib/copr-rpmbuild/results/qpid-proton-0.37.0.tar.gz: No such file or directory

(完整日志https://download.copr.fedorainfracloud.org/results/jdanek/skupper-router/srpm-builds/04126008/builder-live.log.gz

在我的机器上,运行rpkg srpm 成功。

我四处搜索,在我看来,如果 COPR 是通过 https 分发的,那么 COPR 应该愿意下载源代码,我的就是这样。

我可以以某种方式对我的源使用后备缓存功能吗?

【问题讨论】:

标签: fedora rpmbuild rpm-spec copr


【解决方案1】:

通常,通过 https 下载 qpid-proton 文件可以在 Copr 中工作。如果在某处的 rpm 宏中定义了%_disable_source_fetch 0,则它由 rpmbuild(由 rpkg 调用)完成。

问题是spec file 中的一行是:%undefine _disable_source_fetch,它会为给定的规范文件禁用此行为。

【讨论】:

    【解决方案2】:

    您的构建在git_dir_pack 上失败(rpkg-util,又名rpkg 失败)。这发生在rpmbuild 进程甚至开始之前。

    A few weeks ago 我们将 Copr 构建器迁移到 Fedora 35, 因此也适用于 rpkg-util v3。随意看看how to fix similar issues。 或者联系rpkg-util upstream 寻求指导。

    【讨论】:

    • 不是这样,skupper-router-cb2a2900.tar.gz 写得对。 qpid-proton-0.37.0.tar.gz 是失败的,不是由 rpkg 创建的,它是从我在规范中给出的 URL 下载的
    • 实际上,它可能是这样的:“自动打包 [...] 当在解压缩的内容上调用 rpkg srpm 时,rpkg 将下载外部源(如果有的话)”(pagure.io/fork/tmz/rpkg-util
    【解决方案3】:

    问题是源文件显然必须从后备缓存中下载。所以,让我们自己创造一个。或者至少,外貌之一。

    首先,将所需的源存档下载到您的计算机,到 git repo checkout 目录,然后使用 rpkg 进行“离线上传”

    wget https://www.apache.org/dist/qpid/proton/0.37.0/qpid-proton-0.37.0.tar.gz
    rpkg upload --offline qpid-proton-0.37.0.tar.gz
    

    这将创建 sources 文件。将其提交给回购。撤消对.gitignore 的编辑,这也是这样做的。 (如果该 rpkg 命令失败,只要创建了 sources 文件,就忽略它。)

    使用以下内容创建新文件rpkg.conf,并将其提交到 repo。

    [lookaside]
    download_url = https://www.apache.org/dist/qpid/proton/0.37.0/%(filename)s
    

    现在推动它并在 COPR 中构建它。

    (不要对下面打印的明显错误的download_url 感到困惑;我们在 repo 目录中的rpkg.conf 覆盖了它。)

    Running: git checkout jd_2022_03_15_rpm_cstdint
    
    cmd: ['git', 'checkout', 'jd_2022_03_15_rpm_cstdint']
    cwd: /var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/skupper-router
    rc: 0
    stdout: branch 'jd_2022_03_15_rpm_cstdint' set up to track 'origin/jd_2022_03_15_rpm_cstdint'.
    stderr: Switched to a new branch 'jd_2022_03_15_rpm_cstdint'
    
    Generated rpkg config:
    [rpkg]
    preprocess_spec = True
    
    [git]
    anon_clone_url = https://github.com/%(repo_path)s
    
    [lookaside]
    download_url = https://${git_props:remote_netloc}/repo/pkgs/%(repo_path)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s
    
    Writing config into /var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/.config/rpkg.conf
    Running: rpkg srpm --outdir /var/lib/copr-rpmbuild/results --spec /var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/skupper-router
    
    cmd: ['rpkg', 'srpm', '--outdir', '/var/lib/copr-rpmbuild/results', '--spec', '/var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/skupper-router']
    cwd: /var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/skupper-router
    rc: 0
    stdout: Downloading qpid-proton-0.37.0.tar.gz from jiridanek/skupper-router at www.apache.org:
    
    Wrote: /var/lib/copr-rpmbuild/results/skupper-router.spec
    Wrote: /var/lib/copr-rpmbuild/results/skupper-router-0.0.git.3560.d7714b9c-2.0.0.fc35.src.rpm
    stderr: git_dir_pack: archiving /var/lib/copr-rpmbuild/workspace/workdir-rmzys1po/skupper-router:
    commit d7714b9cac0641d4e34c0774b875fcb67cee8793 (HEAD -> jd_2022_03_15_rpm_cstdint, origin/jd_2022_03_15_rpm_cstdint)
    Author: Jiri Daněk <jdanek@redhat.com>
    Date:   Wed Apr 13 17:13:22 2022 +0200
    
        add autopack
    git_dir_pack: Wrote: /var/lib/copr-rpmbuild/results/skupper-router-d7714b9c.tar.gz
    
    Output: ['skupper-router.spec', 'qpid-proton-0.37.0.tar.gz', 'skupper-router-0.0.git.3560.d7714b9c-2.0.0.fc35.src.rpm', 'skupper-router-d7714b9c.tar.gz']
    

    成功!

    【讨论】:

      猜你喜欢
      • 2011-03-08
      • 2011-05-30
      • 1970-01-01
      • 2018-02-06
      • 1970-01-01
      • 2020-11-09
      • 2016-01-15
      • 1970-01-01
      • 2016-04-28
      相关资源
      最近更新 更多