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

Re: should any build system legitimately change any tracked files?

From
Robin H. Johnson <robbat2@gentoo.org>
Date
Jan 19, 2018, 18:45 UTC
Message-ID
<robbat2-20180119T183103-843967451Z@orbis-terrarum.net>
In-Reply-To
<alpine.LFD.2.21.1801191247250.10222@localhost.localdomain>
On Fri, Jan 19, 2018 at 12:51:52PM -0500, Robert P. J. Day wrote:
Show 15 quoted lines
> 
>   just finished teaching a couple git courses and, after class, a
> student came up and described a rather weird problem -- in short:
> 
>   1) before build, "git diff" shows nothing
>   2) do the standard build
>   3) suddenly, "git diff" shows some changes
> 
> that's all the info i was given, but it *seems* clear that the build
> process itself was making changes to one or more tracked files.
> 
>   technically, i guess one can design a build system to do pretty
> much anything, but is it fair to say that this is a really poor design
> decision? admittedly, this isn't specifically a git question, but i'm
> open to opinions on something that strikes me as a bad idea.
I have seen what you describe, but it had a good cause:
1. The source repo contained some intermediate generated source, 
   eg foo.x -> foo.c -> foo.o
2. The output of the tool that did foo.a -> foo.c differed due to some
   factor on the system (different version, different config in /etc etc).
3. The initial checkout caused the mtime of foo.c to be just older
   newer than foo.x, so the build system decided to regen foo.c.
4. (optional) The makefile had conditional rules to skip the regen if the tool was
   not present.

Until the tool output changed, even if the file was regenerated, it was identical, so it didn't show up in diff.

What are the possible mistakes here?
- The intermediate source possibly should not be committed [depending on
  the tool, this isn't always an option]
- The build system scripts (makefile etc) contains a mistake.
- Some final (non-intermediate/non-source) file was committed.

I've seen similar patterns for GNU Bison, autoconf, and lots of other tools.

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
Previous: Theodore Ts'o
Message 4 of 4 in “should any build system legitimately change any tracked files?”
  1. Robert P. J. DayJan 19, 2018
  2. Randall S. BeckerJan 19, 2018
  3. Theodore Ts'oJan 19, 2018
  4. Robin H. JohnsonJan 19, 2018

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.