How to remove build dependencies?

Imagine one did

zypper si -d PrusaSlicer

How to remove those ~20 devel packages later on?

So basically no way to unroll it, except one by one?

Hi
Copy the list of files in the output to a file and keep to use later with zypper rm <your list>.

Script the action/files from the zypper history log for later consumption for removal.

Build as an rpm and use the build service and osc locally (which is what I do) for no devel packages installed in the system at build time, just kept in the build-root…

If you just built the app,
And installed on BTRFS, you can roll back to an earlier snapshot.
In the future,
You can deploy your build environment in a virtual machine using something like Virtualbox,
Then when you’re done with that environment you can just delete the virtual machine leaving your physical machine pristine.

TSU