Conversation
|
try building a npm package without setting any prefix and see if it fails due to file not found |
|
@mathieu-aubin I didn't change any settings except for those directly related to the RPM building. |
|
Also, I left in the support for Prefix but made it only exist if explicitly specified: https://github.com/jordansissel/fpm/pull/1657/files#diff-f32def54a1d6be460052b3c74f7aca7cR54 |
|
yes, i see that. have you tried building a rpm of a npm package with your fork? When i do, it fails unless i set a prefix. On both fedora30 and 28. will try in.a virtualenv |
|
@mathieu-aubin Can you post exactly how you're building the RPM? It's possible that we're just using two different methods and I was simply missing something during testing. I'll go ahead and update to add the Prefix in by default, simple enough and causes no issues except some warnings from |
i am thinking its got to do with npm prefix now... but just in case, can you double check? thanks |
gives me that /usr as prefix... |
|
I don't think that this is correct that prefix (i believe) is used at install time in order to install the package in a certain directory in fact, i just tested using a weird prefix and editing the spec file to correct thoses lines. Rpm installed into my weird prefix folder |
|
@mathieu-aubin Thanks for pinpointing this, should be corrected. |
mathieu-aubin
left a comment
There was a problem hiding this comment.
this does produce what it is entended to. Now maybe, since we can keep the spec file from the srpm... how about cleaning the header a bit and some of the odd comments in order to create a cleaner srpm for distributiom.
it would be good to run a cleaning command after the " -e " or just before rpmbuild starts its work. This way they still are in the project but get cleaned only pre-packaging
|
@mathieu-aubin If possible, I'd like to get this through as functional and then have separate work for "pretty". This PR doesn't address all of the ideas in the full comment thread, which are very good ideas, but I needed something that worked now and I'm OK with pretty later. Many thanks for your reviews, they've been really helpful! |
|
@trevor-vaughan would be very nice to get Travis fix moved into separate PR to fix the repo first. |
|
This should be reviewed and merged |
|
Can a maintainer take a look and merge this ? |
|
@sreerajkksd unless somebody steps in to co-maintain, I doubt this. At the very least this PR should be rebased with no distracting changes like whitespace and commented tests. |
d81dfca to
b848f67
Compare
|
@abitrolly Rebased. Not interested in re-breaking trivial whitespace updates. Will happily add tests for detecting that a SRPM was output if you can point me at the tests that show how the systems detects that a RPM has been output. |
|
Test failures appear unrelated to this change. |
|
Tests are not helping, because they are failing. #1681 contains fixes, and there are again no resources to review and mere that. |
|
The tests aren’t in great shape these days, and there’s a few tests that
always fail. For this PR, don’t worry about them.
…On Sun, Mar 28, 2021 at 2:31 AM Anatoli Babenia ***@***.***> wrote:
Tests are not helping, because they are failing. #1681
<#1681> contains fixes, and there
are again no resources to review and mere that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1657 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABAF2UC7VW6OM4MM46F35DTF3ZQNANCNFSM4IHIIM6Q>
.
|
|
Can a maintainer merge this ? cc: @jordansissel |
|
@jordansissel If you prefer to re-create PR that conflicts are resolved, I can do it. What do you think? |
|
I can rebase this again. I didn't realize there was still interest in it to be honest. |
* Modify RPM build process to generate and collect SRPM and RPM artifacts by default * Create a spec file that will allow for a natural `rpmbuild --rebuild <thing>.src.rpm` approach * Ensure that required components are present in the RPM spec file * At this time, not feature flagged. If users don't want the src.rpm output, they simply don't have to use it. Closes jordansissel#237
* Remove deprecated Buildroot option from the RPM template
I hadn't thought about users that wouldn't expect two RPMs to be output. Adding a flag for the SRPM makes sense to me but it seems like you'd want to go ahead and generate it along with the main RPM to keep the logic changes small. Maybe just a
Well, it's the best you can get when you're not actually building from source 😄. I think it's a reasonable 80% case and actually works pretty well if you're packaging up something like a bunch of interpreted code. The main benefit is that it gives you something that you can manually hack on later in case you want to do something more fancy than you can easily support with
That should be relatively easy to fix with some minor hackery. I'll work on getting it updated (hopefully in the near future). I'll happily accept PRs onto the original if anyone else wants to help get it in there.
Yeah, that shouldn't be too difficult. |
Agreed
Yes! When I think about folks requesting this feature, just having fpm output an SRPM at all would be a nice step forward for environments where a deployment step requires SRPMs as input (for whatever reason). If I can make time, I'll send you some PRs for the changes listed in your above comment 👍 |
Works! I've got this PR forked into a local branch and am working on it. |
I'm mostly focused on the behavior of the fpm command line. We can make the code simple and still have two different target packages ( |
|
Small changes based on discussion are in #1952. I'm still leaning towards having srpm be separate from rpm, and here's my thinking:, focusing on what I think the audience aka users will experience.
Example of possible confusion with The |
|
Thinking outloud a bit more... There are quite a number of flag options available for fpm's rpm support, and it might be annoying to have those flags doubled in the Maybe adding a new flag to let you choose rpm or srpm output? I'm still thinking that having both files output would be a bit odd and maybe confusing. Something that basically chooses I personally never used Would you want both a binary and source rpm from fpm at the same time? |
|
FWIW, I always generate both the SRPM and the RPM at the same time. Since the two extensions are different, a glob of I'm certainly open to adding a flag but I think I'd prefer getting both at once to running twice in case of a possible (but admittedly unlikely) race condition between the two on a running system. Maybe just |
|
I should add that the reason that I generate an SRPM is that it is often required by users. In many cases, the output of the |
|
Howdy @jordansissel ! Unfortunately, @NicholasBHubbard and I must strongly vote AGAINST merging this code from @trevor-vaughan (or your updated #1952), because it is providing the undesirable "fake SRPM" solution (no build instructions) instead of the desirable "real SRPM" solution (yes build instructions), as described in our original discussion during August of 2018: This "fake SRPM" vs "real SRPM" is a key and critical distinction between an fpm-only solution (fake) and an fpm-plus-fpm-cookery solution (real). In 2018 and again yesterday, I tagged you and @bernd requesting cooperation between fpm and fpm-cookery so that we can achieve the correct solution together: Can you please reply now to let us know your intentions regarding fpm-cookery and working together toward the "real SRPM" solution? Thanks in advance! :-) |
|
Well, I guess that nails it down to being non-default :-D. I suppose it's probably worth hacking the short description and/or description to make sure there's a warning that this might not contain all source materials. |
|
This PR causes FPM to output an SRPM that has an empty fpm-cookery provides a "recipe" feature that allows you to specify build instructions that can be used to build the software before packaging it as a binary. Because there is no magic way to know the build commands for any particular software project, the only way we can produce a "real" source package is if a build recipe is provided as input to FPM. I think we are better off exploring options for creating real SRPM's, hopefully by merging in the recipe feature from fpm-cookery. |
|
Hmm....I'll have to re-test, I thought that it worked correctly. At any rate, wouldn't Should be pretty straightforward to resolve. |
|
We cannot reliably do this in a generic way for all software. |
|
Ah, yes, that's 100% true. As an FPM user, I wouldn't expect an FPM-generated SRPM to be a "true" SRPM because it's literally impossible except in very narrow circumstances. But I do need the ability to modify configs and things in my generated RPMs and, preferably, I can do that without having to do a song and dance with creating containers/mocks, copying files, unpacking FPM-generated RPMs, re-running |
|
I guess, as long as it's opt-in and comes with warnings, I don't see the harm. |
|
@trevor-vaughan |
|
I don't mind but using In my case, literally nothing goes into the I guess if that means hooking |
|
This is not a minimal use case at all, we need to build many thousands of Perl SRPMs and can not accomplish that without using fpm-cookery or equivalent. I understand that the "fake SRPM" solution would work fine for you, but it absolutely would not work for everybody. The original debate goes all the way back to 2012: |
|
Right, so I'm asking that I get the option for my use case, and you don't have to use it for yours, that's pretty much it. |
|
I don't think that there is anything wrong with creating an SRPM with an empty %build section if no build recipe is supplied, but @wbraswell and I believe that it is necessary to have the option to supply a build recipe to create an SRPM with a proper %build section. |
|
Being able to supply a I definitely think that this discussion nails things down to 'do not generate an SRPM by default' :-D |
|
I hear you. I don’t think this change prevents any particular future changes, so I’m not sure it’s useful to treat this as an “either-or” scenario. This solution might not be what you want, but that doesn’t mean your problem can’t be solved in the future :)
As for “real srpm”, let’s have that discussion in a new issue? I’d like to gather more details on your use cases, workflows, and tools, and I’d like us to move away from the terms of “real” or “fake” as these are subjective and aren’t helping the discussion.
…On Fri, Nov 4, 2022, at 10:01 AM, William N. Braswell, Jr. wrote:
@trevor-vaughan <https://github.com/trevor-vaughan>
The fact that we will never be able to magically know what goes into `%build` is the very reason why the fpm-cookery project exists:
https://github.com/bernd/fpm-cookery/
This is a long-standing fpm issue that pre-dates this 2019 pull request.
The harm in accepting a fake SRPM solution is that it does not provide a real SRPM solution, as with fpm-cookery.
So again, unfortunately I must vote against merging this pull request at all. I'm really sorry, I know it is not fun to have somebody tell you that your code should not be merged. I can only point you back to the 2018 discussion which happened before this PR was made:
#237 (comment) <#237 (comment)>
—
Reply to this email directly, view it on GitHub <#1657 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABAF2WMVJX7FKQJAD22Y5LWGU6P7ANCNFSM4IHIIM6Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@jordansissel An SRPM with an empty |
|
Added flag |
|
I think we should be OK to merge this (#1952, which is this PR plus a few small changes). @wbraswell I don't think this change (here, or #1952) will negatively impact work on #1954. If anything, maybe it sets the stage that source packages are possible from fpm. |
artifacts by default
rpmbuild --rebuild <thing>.src.rpmapproachoutput, they simply don't have to use it.
Closes #237