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: use the root mock profile property for lock names #151

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

lzaoral
Copy link
Member

@lzaoral lzaoral commented Feb 19, 2024

To fix a crash when two mock profile configuration files have different names but use the same root directory:

[...]
>>> 2024-02-19 14:29:12	"/usr/bin/mock" "-r" "/tmp/tmpyfvruenl/mock.cfg" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--init"
INFO: mock.py version 5.2 starting (python version = 3.9.18, NVR = mock-5.2-1.kdudka.5.el9), args: /usr/libexec/mock/mock -r /tmp/tmpyfvruenl/mock.cfg --plugin-option=tmpfs:keep_mounted=True --config-opts=print_main_output=True --init
Start(bootstrap): init plugins
INFO: selinux enabled
Finish(bootstrap): init plugins
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start: clean chroot
ERROR: Build root is locked by another process.

!!! 2024-02-19 14:29:13	warning: failed to init mock profile (/tmp/tmpyfvruenl/mock.cfg), trying to scrub cache...
[...]

Resolves: openscanhub/openscanhub#228 (comment)

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.

Would it make sense to cache the root_path value in the MockWrapper object so that it can be used at other places (e.g. in the semgrep plug-in) without querying it again?

py/csmock Outdated Show resolved Hide resolved
py/csmock Outdated Show resolved Hide resolved
@lzaoral
Copy link
Member Author

lzaoral commented Feb 20, 2024

All suggestions addressed in or obsoleted by 87dfa62.

@lzaoral lzaoral requested a review from kdudka February 20, 2024 09:24
py/csmock Outdated Show resolved Hide resolved
@lzaoral lzaoral requested a review from kdudka February 21, 2024 12:00
py/csmock Outdated Show resolved Hide resolved
py/csmock Outdated Show resolved Hide resolved
@lzaoral lzaoral requested a review from kdudka February 27, 2024 11:47
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.

Works as expected now. Thanks!

To fix a crash when two mock profile configuration files have different names
but use the same root directory:
```
[...]
>>> 2024-02-19 14:29:12	"/usr/bin/mock" "-r" "/tmp/tmpyfvruenl/mock.cfg" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--init"
INFO: mock.py version 5.2 starting (python version = 3.9.18, NVR = mock-5.2-1.kdudka.5.el9), args: /usr/libexec/mock/mock -r /tmp/tmpyfvruenl/mock.cfg --plugin-option=tmpfs:keep_mounted=True --config-opts=print_main_output=True --init
Start(bootstrap): init plugins
INFO: selinux enabled
Finish(bootstrap): init plugins
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start: clean chroot
ERROR: Build root is locked by another process.

!!! 2024-02-19 14:29:13	warning: failed to init mock profile (/tmp/tmpyfvruenl/mock.cfg), trying to scrub cache...
[...]
```

Resolves: openscanhub/openscanhub#228 (comment)
@lzaoral lzaoral merged commit b2c7201 into csutils:main Feb 27, 2024
2 checks passed
@lzaoral lzaoral deleted the mock-root-locking branch February 27, 2024 14:43
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