> Heh, I had this same exact idea yesterday evening after closing the laptop
> for the day.
Oh :smile: Good, it's not a completely crazy idea then.
I didn't think it through too much, the use case just felt familiar enough,
mostly due to the recent test-suite rework but of course it's a common theme
with other similar tooling, as you said.
> We indeed already have similar things around, rpmspec and rpmlua have
> --shell, and like you said, our test-suite has it too.
Yup, somehow forgot about those utilities we ourselves ship :smile: And then
there's `mock --shell`, `mkosi shell`, etc.
> Because the needs of folks running stuff this way vary a lot, I think --shell
> would need to be a "subcommand" that runs before exiting rpmbuild.
Indeed, what we want here basically is to allow the user to swap out the
respective build script with their own shell (script) that executes in the
exact same environment, thus giving them access to all of its internals for
their own purposes, including just `echo`ing the env vars.
> Eg, 'rpmbuild -bp --shell ...' would run the shell bit after running %prep,
> but before exiting, 'rpmbuild -bc --shell' after compile phase, etc. It
> probably should be disabled during actual package builds.
Oh, good idea, yup. Reusing the existing stage options sounds natural and
wouldn't require additional options.
> As for printing out relevant parts, instead of adding individual prints with
> names in there, I think we should just dump the (rpm specific) environment
> out into the build log. It'll help diagnosis in several other situations too,
> right now you need to catch an in-flight scriptlet execution to see what
> exactly is in the temporary scriptlet that is actually executing. And, if we
> put the environment into a file, which has the benefit of being sourceable
> for other purposes, printing it out is just a matter of simple "cat".
Right, inspecting a build script would be possible with the `--shell` option
already, but having a simple way to get the actual script that gets executed by
rpmbuild without having to hunt for the temp file (as you said) would indeed be
nice (and something I have wished for on many occasions myself :smile:).
> This is starting to look like a plan with several benefits and no downsides.
Indeed. These are basically two separate features at this point, although
somewhat connected.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3147#issuecomment-2154272706
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/3147/2154272...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint