Skip to content

Allow access to the buildroot repo#1712

Merged
praiskup merged 1 commit intorpm-software-management:mainfrom
tkopecek:hermetic-repo-in-buildroot
Feb 18, 2026
Merged

Allow access to the buildroot repo#1712
praiskup merged 1 commit intorpm-software-management:mainfrom
tkopecek:hermetic-repo-in-buildroot

Conversation

@tkopecek
Copy link
Contributor

Workaround for keepcache=1 not working with dnf4/local repos.

@tkopecek
Copy link
Contributor Author

@praiskup what do you think about this approach? /I can add docs later if we decide for this/

@tkopecek
Copy link
Contributor Author

Also there is a question of best dirname/location.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' ))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. The repository style guide recommends using uppercase with underscores for constants. Defining '/hermetic_repo' as a constant like HERMETIC_REPO_MOUNT_PATH would align with this convention. (link)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a terrible idea, it would introduce a long range dependency into the code completely unnecessarily.

@praiskup
Copy link
Member

@praiskup what do you think about this approach? /I can add docs later if we decide for this/

I have no objections here, thank you for working on this!

@rwmjones isn't it inconvenient to have a different repo when building hermetically?

@rwmjones
Copy link

I'm not sure I understand the question. Different repos where?

@praiskup
Copy link
Member

I meant a different location of the cache within chroot.

@rwmjones
Copy link

It's no problem! We just add them all in to a list and check each one in turn :-/

@praiskup
Copy link
Member

@tkopecek can you add Towncrier snippet mentioning that we newly make the pre-fetched RPMs accessible at rpmbuild time?

@praiskup
Copy link
Member

Otherwise LGTM

Workaround for keepcache=1 not working with dnf4/local repos.
@tkopecek tkopecek force-pushed the hermetic-repo-in-buildroot branch from 92dfbbd to 1be0ad5 Compare February 17, 2026 09:55
@tkopecek
Copy link
Contributor Author

@tkopecek can you add Towncrier snippet mentioning that we newly make the pre-fetched RPMs accessible at rpmbuild time?

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this note!

@praiskup praiskup merged commit 6bdafde into rpm-software-management:main Feb 18, 2026
32 checks passed
@tkopecek tkopecek deleted the hermetic-repo-in-buildroot branch February 18, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants