calibre does not build reproducibly

Bug #1687540 reported by Bernhard M. Wiedemann on 2017-05-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

similar to bug 1654211
I found non-deterministic build output
when working on reproducible builds for openSUSE.

Please apply the attached patch

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Eli Schwartz (eschwartz) wrote :

Sadly, this patch does not appear to have been tested by *anyone*
whatsoever before it was applied, as it does not in fact use sorted
lists, but rather sorted strings! Well, two sorted strings and one
sorted list, anyway.
(Sorted strings are bad news for hopefully obvious reasons.)

This completely breaks completion, with a long list of "bash: , u:
command not found" errors.
I only recently discovered this because I installed calibre in develop
mode and only just re-ran 'sudo python2 setup.py develop' which
regenerated my bash-completions... and I traced the error back to here.
For context, here is the diff between the completions file for calibre
v2.80 and calibre v2.85, and a patch to fix this properly.

It would be nice if people posting patches would actually test the
effect of their patches. ;)
Also, Kovid, please don't assume people have tested their stuff before
committing it. :(

...

I confess I am not sure why either one needs to be sorted at all, as the
one has nothing to sort, and the other is generated from lists defined
earlier in the same file (or from calibre.ebooks -> BOOK_EXTENSIONS
which is also a list)... and lists are guaranteed to preserve order, so
the only way this breaks reproducibility is if someone nefariously
modifies the list order in the source code, which doesn't actually count.
But whatever, sorting it anyway doesn't hurt anything.

On the other hand, this bugreport completely overlooks pics which is
defined as a set for some reason, and which can return a different sort
order. I've fixed that (and thrown in another free sorted() just in case).
It also overlooks the zsh completions, which I have not attempted to
make reproducible.

 status new

Changed in calibre:
status: Fix Released → New
Kovid Goyal (kovid) wrote :

I never apply patches without reviewing them. I just dont use bash and I forgot that when testing, so this one slipped through the cracks.

Kovid Goyal (kovid) wrote :

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released

A patch that applies specifically to bash should be tested in bash. :p
But yeah, this does make it somewhat obvious that you are a zsh user.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers