Allow access to the buildroot repo#1712
Allow access to the buildroot repo#1712praiskup merged 1 commit intorpm-software-management:mainfrom
Conversation
|
@praiskup what do you think about this approach? /I can add docs later if we decide for this/ |
|
Also there is a question of best dirname/location. |
There was a problem hiding this comment.
Code Review
This pull request introduces a workaround for an issue where keepcache=1 does not function correctly with dnf4 for local repositories in hermetic builds. The change enables the bind_mount plugin and mounts the offline repository into the buildroot, which is a sensible approach. The code is clear, but I have one suggestion to improve maintainability by replacing a hardcoded string with a named constant.
| # https://lists.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.org/thread/ZIBY53JAURLT3QRBBJIJJ7EZWLZDE3TI/ | ||
| # keepcache=1 for local repos work only in dnf5 not dnf4 | ||
| config_opts['plugin_conf']['bind_mount_enable'] = True | ||
| config_opts['plugin_conf']['bind_mount_opts']['dirs'].append((final_offline_repo, '/hermetic_repo' )) |
There was a problem hiding this comment.
The hardcoded string '/hermetic_repo' is a magic string. To improve readability and maintainability, it's better to define this as a constant at the module or function level. For example: HERMETIC_REPO_MOUNT_PATH = '/hermetic_repo'.
References
- The repository style guide recommends using uppercase with underscores for constants. Defining
'/hermetic_repo'as a constant likeHERMETIC_REPO_MOUNT_PATHwould align with this convention. (link)
There was a problem hiding this comment.
That's a terrible idea, it would introduce a long range dependency into the code completely unnecessarily.
|
I'm not sure I understand the question. Different repos where? |
|
I meant a different location of the cache within chroot. |
|
It's no problem! We just add them all in to a list and check each one in turn :-/ |
|
@tkopecek can you add Towncrier snippet mentioning that we newly make the pre-fetched RPMs accessible at rpmbuild time? |
|
Otherwise LGTM |
Workaround for keepcache=1 not working with dnf4/local repos.
92dfbbd to
1be0ad5
Compare
done |
| directory—let's call it an *offline repository*. | ||
|
|
||
| This repository is also available during the build for inspection or use | ||
| inside the buildroot in the `/hermetic_repo` directory. |
Workaround for keepcache=1 not working with dnf4/local repos.