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

Re: [RFC PATCH] gc --auto: don't lie about running in background on Windows

From
SZEDER Gábor <szeder@ira.uka.de>
Date
May 7, 2016, 14:44 UTC
Message-ID
<20160507164451.Horde.S4kJBIYRkpnmQt7tw82MHDH@webmail.informatik.kit.edu>
In-Reply-To
<xmqqbn4kcvuc.fsf@gitster.mtv.corp.google.com>
Quoting Junio C Hamano <gitster@pobox.com>:
Show 36 quoted lines
> SZEDER Gábor <szeder@ira.uka.de> writes:
>
>> Arguably this helper function could be just a simple variable.  I
>> opted for a function because:
>>
>>   - I preferred a single '#ifdef NO_POSIX_GOODIES', and putting a
>>     static variable so near to EOF felt just wrong.  (And this is why
>>     it's not an inline-able function defined in a header file.)
>>
>>   - currently we know already at compile time that Windows can't
>>     daemonize, but in the future we might want to extend this helper
>>     function to perform some runtime checks, too.  But this is perhaps
>>     like preparing for crossing a bridge where we'll never get to.
>
> Alternatively, the implementation of daemonize() and can_daemonize()
> can live in compat/ and have the #ifdef switch in git-compat-util.h,
> e.g. something along the lines of these:
>
> 	<< git-compat-util.h >>
> 	... after conditional inclusion of compat/mingw.h ...
> 	#ifndef can_daemonize
>         #define can_daemonize() 1
> 	#endif
>
> 	<< compat/mingw.h >>
> 	#define can_daemonize() 0
> 	#define daemonize() mingw_daemonize()
>
> 	<< setup.c >>
>         ...
>         #ifndef NO_POSIX_GOODIES
>         int daemonize(void)
>         {
>             ... no ifdef around here ...
> 	}
> 	#endif

config.mak.uname sets NO_POSIX_GOODIES only for Windows builds, but NO_POSIX_GOODIES doesn't sound Windows-specific at all. Currently if somebody were to decide to build with NO_POSIX_GOODIES=UnfortunatelyYes, then he would get a working git in the end, even on non-Windows platforms. With the proposed alternative above we would only provide an alternative daemonize() implementation for MINGW, breaking the build of those setting NO_POSIX_GOODIES by themselves.

I don't know whether there are platforms out there besides Windows that need the NO_POSIX_GOODIES treatment, but we don't explicitly support them in config.mak.uname, or people who for whatever reason build with this knob turned on.

Previous: Junio C Hamano
Message 9 of 9 in “t5510: run auto-gc in the foreground”
  1. t5510: run auto-gc in the foregroundSZEDER Gábor, May 1, 2016
  2. Johannes SchindelinMay 2, 2016
  3. SZEDER GáborMay 2, 2016
  4. SZEDER GáborMay 3, 2016
  5. Johannes SchindelinMay 4, 2016
  6. SZEDER GáborMay 5, 2016
  7. gc --auto: don't lie about running in background on WindowsSZEDER Gábor, May 5, 2016
  8. Junio C HamanoMay 5, 2016
  9. SZEDER GáborMay 7, 2016

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.