Skip to content

Conversation

@schaefi
Copy link
Contributor

@schaefi schaefi commented Jun 26, 2025

The new method creates the given --target-dir if not yet present and checks if the calling user can touch the result log file prior starting the build process

@schaefi schaefi requested a review from Conan-Kudo June 26, 2025 08:54
@schaefi schaefi self-assigned this Jun 26, 2025
@schaefi schaefi force-pushed the check_target_dir_permissions branch from 0b4d419 to f862ca9 Compare June 26, 2025 09:05
Copy link

@dcermak dcermak left a comment

Choose a reason for hiding this comment

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

LGTM overall, but how will this look in practice if the dir is not writable? Is the error legible for the user?

@schaefi
Copy link
Contributor Author

schaefi commented Jun 26, 2025

LGTM overall, but how will this look in practice if the dir is not writable? Is the error legible for the user?

It will look like this for example

whoami 
ms
sudo mkdir /tmp/mytest
kiwi-ng system boxbuild --box universal -- --description ~ms/kiwi/build-tests/x86/tumbleweed/test-image-disk --target-dir /tmp/mytest

...

[ ERROR   ]: 11:42:05 | KiwiBoxPluginTargetPathError: Failed to create/setup target path /tmp/mytest: [Errno 13] Permission denied: '/tmp/mytest/result.log

I believe this tells you all you need, no ?

schaefi added 2 commits June 26, 2025 11:56
The new method creates the given --target-dir if not
yet present and checks if the calling user can touch
the result log file prior starting the build process
As documented in https://setuptools.pypa.io/en/latest/pkg_resources.html
the use of pkg_resources is obsolete and will cause issues.
So happened on Debian unstable.
@schaefi schaefi force-pushed the check_target_dir_permissions branch from 15a2e61 to 148e624 Compare June 26, 2025 09:57
@dcermak
Copy link

dcermak commented Jun 26, 2025

I believe this tells you all you need, no ?

Yes it does 👍

@schaefi schaefi merged commit a71765c into main Jun 26, 2025
5 checks passed
@schaefi schaefi deleted the check_target_dir_permissions branch June 26, 2025 12:40
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