Skip to content

csmock: use the root mock profile property for lock names#151

Merged
lzaoral merged 1 commit intocsutils:mainfrom
lzaoral:mock-root-locking
Feb 27, 2024
Merged

csmock: use the root mock profile property for lock names#151
lzaoral merged 1 commit intocsutils:mainfrom
lzaoral:mock-root-locking

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?

@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
@lzaoral lzaoral requested a review from kdudka February 21, 2024 12:00
@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
@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