Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2487)

Issue 555220043: lilypond-book: Rewrite processing of snippets (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 2 months ago by hahnjo
Modified:
4 years, 2 months ago
Reviewers:
Dan Eble, hanwenn
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

lilypond-book: Rewrite processing of snippets The previous version relied on a stable hash() method, both for the ordering in a set() and for the list's checksum. This probably worked with Python 2 and up to Python 3.2, but later versions use a random seed for invocations of hash(). This ensures different hash values for subsequent invocations to make malicious attacks more difficult. The new code uses hashlib.md5() and .hexdigest() instead which returns a deterministic result across runs. It also sorts the snippets' names which leads to more stable profiling results for 'make check'. This change also tries to improve performance by writing snippets with the same basename only once. Additionally it solves potential problems if the build directory has the string '.ly' in its path.

Patch Set 1 #

Total comments: 9

Patch Set 2 : Address comments & revert temporary workaround in master #

Patch Set 3 : snippet-names-*.ly -> .txt #

Patch Set 4 : Revert change to .txt #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -39 lines) Patch
M scripts/lilypond-book.py View 1 3 3 chunks +50 lines, -35 lines 0 comments Download
M stepmake/stepmake/generic-vars.make View 1 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 10
Dan Eble
LGTM, but I'm no guru. https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py File scripts/lilypond-book.py (right): https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py#newcode432 scripts/lilypond-book.py:432: snippet_names_file = 'snippet-names-%s.ly' % ...
4 years, 2 months ago (2020-02-01 16:54:40 UTC) #1
hanwenn
LGTM (didn't look very closely though) https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py File scripts/lilypond-book.py (left): https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py#oldcode426 scripts/lilypond-book.py:426: return hash (' ...
4 years, 2 months ago (2020-02-01 17:13:02 UTC) #2
hahnjo
Address comments & revert temporary workaround in master
4 years, 2 months ago (2020-02-02 09:52:23 UTC) #3
hahnjo
https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py File scripts/lilypond-book.py (right): https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py#newcode409 scripts/lilypond-book.py:409: checksum = hashlib.md5 () On 2020/02/01 17:13:02, hanwenn wrote: ...
4 years, 2 months ago (2020-02-02 09:52:37 UTC) #4
Dan Eble
On 2020/02/02 09:52:37, hahnjo wrote: > https://codereview.appspot.com/555220043/diff/553480046/scripts/lilypond-book.py#newcode432 > scripts/lilypond-book.py:432: snippet_names_file = 'snippet-names-%s.ly' % > checksum ...
4 years, 2 months ago (2020-02-02 13:21:58 UTC) #5
hahnjo
On 2020/02/02 13:21:58, Dan Eble wrote: > On 2020/02/02 09:52:37, hahnjo wrote: > > > ...
4 years, 2 months ago (2020-02-02 13:26:04 UTC) #6
hahnjo
snippet-names-*.ly -> .txt
4 years, 2 months ago (2020-02-02 15:24:33 UTC) #7
hahnjo
Revert change to .txt
4 years, 2 months ago (2020-02-02 15:28:25 UTC) #8
hahnjo
On 2020/02/02 13:26:04, hahnjo wrote: > On 2020/02/02 13:21:58, Dan Eble wrote: > > On ...
4 years, 2 months ago (2020-02-02 15:33:05 UTC) #9
Dan Eble
4 years, 2 months ago (2020-02-02 18:00:20 UTC) #10
On 2020/02/02 15:33:05, hahnjo wrote:
> > > I'd probably have chosen txt.
> > 
> > Ok, will do.
> 
> Meh: I did the change and it works, but subprocess_system in python/lilylib.py
> will still output the .ly name. As this file doesn't exist anymore, it will
just
> make investigations in case of an error more difficult. I propose to table
that
> change for now, ok?

Not a problem.  Kudos for trying it.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b