Skip to content

csmock: add --use-host-csgrep param#221

Closed
sfowl wants to merge 1 commit intomainfrom
use-static-csgrep
Closed

csmock: add --use-host-csgrep param#221
sfowl wants to merge 1 commit intomainfrom
use-static-csgrep

Conversation

@sfowl
Copy link
Contributor

@sfowl sfowl commented Feb 18, 2026

This param copies in the statically linked version of csgrep installed on the host into the mock root, removing the build dependency on csgrep. Requires the csgrep-static package is installed on the host.

This is both to support hermetic (re-)builds with csmock and to work towards using unchanged mock configs from the original build.

This param copies in the statically linked version of csgrep
installed on the host into the mock root, removing the build
dependency on csgrep. Requires the `csgrep-static` package
is installed on the host.

This is both to support hermetic (re-)builds with csmock and
to work towards using unchanged mock configs from the original
build.
@sfowl
Copy link
Contributor Author

sfowl commented Feb 23, 2026

I only just noticed this commit 6da2490 but it looks like it's still in a non-main branch. I think I would prefer to use the approach there, i.e. make this default behaviour, don't add a new param, but maybe I'm missing something.. not sure why this hasn't made it into a PR yet.

Copy link
Member

@kdudka kdudka left a comment

Choose a reason for hiding this comment

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

Looks good. One minor comment inline.

Comment on lines +1180 to +1181
def symlink_static_csgrep_hook(_, mock):
return mock.exec_chroot_cmd("ln -s /usr/libexec/csgrep-static /usr/bin/csgrep")
Copy link
Member

Choose a reason for hiding this comment

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

This should be ln -fs ... so that the hook is idempotent. Otherwise it would fail when csmock is used with --no-clean and --skip-init.

@kdudka
Copy link
Member

kdudka commented Feb 23, 2026

@sfowl Commit 6da2490 has not been merged because of csutils/csdiff#235 -- I was unable to build csdiff-static for epel8 and epel9 back then.

@kdudka
Copy link
Member

kdudka commented Feb 23, 2026

The change was proposed in #216 but it was closed unresolved because of the reason mentioned above.

@kdudka kdudka self-requested a review February 25, 2026 11:30
@kdudka
Copy link
Member

kdudka commented Feb 25, 2026

The --use-host-csgrep option should not be needed any more because #216 made csmock use csgrep-static in the chroot unconditionally.

@kdudka kdudka requested review from kdudka and removed request for kdudka February 25, 2026 11:32
@sfowl
Copy link
Contributor Author

sfowl commented Feb 26, 2026

Closed in favour of #216

@sfowl sfowl closed this Feb 26, 2026
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.

2 participants