Skip to content
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

RFE: rpmbuild -br --i-really-want-src-rpm #760

Closed
ignatenkobrain opened this issue Jun 20, 2019 · 7 comments · Fixed by #766
Closed

RFE: rpmbuild -br --i-really-want-src-rpm #760

ignatenkobrain opened this issue Jun 20, 2019 · 7 comments · Fixed by #766
Assignees
Milestone

Comments

@ignatenkobrain
Copy link
Contributor

I have some scripts which operate on packages to generate their (build)dependency tree for Fedora Modularity stuff. It relies on normal binary and source RPMs for dependency information. However, with dynamic BuildRequires, I need a way to rebuild sourcerpms with some macros defined. And I found out that there is no way to get src.rpm with dynamic buildrequires without installing them.

So I had to do something like

diff --git a/build/build.c b/build/build.c
index dec7d9608..c1f28b8f5 100644
--- a/build/build.c
+++ b/build/build.c
@@ -213,10 +213,12 @@ static int doBuildRequires(rpmSpec spec, int test)
        *packageDependencies(spec->sourcePackage, RPMTAG_REQUIRENAME),
        spec->sourcePackage->header);
 
+#if 0
     parseRCPOT(spec, spec->sourcePackage,
               "rpmlib(DynamicBuildRequires) = 4.15.0-1",
               RPMTAG_PROVIDENAME, 0, RPMSENSE_FIND_PROVIDES | RPMSENSE_RPMLIB,
               addReqProvPkg, NULL);
+#endif
     rc = RPMRC_MISSINGBUILDREQUIRES;
 
  exit:
@@ -305,6 +307,8 @@ static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
                (rc == RPMRC_MISSINGBUILDREQUIRES))
            rc = doCheckBuildRequires(ts, spec, test);
        if (rc == RPMRC_MISSINGBUILDREQUIRES) {
+           rc = RPMRC_OK;
+#if 0
            if (what & RPMBUILD_DUMPBUILDREQUIRES) {
                /* Create buildreqs package */
                char *nvr = headerGetAsString(spec->packages->header, RPMTAG_NVR);
@@ -318,6 +322,7 @@ static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
            } else {
                rc = RPMRC_OK;
            }
+#endif
        } else if (rc) {
            goto exit;
        }

and use rpmbuild -rr -D "_module_build 1" --nodeps /path/to/srpm and it does what I need.

So what I want is to say "I am expert, I know src.rpm will have all dynamic dependencies, just give me src.rpm and not buildreqs.nosrc.rpm.".

@ignatenkobrain
Copy link
Contributor Author

I had conversation yesterday with @ffesti over IRC about this and we need to add something like --noverifydeps.

I'll send PR this week.

@ignatenkobrain ignatenkobrain self-assigned this Jun 25, 2019
@ignatenkobrain ignatenkobrain added this to the 4.15.0 milestone Jun 25, 2019
@pmatilai
Copy link
Member

What's wrong with --nodeps, which we already have?
If it's not suitable for whatever reason, you'll need to come up with something better than --noverifydeps as the name.

@ignatenkobrain
Copy link
Contributor Author

@pmatilai -br --nodeps generates buildreqs.nosrc.rpm which indicates that there are some generated deps, but list might be incomplete. But in some cases when you know what you are doing, you want to tell RPM, I have all dependencies, neither I want you to check it and I really want src.rpm, not buildreqs.nosrc.rpm. Changing behavior of --nodeps is bad, because that would mean, there is no way to generate buildreqs.nosrc.rpm for mock for example.

@pmatilai
Copy link
Member

I'm not fond of these --do-foo-except-in-this-one-special-case-do-bar style options, they rarely make sense in the big picture.
One possibility might be reusing --force for the purpose. It's wired to something else but maybe it could be special-cased in combination of -br --nodeps. Or if that isn't feasible, I'd rather have --force-srpm or such which might be applicable to more cases than just this.

@ignatenkobrain
Copy link
Contributor Author

@pmatilai true, Ithink --force would make sense for this.

@pmatilai
Copy link
Member

Yeah, --force as a cli-switch makes sense for the case, it's just the existing API-side wiring to RPMSPEC_FORCE that has other side-effects which you'd not want for this case, so whether it's reasonably straightforward or even possible to use it for this purpose is another question.

@ignatenkobrain
Copy link
Contributor Author

I think using RPMSPEC_FORCE is fine for this case because normally people would not do it. Only if they know what they are doing.

ignatenkobrain added a commit to ignatenkobrain/rpm that referenced this issue Jun 26, 2019
Closes: rpm-software-management#760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
ignatenkobrain added a commit to ignatenkobrain/rpm that referenced this issue Jun 26, 2019
Closes: rpm-software-management#760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
ignatenkobrain added a commit to ignatenkobrain/rpm that referenced this issue Jun 26, 2019
There is no way to get src.rpm with dynamic BuildRequires without
checking dependencies on the system. --nodeps always forces rpmbuild to
write buildreqs.nosrc.rpm, but in some cases it might be desired to get
src.rpm with dynamic BRs but without checking for dependencies.

Closes: rpm-software-management#760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
ffesti pushed a commit that referenced this issue Jul 2, 2019
There is no way to get src.rpm with dynamic BuildRequires without
checking dependencies on the system. --nodeps always forces rpmbuild to
write buildreqs.nosrc.rpm, but in some cases it might be desired to get
src.rpm with dynamic BRs but without checking for dependencies.

Closes: #760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
pmatilai pushed a commit to pmatilai/rpm that referenced this issue Aug 23, 2019
There is no way to get src.rpm with dynamic BuildRequires without
checking dependencies on the system. --nodeps always forces rpmbuild to
write buildreqs.nosrc.rpm, but in some cases it might be desired to get
src.rpm with dynamic BRs but without checking for dependencies.

Closes: rpm-software-management#760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
(cherry picked from commit e672ec2)
pmatilai pushed a commit that referenced this issue Aug 28, 2019
There is no way to get src.rpm with dynamic BuildRequires without
checking dependencies on the system. --nodeps always forces rpmbuild to
write buildreqs.nosrc.rpm, but in some cases it might be desired to get
src.rpm with dynamic BRs but without checking for dependencies.

Closes: #760
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
(cherry picked from commit e672ec2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants