#2344 a bug in codegen causes diffs in generated code when switching branches
Closed: Fixed None Opened 5 years ago by jhrozek.

When branches are switched, the !InfoPipe generated code is re-generated and moved around. This causes annoying diffs for developers.


Do you have any particular reproducer? Can it be only an issue of a transition period before all our branches adapts recent codegen versions?

For me, switching branches is usually enough.

milestone: SSSD 1.12 beta 2 => SSSD 1.12.0

Fields changed

rhbz: => 0

Fields changed

milestone: SSSD 1.12.0 => SSSD 1.12.1

Fields changed

cc: => rmainz@redhat.com

Part of the problem is that git doesn't preserve timestamps for the files it stores (git doesn't seem to care about timestamps at all, not even for $ git diff #). So depending on the order the files are stored by a git clone in the current filesystem the files are rebuild or not. A rebase is likely causing the same problem.

Suggested fix:

  • Move the generated sources to objdir
  • Add SystemV/BSD .WAIT statement to Makefile to force a specific sequence during parallel build, e.g. foo: bar1 .WAIT bar2 to ensure that target bar1 is build before target bar2.
  • If .WAIT is not available use GNU syntax :| (see http://www.gnu.org/software/make/manual/make.html#Prerequisite-Types) with sufficient warning (and curse) that this is not even closely related to the term "portability".

Gross hack which doesn't work because it wants .deps/ dirs in src/:

diff --git a/Makefile.am b/Makefile.am
index 6707711..576c2d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -824,8 +824,12 @@ CODEGEN_CODE = \

 $(CODEGEN_CODE): $(SBUS_CODEGEN)

+CODEGEN_OBJS = $(CODEGEN_CODE:.c=.o)
+
 BUILT_SOURCES = $(CODEGEN_CODE)

+all-recursive: | $(CODEGEN_OBJS)
+
 ####################
 # Program Binaries #
 ####################

So the next step would be to move the generated sources to the build directory... but as said on IRC it worries me that it doesn't work properly with just a plain all-recursive: | $(CODEGEN_CODE) ... ;-(

Mass-moving all tickets that didn't make 1.12.1 into 1.12.2

milestone: SSSD 1.12.1 => SSSD 1.12.2

mark: => 0
milestone: SSSD 1.12.2 => SSSD 1.12.1

I'm sorry, I forgot to close this ticket. It's no longer an issue, closing..

resolution: => fixed
status: new => closed

Metadata Update from @jhrozek:
- Issue set to the milestone: SSSD 1.12.1

2 years ago

Login to comment on this ticket.

Metadata