git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t/Makefile: Use $(sort ...) explicitly where needed

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2012, 07:14 UTC
Message-ID
<7vbopyhmlx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120120063450.GA15371@mini.zxlink>
Kirill Smelkov <kirr@navytux.spb.ru> writes:
Show 14 quoted lines
>> I do not necessarily buy your "so we HAVE TO, OR ELSE".
>> 
>> Even though I can understand "We can sort the list of tests _if_ we do not
>> want them executed in seemingly random order when running 'make -j1'", I
>> tend to think that *if* is a big one.  Aren't these tests designed not to
>> depend on each other anyway?
>
> Yes, they don't depend on each other, but what's the point in not
> sorting them? I usually watch test progress visually, and if tests are
> sorted, even with make -j4 they go more or less incrementally by their t
> number.
>
> On my netbook, adding $(sort ...) adds approximately 0.008s to make
> startup, so imho there is no performance penalty to adding that sort.
Heh, who said anything about performance?
I was pointing out that your justification "we HAVE TO" was wrong.

If you are doing this for perceived prettyness and not as a fix for any correctness issue, I want to see the patch honestly described as such; that's all.

By the way, if I recall correctly, $(sort) in GNU make not just sorts but as a nice side effect removes duplicates. So if we used a(n fictional) construct in our Makefile like this:

    T = $(wildcard *.sh a.*)

that might produce duplicates (i.e. "a.sh" might appear twice), which might leave us two identical pathnames in $T and cause us trouble. Even if we do not have such a use currently, rewriting $(wildcard) like your patch does using $(sort $(wildcard ...)) may be a good way to future-proof our Makefile, and if you justify your patch that way, it would be a possible correctness hardening, not just cosmetics, and phrasing it with "HAVE TO" may be justifiable.

Care to try if $(wildcard *.sh a.*) give you duplicated output with newer GNU make? I am lazy but am a bit curious ;-)

Previous: Kirill SmelkovNext: Kirill Smelkov
Message 4 of 6 in “t/Makefile: Use $(sort ...) explicitly where needed”
  1. t/Makefile: Use $(sort ...) explicitly where neededKirill Smelkov, Jan 19, 2012
  2. Junio C HamanoJan 19, 2012
  3. Kirill SmelkovJan 20, 2012
  4. Junio C HamanoJan 20, 2012
  5. Kirill SmelkovJan 20, 2012
  6. Kirill SmelkovJan 22, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.