Closed
Bug 672655
Opened 14 years ago
Closed 14 years ago
Move to a single version number for packaging
Categories
(Cloud Services :: Server: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: telliott, Assigned: tarek)
References
Details
Attachments
(3 files, 2 obsolete files)
1.18 KB,
patch
|
telliott
:
review+
rmiller
:
review+
|
Details | Diff | Splinter Review |
2.67 KB,
patch
|
tarek
:
review+
|
Details | Diff | Splinter Review |
2.13 KB,
patch
|
tarek
:
review+
|
Details | Diff | Splinter Review |
At present, between foo.spec and setup.py, we define the current version in 4 separate places. This leads to human errors where we tag an rpm, then discover that we missed one and have to reversion and retag.
A central location for this value would save us every once in a while.
Assignee | ||
Comment 1•14 years ago
|
||
Let's agree on this convention, and propagate this snippet in all projects
Assignee: nobody → tarek
Status: NEW → ASSIGNED
Attachment #548969 -
Flags: review?(telliott)
Attachment #548969 -
Flags: review?(rmiller)
Comment 2•14 years ago
|
||
Comment on attachment 548969 [details] [diff] [review]
Extracts the version from the spec file
Review of attachment 548969 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #548969 -
Flags: review?(rmiller) → review+
Reporter | ||
Comment 3•14 years ago
|
||
Comment on attachment 548969 [details] [diff] [review]
Extracts the version from the spec file
I agree that's the best place. This looks good.
Attachment #548969 -
Flags: review?(telliott) → review+
Assignee | ||
Comment 4•14 years ago
|
||
done for core in http://hg.mozilla.org/services/server-core/rev/e7b6170e5b22
can we split the work for the propagation if you don't mind ?
=> Rob: server-sreg
=> Toby: account-portal, server-reg
=> Tarek: server-storage
also in the spec file: don't forget to do the %define unmangled_version %{version}
Assignee | ||
Comment 5•14 years ago
|
||
A good check is to try:
$ python setup.py --version
You should get the right version
Assignee | ||
Comment 6•14 years ago
|
||
done in storage: http://hg.mozilla.org/services/server-storage/rev/3b48b6008597
Assignee | ||
Comment 7•14 years ago
|
||
I removed unmangled in storage' spec
Reporter | ||
Comment 8•14 years ago
|
||
Here's the account-portal one. The main gotcha is to remember to change the name of the spec file in setup.py
Attachment #548994 -
Flags: review?(tarek)
Assignee | ||
Comment 9•14 years ago
|
||
Comment on attachment 548994 [details] [diff] [review]
single version number for a-p
Review of attachment 548994 [details] [diff] [review]:
-----------------------------------------------------------------
I don't see any good reason to change this line:
BuildRoot: %{_tmppath}/%{pythonname}-%{version}-%{release}-buildroot
You should define %pythonname and keep it in the BuildRoot, like what we did in other projects.
And reuse it for Source0 definition.
See http://hg.mozilla.org/services/server-sreg/file/f601c21bbfc9/SyncSReg.spec#l1 for an example
(I am wondering how come it worked before since I don't see it defined at all right now)
Attachment #548994 -
Flags: review?(tarek) → review-
Reporter | ||
Comment 10•14 years ago
|
||
Yeah, I was wondering how it worked myself, given that it clearly has been. I guess it's Accountportal
Reporter | ||
Comment 11•14 years ago
|
||
Attachment #548994 -
Attachment is obsolete: true
Attachment #549172 -
Flags: review?(tarek)
Assignee | ||
Updated•14 years ago
|
Attachment #549172 -
Flags: review?(tarek) → review+
Reporter | ||
Comment 12•14 years ago
|
||
Account portal done in http://hg.mozilla.org/services/account-portal/rev/6ce0f732f5d2
Reporter | ||
Comment 13•14 years ago
|
||
reg is pretty clean. Just needs the setup.py changes, mostly
Attachment #549183 -
Flags: review?(tarek)
Reporter | ||
Comment 14•14 years ago
|
||
Hmm, tried to implement this and actually build RPMs in node assignment, and it failed.
The problem is that the build is actually done in build/bdist.macosx-10.6-x86_64/rpm/BUILD/Nodes-1.0 Setup.py has been moved there, but it fails because it can't find the spec file in there when it tries os.path.dirname(__file__).
Am I missing something?
Assignee | ||
Comment 15•14 years ago
|
||
Ah interesting:
make: *** [build_rpms] Error 1
tarek@tarek-laptop:~/dev/hg.mozilla.org/account-portal$ bin/python setup.py --command-packages=pypi2rpm.command bdist_rpm2 --spec-file=AccountPortal.spec --dist-dir=/home/tarek/dev/hg.mozilla.org/account-portal/rpms
Traceback (most recent call last):
File "setup.py", line 49, in <module>
with open(spec) as f:
IOError: [Errno 2] No such file or directory: 'Accountportal.spec'
Noticed the difference in the cases (AccountPortal vs Accountportal)
digging
Assignee | ||
Comment 16•14 years ago
|
||
Found the issue. It's a typo in your setup.py:
http://hg.mozilla.org/services/account-portal/file/6ce0f732f5d2/setup.py#l48
Reporter | ||
Comment 17•14 years ago
|
||
Oh irony. We've replaced build mismatches with product name mismatches.
Fortunately, we only have to get that right once. Fixed.
Assignee | ||
Comment 18•14 years ago
|
||
Comment on attachment 549183 [details] [diff] [review]
Central versioning for reg
Looks good.
One possible improvment: remove unmangled_version in the Spec file.
%define version 0.5
%define unmangled_version 0.5 <=== can be removed
Attachment #549183 -
Flags: review?(tarek) → review+
Reporter | ||
Comment 19•14 years ago
|
||
(In reply to comment #18)
> Comment on attachment 549183 [details] [diff] [review] [diff] [details] [review]
> Central versioning for reg
>
> Looks good.
>
> One possible improvment: remove unmangled_version in the Spec file.
>
> %define version 0.5
> %define unmangled_version 0.5 <=== can be removed
Hmm, I thought we shouldn't remove that one. Presumably we'll need to update
Source0: %{pythonname}-%{unmangled_version}.tar.gz
as well?
Assignee | ||
Comment 20•14 years ago
|
||
We ended up saying that unmangled_version was unecessary and its definition could be removed + its usage replaced everywhere by version to make the spec file simpler. But it works with it so no worries if it stays.
Reporter | ||
Comment 21•14 years ago
|
||
Oh, ok, good. I must have misremembered. Unmangled-free version attached.
Attachment #549183 -
Attachment is obsolete: true
Attachment #549813 -
Flags: review?(tarek)
Assignee | ||
Comment 22•14 years ago
|
||
Comment on attachment 549813 [details] [diff] [review]
Central versioning for reg
LGTM
I've tried it with:
$ python setup.py --version
0.5
$ make build build_rpms
** output ok **
Attachment #549813 -
Flags: review?(tarek) → review+
Assignee | ||
Comment 23•14 years ago
|
||
reg done by Toby in https://hg.mozilla.org/services/server-reg/rev/a3f2c420be09
I believe we're done here
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•