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

Re: [PATCH] meson: wire up USE_NSEC build knob

From
Jeff King <peff@peff.net>
Date
Jun 30, 2026, 05:43 UTC
Message-ID
<20260630054314.GD2495216@coredump.intra.peff.net>
In-Reply-To
<akIL6oJgUv8J8SB2@pks.im>
On Mon, Jun 29, 2026 at 08:08:42AM +0200, Patrick Steinhardt wrote:
Show 14 quoted lines
> > True, but AFAICT it probably is safe these days, at least one some
> > platforms.
> 
> Hm. That makes me wonder whether it is the completely wrong approach to
> make this a build option then. If it works on some systems and only on
> some filesystems, then a build option is just too coarse-grained. A
> distro wouldn't really be able to ever enable the option, unless it knew
> that repositories will only ever exist on a filesystem that works. Which
> I guess is an assumption that no distro can make.
> 
> So instead, I wonder whether we should treat this the same as for
> example "core.ignoreCase", where we only use nanosecond resolution when
> opted in by the user. Ideally, if we had a way to detect brokenness, we
> could even make git-init(1) set it automatically.

Yeah, this came up earlier in the thread. It would be nice if we could set it automatically, but I'm not sure we have a good way of testing a particular filesystem. I think the sequence is:

  1. stat() a file, getting nanoseconds
  2. somehow flush the kernel's in-core inode cache
  3. stat() it again and compare

Step 2 is the tricky part. ;) It's not only not portable, but probably something that would annoy users if we did it for every repo creation.

It would also be nice if we could actually verify that the sequence above _does_ show the problem. I was not able to come up with a failing instance on my modern Linux machine (even going as far as unmounting and re-mounting for step 2).

But I do agree in general that it should be a config flag and not a build option. Run-time flags are more friendly to users when there is no good reason to avoid them.

-Peff
Previous: Junio C HamanoNext: D. Ben Knoble
Message 12 of 19 in “meson: wire up USE_NSEC build knob”
  1. meson: wire up USE_NSEC build knobD. Ben Knoble, Jun 20, 2026
  2. Junio C HamanoJun 21, 2026
  3. D. Ben KnobleJun 21, 2026
  4. Patrick SteinhardtJun 22, 2026
  5. Jeff KingJun 21, 2026
  6. Patrick SteinhardtJun 22, 2026
  7. Jeff KingJun 28, 2026
  8. Jeff KingJun 28, 2026
  9. brian m. carlsonJun 29, 2026
  10. Patrick SteinhardtJun 29, 2026
  11. Junio C HamanoJun 29, 2026
  12. Jeff KingJun 30, 2026
  13. D. Ben KnobleJul 3, 2026
  14. D. Ben KnobleJul 3, 2026
  15. D. Ben KnobleJul 3, 2026
  16. Patrick SteinhardtJul 6, 2026
  17. Jeff KingJul 7, 2026
  18. Junio C HamanoJul 11, 2026
  19. Ben KnobleJul 13, 2026

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.