Skip to content

Commit a2143b5

Browse files
committed
Fix build reproducibility for mk_cmds and compile_et
The mk_cmds and compile_et scripts include the build directory, which breaks the build reproducibility goal of Debian. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent f6acc12 commit a2143b5

14 files changed

+23
-45
lines changed

configure

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,6 @@ BUILD_CFLAGS
633633
MKINSTALLDIRS
634634
INCLUDES
635635
DO_TEST_SUITE
636-
ET_DIR
637-
SS_DIR
638636
LDFLAGS_STATIC
639637
root_sysconfdir
640638
root_libdir
@@ -13805,10 +13803,6 @@ $as_echo "#define _INTL_REDIRECT_MACROS 1" >>confdefs.h
1380513803

1380613804
;;
1380713805
esac
13808-
SS_DIR=`cd ${srcdir}/lib/ss; pwd`
13809-
ET_DIR=`cd ${srcdir}/lib/et; pwd`
13810-
13811-
1381213806
if test "$cross_compiling" = yes ; then
1381313807
DO_TEST_SUITE=
1381413808
else

configure.ac

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,13 +1400,6 @@ darwin*)
14001400
;;
14011401
esac
14021402
dnl
1403-
dnl Make the ss and et directories work correctly.
1404-
dnl
1405-
SS_DIR=`cd ${srcdir}/lib/ss; pwd`
1406-
ET_DIR=`cd ${srcdir}/lib/et; pwd`
1407-
AC_SUBST(SS_DIR)
1408-
AC_SUBST(ET_DIR)
1409-
dnl
14101403
dnl Only try to run the test suite if we're not cross compiling.
14111404
dnl
14121405
if test "$cross_compiling" = yes ; then

debugfs/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ INSTALL = @INSTALL@
1414
PROGS= debugfs
1515
MANPAGES= debugfs.8
1616

17-
MK_CMDS= _SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
17+
MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../lib/ss ../lib/ss/mk_cmds
1818

1919
DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
2020
lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \

e2fsck/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PROFILED_DEPLIBS= $(DEPPROFILED_LIBSUPPORT) $(PROFILED_LIBEXT2FS) \
3434
$(DEPPROFILED_LIBCOM_ERR) $(DEPPROFILED_LIBBLKID) \
3535
$(DEPPROFILED_LIBUUID) $(DEPPROFILED_LIBE2P)
3636

37-
COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
37+
COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../lib/et/et ../lib/et/compile_et
3838

3939
.c.o:
4040
$(E) " CC $<"

