AlmaLinux / AlmaLinux/build-system

Multilib processing fails when a build contains two platforms

未关闭
#512 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug build-node good first issue
主要语言
没有语言数据
星标
32
派生
11
PR 合并指标
30 天内没有已合并 PR

描述

As uncovered in [this build](https://build.almalinux.org/build/47501), multilib processing is failing due to the following error:

```
asyncpg.exceptions.CardinalityViolationError: more than one row returned by a subquery used as an expression
```

The query in question is:

```
subquery = (
select(models.BuildTask.id)
.where(
sqlalchemy.and_(
models.BuildTask.build_id == build_task.build_id,
models.BuildTask.index == build_task.index,
models.BuildTask.arch == "i686",
)
)
.scalar_subquery()
)
```

Since the build contains 2 platforms (and multilib applies to both), the subquery is returning 2 ids, one for Alma 8 and another one for Alma 9, while we expect to find exactly one.

I imagine that fixing the problem should be as simple as adding the condition ` models.BuildTask.platform_id == build_task.platform_id` to the subquery, to ensure that we limit the results to the i686 packages of the same platform we are processing at that time.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。