From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Nicolas Morey-Chaisemartin
<NMoreyChaisemartin-l3A5Bk7waGM@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH rdma-core 3/3] cbuild: use rpmspec for macro replacement
Date: Wed, 9 Aug 2017 09:55:32 -0600 [thread overview]
Message-ID: <20170809155532.GC15586@obsidianresearch.com> (raw)
In-Reply-To: <b3993b0c-0b9d-a917-cbf8-22f68c1d2a97-l3A5Bk7waGM@public.gmane.org>
On Wed, Aug 09, 2017 at 11:56:47AM +0200, Nicolas Morey-Chaisemartin wrote:
> >> def run_rpm_build(args,spec_file,env):
> >> version = get_version();
> >> - with open(spec_file,"r") as F:
> >> +
> >> + # Pre-process file with rpm spec to avoid manually replacing macros
> >> + f = open(spec_file + ".processed", "w");
> >> + subprocess.check_call(["rpmspec", "-P", spec_file], stdout=f);
> > This isn't going to work on any host system that does not have
> > rpmspec, including my Debian systems..
> Are you building RPM outside of docker on your Debian ?
No..
The issue is the above subprocess.check_call is run on the host, while
the call I added below inside go.py is run inside the container.
The host may not have rpmspec, while we guarentee that the container
does.
> I ran the pkg suite for all targets and they all work.
Your host has rpmspec :)
> > def run_rpm_build(args,spec_file,env):
> > - version = get_version();
> > with open(spec_file,"r") as F:
> > for ln in F:
> > - if ln.startswith("Version:"):
> > - ver = ln.strip().partition(' ')[2];
> > - assert(ver == get_version());
> > -
> You are losing this last check which seems important. It make sure the ti tag is in sync with the RPM
If you think it is important it can be left in..
> > if ln.startswith("Source:"):
> > tarfn = ln.strip().partition(' ')[2];
> > - tarfn = tarfn.replace("%{version}",version);
> >
> > image_id = get_image_id(args,env.image_name());
> > with private_tmp(args) as tmpdir:
> > @@ -426,7 +420,8 @@ def run_rpm_build(args,spec_file,env):
> > os.mkdir(os.path.join(tmpdir,"tmp"));
> >
> > subprocess.check_call(["git","archive",
> > - "--prefix","%s/"%(os.path.splitext(tarfn)[0]),
> > + # This must match the prefix generated buildlib/github-release
> > + "--prefix","%s-%s/"%(project,get_version()),
> > "--output",os.path.join(tmpdir,"SOURCES",tarfn),
> You have an issue here because tarfn is not set yet.
No, it was still set above, see the first hunk.
> I'm confused on why moving the call to rpmspec further down would solve your Debian issue ?
Further down the code is run in the container where rpmspec is
guarenteed to exist. Everything in cbuild is run on the host except
for the snippet in go.py
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-09 15:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 16:57 [PATCH rdma-core 0/3] cbuild tweaks Nicolas Morey-Chaisemartin
[not found] ` <27366048-d80f-3711-c6cd-93c87809650e-l3A5Bk7waGM@public.gmane.org>
2017-08-04 16:58 ` [PATCH rdma-core 1/3] cbuild: allow indentation in RPM version Nicolas Morey-Chaisemartin
2017-08-04 16:59 ` [PATCH rdma-core 2/3] cbuild: support .tar.(gz|bz|>...) extensions Nicolas Morey-Chaisemartin
2017-08-04 16:59 ` [PATCH rdma-core 3/3] cbuild: use rpmspec for macro replacement Nicolas Morey-Chaisemartin
[not found] ` <8ad0438f-b4a5-aec9-1e44-a9c9dc1ca17b-l3A5Bk7waGM@public.gmane.org>
2017-08-08 23:04 ` Jason Gunthorpe
[not found] ` <20170808230459.GF29372-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-09 9:56 ` Nicolas Morey-Chaisemartin
[not found] ` <b3993b0c-0b9d-a917-cbf8-22f68c1d2a97-l3A5Bk7waGM@public.gmane.org>
2017-08-09 15:55 ` Jason Gunthorpe [this message]
[not found] ` <20170809155532.GC15586-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-09 16:39 ` Nicolas Morey-Chaisemartin
[not found] ` <f42a6eaa-79f9-1063-b58a-08da363d09e7-l3A5Bk7waGM@public.gmane.org>
2017-08-09 20:19 ` Jason Gunthorpe
[not found] ` <20170809201932.GA7363-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-09 21:08 ` Nicolas Morey-Chaisemartin
[not found] ` <5c4de783-ce62-2b8d-78aa-ee2f181fe719-l3A5Bk7waGM@public.gmane.org>
2017-08-09 21:15 ` Jason Gunthorpe
[not found] ` <20170809211536.GA10191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-13 6:37 ` Leon Romanovsky
[not found] ` <20170813063706.GQ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-21 7:52 ` Nicolas Morey-Chaisemartin
[not found] ` <a17d1a6e-653a-0c8e-4b1b-d5ef2bf6d9b2-l3A5Bk7waGM@public.gmane.org>
2017-08-21 15:42 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170809155532.GC15586@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=NMoreyChaisemartin-l3A5Bk7waGM@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox