-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for source-based packages #1972
base: main
Are you sure you want to change the base?
Support for source-based packages #1972
Conversation
Hey @jordansissel, I updated the prototype to build SRPM's for Ruby gems along with CPAN distributions, and was able to to do so in a way that can be further expanded to all package types. I added instance variables The problem with this approach is that the build and install procedures need to be hard-coded, which means packages need to determine the one and only way to be built and installed. I believe though that we could add flags for the input package types that allow the user to override these variables so you can set the build and install procedures to arbitrary values. How does this sound to you? Let me know what you think! P.S. |
Hey @jordansissel, not sure why the new CI is failing, how can we can help? |
Thanks for your continued work on this! I haven’t made time to review any updates this week. As for CI, you can ignore it for now. It’s new and I haven’t even tried using that yet since a recent PR re-enabled it. I can turn it off if causes too much noise. |
Howdy @jordansissel , can you please provide feedback on this prototype design so @NicholasBHubbard and I can continue to move forward with development? Thanks in advance! :-) |
Yep! I’ll try to take a look this week.
…On Fri, Dec 16, 2022, at 9:43 AM, William N. Braswell, Jr. wrote:
Howdy @jordansissel <https://github.com/jordansissel> , can you please provide feedback on this prototype design so @NicholasBHubbard <https://github.com/NicholasBHubbard> and I can continue to move forward with development? Thanks in advance! :-)
—
Reply to this email directly, view it on GitHub <#1972 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABAF2QXDINJZZNZMK2BODDWNSS3DANCNFSM6AAAAAASTDRGJA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The world has gifted my family with covid, so it’s gonna be a bit longer before I find time and energy to provide feedback. |
I added a prototype for creating source based Debian packages (SDEB's). @wbraswell and I would like to have both SRPM and SDEB support implemented before merging this PR. By requiring ourselves to implement multiple package types, we must focus on adding architecture into FPM that will allow us to implement various source based package types, instead of hardcoding support for just one type. This SDEB prototype uses architecure similar to the SRPM prototype, where input packages communicate data to the output package via the I think we should first finish implementing SRPM's before moving on to SDEB's, but hopefully this SDEB prototype gives us a nice jumping off point in the future. |
Ping @jordansissel |
Working on it -- I spent some time reading the code last night and will test it soon and get y'all feedback. |
Hi @jordansissel, how would you like to proceed? |
It’s on my todo list to try this out and get y’all feedback.
…On Mon, Feb 27, 2023, at 9:56 AM, William N. Braswell, Jr. wrote:
Hi @jordansissel <https://github.com/jordansissel>, how would you like to proceed?
—
Reply to this email directly, view it on GitHub <#1972 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABAF2WQP4F72PP7JIZJYT3WZTTE3ANCNFSM6AAAAAASTDRGJA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm focusing this review on the "make it work" part of fpm's project philosphy which mean we can focus on things like code behavior and user interface, and I will try to avoid commentary on "make it right" aspects (test coverage, handling edge cases, etc) or "make it fast" (code maintenance hazards, execution speed, etc). First: How much difference should be expected between rpms built by fpm as compared to ones produced by 'fpm -> srpm -> rpmbuild --rebuild' (or other SRPM build systems)? Second: I haven't been successful yet using this PR. I'm testing it on a relatively fresh Fedora 37 container installing only packages I found are necessary for fpm/ruby/python/perl/etc as well as rpmbuild-related tools. I made some effort to get Third: Thinking towards "make it right", but no action required now, what should we use to test build behavior? mock? rpmbuild --rebuild? Others? The following are package-specific things I found while using this PR: Ruby gemProbably missing
Python
Perl cpan
But even running rpmbuild as root, as an experiment, it still fails (for me, on a fresh-ish Fedora 37):
And if we bypass this by adding
The architecture target for the package is |
Hey @jordansissel, thanks for the response! The purpose of the SRPM and SDEB prototypes are to display a general architectural design for implementing source-based packages. It is important to @wbraswell and I that we come up with a design that will allow more source-based package types to be supported by FPM in the future. The bugs you brought up are important and need to be addressed, however I would first like to get your feedback on the general design of the prototypes. To implement (buildable) source-based packages, the input package needs to communicate its build instructions, install instructions, and source code to the output package. The way I accomplished this is by adding the instance variables What downsides do you see to this approach? Do you see any fundamental flaws? Is there a different way we could do this that would make it easier to add more source-based package types in the future? |
@NicholasBHubbard Alright we can start with that direction (the internal architecture). At a high level, adding "source" package support is a good time to rethink how fpm "input" operations work specifically to separate what often is three separate steps combined into the one "input" step: acquisition of the package itself, loading the package metadata, and performing the installation step. The 'gem.rb' does this very directly with the Maybe: Split "install" steps away from the
|
@jordansissel |
Thanks for the ideas Jordan, they sound reasonable. I am working on updating the prototypes to use these ideas, which hopefully I can submit for you to review in the next few days. |
Hello @jordansissel and @wbraswell! I've recently found some time to work on this source-based package stuff again. I created a new PR #2024. This PR starts to implement the fundamental architectural change that we discussed with the build/install procedures being extracted out of the input() method. I created a separate PR for this as I am thinking it is a good intermediate step that we could merge before we add real support for source-based package types. This PR updates the internals of FPM::Package, FPM::Package::CPAN, and FPM::Package::Gem to separate out the build/install procedures out of the input() method. This PR breaks FPM for all input types other than cpan and gem. @jordansissel suggested we separate input() into two methods called prepare() and install(). This is essentially what I did, however I did not rename input() to prepare(), and I called install() I also added a method to the FPM::Package class called
So now we detect if we are converting to a source-based package and if so we transfer the shell-code instance variables I would appreciate your guys feedback on this. If you think that this is a good pattern then we can go ahead and start modifying all the other input package types to work this way. Unfortunately with this change the gem tests failed (the cpan ones still pass). I believe this is because the tests make assertions about system state after invoking the input() By the way, Im not sure how we could support source-based packages that dont use shell-code. I think for now we should just focus on SRPM and SDEB to try to keep things moving forward. |
Nice work @NicholasBHubbard ! |
This is a copy of #1967 that I created for the purpose of allowing both myself and @jordansissel to be able to write to this PR's branch.