Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csmock works with systemd-nspawn only on RHEL-9 and newer #142

Open
kdudka opened this issue Nov 30, 2023 · 0 comments
Open

csmock works with systemd-nspawn only on RHEL-9 and newer #142

kdudka opened this issue Nov 30, 2023 · 0 comments

Comments

@kdudka
Copy link
Member

kdudka commented Nov 30, 2023

csmock does not work well with systemd-nspawn on RHEL-8 because systemd-239-78.e8 does not include a systemd hack which mock uses internally and which csmock relies on. If the environment variable is ignored by systemd-nspawn, /tmp is over-mounted by a fresh tmpfs file system on each invocation of mock --chroot or mock --shell, and whatever we put into /tmp is missing in the next steps. For example:

>>> 2023-11-30 14:42:13 "tar -cP '/usr/share/csmock/scripts' '/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1.src.rpm' '/tmp/csmockpvtw2ssw/gitleaks' | '/usr/bin/mock' '-r' 'rhel-8.7.0.z-x86_64' '--plugin-option=tmpfs:keep_mounted=True' '--config-opts=print_main_output=True' '--quiet' '--shell' 'tar -xC/'"
tar: Removing leading `/' from member names

>>> 2023-11-30 14:42:15 "/usr/bin/mock" "-r" "rhel-8.7.0.z-x86_64" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--quiet" "--chroot" "rpm -Uvh --nodeps '/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1.src.rpm'"
error: open of /tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1.src.rpm failed: No such file or directory

[...]

>>> 2023-11-30 14:42:30 "/usr/bin/mock" "-r" "rhel-8.7.0.z-x86_64" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--quiet" "--chroot" "/tmp/csmockpvtw2ssw/gitleaks detect --no-git cmd --source=/builddir/build/BUILD --report-path=/builddir/gitleaks-capture.sarif --report-format=sarif 2>/builddir/gitleaks-capture.log"

>>> 2023-11-30 14:42:32 "'/usr/bin/mock' '-r' 'rhel-8.7.0.z-x86_64' '--plugin-option=tmpfs:keep_mounted=True' '--config-opts=print_main_output=True' '--quiet' '--shell' 'tar -c --remove-files '/builddir/gitleaks-capture.sarif' '/builddir/gitleaks-capture.log'' | tar -xC '/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1/debug/raw-results'"
tar: Removing leading `/' from member names
tar: /builddir/gitleaks-capture.sarif: Cannot stat: No such file or directory
tar: Removing leading `/' from hard link targets
tar: Exiting with failure status due to previous errors

>>> 2023-11-30 14:42:34 "csgrep '/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1/debug/raw-results/builddir/gitleaks-capture.sarif' --mode=json --warning-rate-limit=1024 --limit-msg-len=512 > '/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1/debug/uni-results/gitleaks-capture.js'"
/tmp/csmockpvtw2ssw/cloud-init-21.1-15.el8_6.1/debug/raw-results/builddir/gitleaks-capture.sarif: failed to open input file

!!! 2023-11-30 14:42:34 error: post-process hook failed
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

No branches or pull requests

1 participant