In determining whether to compile a given .idl source file, build_idl.sh currently checks: a) that all build output files exist b) build output files are newer than their corresponding .idl source The .idl is rebuilt if either of the above conditions is false. This logic does not catch the case where the pidl compiler itself is changed. In such a case, an IDL rebuild should occur.
Proposed fix: http://git.samba.org/?p=ddiss/samba.git;a=commit;h=5badbf419cd21ee68583270ab6191d4a89ebf495 The following changes since commit 89e998412fe07a01f9c79330973f62d909dc2da2: waf: samba-specific methods should have capitalized names, change process_separate_rule to follow (2012-04-14 08:55:43 +0200) are available in the git repository at: git://git.samba.org/ddiss/samba.git bso8865_rebuild_idl_on_pidl_change David Disseldorp (1): build: rebuild idl if the pidl compiler is changed librpc/build_idl.sh | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) --- a/librpc/build_idl.sh +++ b/librpc/build_idl.sh @@ -15,16 +15,17 @@ cd ${srcdir} [ -d $PIDL_OUTPUTDIR ] || mkdir -p $PIDL_OUTPUTDIR || exit 1 -PIDL="$PIDL $ARGS" +PIDL_CMD="$PIDL $ARGS" if [ $FULL = 1 ]; then echo "Rebuilding all idl files" - $PIDL $IDL_FILES || exit 1 + $PIDL_CMD $IDL_FILES || exit 1 exit 0 fi ## -## Find newer files rather than rebuild all of them +## Find newer files rather than rebuild all of them. Also handle the case +## where the pidl compiler itself is newer. ## list="" @@ -42,6 +43,10 @@ for f in ${IDL_FILES}; do list="$list $f" break } + test "`find $PIDL -newer $PIDL_OUTPUTDIR/$o`" != "" && { + list="$list $f" + break + } done done @@ -50,8 +55,8 @@ done ## if [ "x$list" != x ]; then - # echo "${PIDL} ${list}" - $PIDL $list || exit 1 + # echo "${PIDL_CMD} ${list}" + $PIDL_CMD $list || exit 1 fi cd ${oldpwd}
You need to check every pidl source file, so everything from find pidl/ -type f
(In reply to comment #2) > You need to check every pidl source file, so everything from > > find pidl/ -type f Thanks Metze. This change adds the following: +PIDL_NEWEST=`find $PIDL_DIR -type f -printf "%p\0%T@\n" \ + | perl -e '$ts_newest = 0; + while (<STDIN>) { + ($f, $ts) = split(/\0/); + next if ($ts <= $ts_newest); + $ts_newest = $ts; + $f_newest = $f; + } + print $f_newest'` || exit 1 http://git.samba.org/?p=ddiss/samba.git;a=commit;h=34da6ffc24234a4f1078a50803d391c70ff31a8e The following changes since commit b23f5a9418e8acca035930e031c4624478a3d8a9: libcli/smb: make use of data_blob_string_const_null() (2012-04-16 12:21:17 +0200) are available in the git repository at: git://git.samba.org/ddiss/samba.git bso8865_rebuild_idl_on_pidl_change_rb1 David Disseldorp (1): build: rebuild idl if the pidl compiler is changed librpc/build_idl.sh | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-)
if it works, please push it to master
Created attachment 7456 [details] simple script to test pidl conditional rebuilds
Pushed to master with commit 8405fee41d93cb5a44690213c3086f3a4a275cb0. Marking resolved, please reopen if required for 3.6.