lib/et/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ uninstall::
140140
check:: compile_et
141141
for i in $(srcdir)/test_cases/*.et ; do \
142142
t=`basename $$i | sed -e 's/.et//'`; \
143-
./compile_et --build-tree $$i ; \
143+
_ET_DIR_OVERRIDE=$(srcdir) ./compile_et $$i ; \
144144
diff -c $(srcdir)/test_cases/$$t.c $$t.c > $$t.failed; \
145145
if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \
146146
diff -c $(srcdir)/test_cases/$$t.h $$t.h >> $$t.failed; \

lib/et/compile_et.sh.in

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
datarootdir=@datarootdir@
66
AWK=@AWK@
7-
DIR="${DIR-@datadir@/et}"
8-
ET_DIR="${ET_DIR-@ET_DIR@}"
7+
DIR=@datadir@/et
98

109
if test "$1" = "--build-tree" ; then
1110
shift;
@@ -29,13 +28,13 @@ do
2928
fi
3029
done
3130

31+
if test -n "$_ET_DIR_OVERRIDE" ; then
32+
DIR="$_ET_DIR_OVERRIDE";
33+
fi
34+
3235
if test ! -f "$DIR/et_h.awk" || test ! -f "$DIR/et_c.awk" ; then
33-
DIR="$ET_DIR"
34-
# echo "Falling back to $DIR..."
35-
if test ! -f "$DIR/et_h.awk" || test ! -f "$DIR/et_c.awk" ; then
36-
echo "compile_et: Couldn't find compile_et's template files."
37-
exit 1
38-
fi
36+
echo "compile_et: Couldn't find compile_et's template files."
37+
exit 1
3938
fi
4039

4140
ROOT=`echo $1 | sed -e s/.et$//`

lib/ext2fs/Makefile.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ DEBUGFS_CFLAGS = -I$(srcdir)/../../e2fsck $(ALL_CFLAGS) -DDEBUGFS
1313

1414
@DEBUGFS_CMT@DEBUGFS_LIB_OBJS = bb_compat.o inode_io.o write_bb_file.o
1515

16-
MK_CMDS= _SS_DIR_OVERRIDE=../ss ../ss/mk_cmds
16+
MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../ss ../ss/mk_cmds
17+
COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
1718

1819
@RESIZER_CMT@RESIZE_LIB_OBJS = dupfs.o
1920
@TEST_IO_CMT@TEST_IO_LIB_OBJS = test_io.o
@@ -254,8 +255,6 @@ all:: ext2fs.pc
254255
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $<
255256
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
256257

257-
COMPILE_ET=../et/compile_et --build-tree
258-
259258
DISTFILES= Makefile *.c *.h image
260259

261260
ext2_err.et: $(DEP_SUBSTITUTE) $(srcdir)/ext2_err.et.in

lib/ss/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ BSDLIB_MYDIR = ss
2828
BSDLIB_INSTALL_DIR = $(root_libdir)
2929

3030
TAGS=etags
31-
COMPILE_ET=../et/compile_et --build-tree
32-
MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
31+
MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir) ./mk_cmds
32+
COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
3333

3434
.c.o:
3535
$(E) " CC $<"

lib/ss/mk_cmds.sh.in

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#
44

55
datarootdir=@datarootdir@
6-
DIR="${DIR-@datadir@/ss}"
7-
SS_DIR="@SS_DIR@"
6+
DIR=@datadir@/ss
87
AWK=@AWK@
98
SED=@SED@
109

@@ -30,12 +29,8 @@ if test -n "$_SS_DIR_OVERRIDE" ; then
3029
fi
3130

3231
if test ! -f $DIR/ct_c.sed || test ! -f $DIR/ct_c.awk ; then
33-
DIR="$SS_DIR"
34-
# echo "Falling back to $DIR..."
35-
if test ! -f "$DIR/ct_c.sed" || test ! -f "$DIR/ct_c.awk" ; then
36-
echo "mk_cmds: Couldn't find mk_cmds's template files."
37-
exit 1
38-
fi
32+
echo "mk_cmds: Couldn't find mk_cmds's template files."
33+
exit 1
3934
fi
4035

4136
FILE="$1"

lib/support/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ LIBDIR= support
4141
@MAKEFILE_LIBRARY@
4242
@MAKEFILE_PROFILE@
4343

44-
COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
44+
COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
4545

4646
.c.o:
4747
$(E) " CC $<"

misc/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ STATIC_DEPLIBS= $(DEPLIBSUPPORT) $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
115115
LIBS_E2P= $(LIBE2P) $(LIBCOM_ERR)
116116
DEPLIBS_E2P= $(LIBE2P) $(DEPLIBCOM_ERR)
117117

118-
COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
118+
COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../lib/et/et ../lib/et/compile_et
119119

120120
# This nastyness is needed because of jfs_user.h hackery; when we finally
121121
# clean up this mess, we should be able to drop it

tests/progs/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ INSTALL = @INSTALL@
1111

1212
@MCONFIG@
1313

14-
MK_CMDS= _SS_DIR_OVERRIDE=../../lib/ss ../../lib/ss/mk_cmds
14+
MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../../lib/ss ../../lib/ss/mk_cmds
1515

1616
PROGS= test_icount crcsum
1717

util/gen-android-files

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \
1414
SS_DIR=$(pwd)/lib/ss
1515
MK_CMDS=/tmp/mk_cmds$$.sh
1616

17-
sed -e "s;@SS_DIR@;$SS_DIR;" < $SS_DIR/mk_cmds.sh.in \
18-
| sed -e "s/@AWK@/awk/" | sed -e "s/@SED@/sed/" > $MK_CMDS
17+
sed -e "s/@AWK@/awk/" < $SS_DIR/mk_cmds.sh.in \
18+
| sed -e "s/@SED@/sed/" > $MK_CMDS
1919

2020
sed -e "s/@E2FSPROGS_VERSION@/$(git describe)/" < lib/ext2fs/ext2_err.et.in > lib/ext2fs/ext2_err.et
2121

@@ -29,7 +29,7 @@ done
2929
for i in lib/ss/std_rqs debugfs/debug_cmds debugfs/ro_debug_cmds \
3030
debugfs/extent_cmds
3131
do
32-
/bin/sh $MK_CMDS $i.ct
32+
_SS_DIR_OVERRIDE=lib/ss /bin/sh $MK_CMDS $i.ct
3333
mv -f $(basename $i).c $i.c
3434
done
3535

util/subst.conf.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
AWK @AWK@
22
SED @SED@
3-
ET_DIR @ET_DIR@
4-
SS_DIR @SS_DIR@
53
E2FSPROGS_MONTH @E2FSPROGS_MONTH@
64
E2FSPROGS_YEAR @E2FSPROGS_YEAR@
75
E2FSPROGS_VERSION @E2FSPROGS_VERSION@

0 commit comments

Comments
 (0)