I am building packages using “osc build” command (version 0.182.0) in Tumbleweed. Find that once a package has been built successfully, contents in the following directories are removed:
Also the stdout logs show that the default behavior is to keep rpmbuild (if --clean option is not specified) but remove all contents under BUILD/ and BUILDROOT/
Is there an option or a way to keep these directories without being cleaned? (It is probably can be achieved using chroot and rpmbuild command directly but I’d prefer an “osc way”).
This hack does not work for me. I set the same build-root with you in oscrc and then executed osc build command, directories were cleaned.
Did you make other configurations to restrict it from running rm command?
@malcolmlewis It still does not work. I have following configurations:
su-wrapper = sudo
build-root = /data/build-root/
My own solution is to add exit 1 in the %install section in the spec, and remove it after the failed building process.
Both of methods look like hack for me because these settings are not intended to be used for keeping files originally. A specific option should be more convenient. Maybe I will consider a feature request in future.
@we3i another thought, you can always look at the build log to see what is failing osc lbl maybe it’s my workflow, if it fails, see what fails and fix it, don’t generally need to look in /home/abuild directory.
I’m afraid there’s no “osc way” here, OBS’s build environment is designed to be hermetic - and as much as possible when using chroot as VM type, rather than e.g. KVM. If the build succeeds, there’s no reason to keep the builddir and buildroot directories around.
What I’d like to do is just to keep the source code that the patches have been applied, and an environment that binaries have been installed, so I could use it for the further development. I know I can patch it manually, also other information can be found in the logs, but if osc provides a way then I can save some commands.
As what you have suggested, I agree that this request is not so important and probably very few people need it.