From d98a67a53a180bd88ec8d9aeea75d92e1c9968b5 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 26 May 2022 09:24:50 -0700 Subject: [PATCH] Replace EXTRA_DIST with dist_noinst_DATA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EXTRA_DIST variable is ignored when used in the FALSE conditional of a Makefile.am. This results in the `make dist` target omitting these files from the generated tarball unless CONFIG_USER is defined. This issue can be avoided by switching to use the dist_noinst_DATA variable which is handled as expected by autoconf. This change also adds support for --with-config=dist as an alias for --with-config=srpm and updates the GitHub workflows to use it. Reviewed-by: Ahelenia ZiemiaƄska Signed-off-by: Brian Behlendorf Closes #13459 Closes #13505 --- .github/workflows/zfs-tests-functional.yml | 2 +- .github/workflows/zfs-tests-sanity.yml | 2 +- .github/workflows/zloop.yml | 2 +- Makefile.am | 38 +++++++++++----------- cmd/Makefile.am | 8 ++--- cmd/zed/Makefile.am | 2 +- cmd/zed/zed.d/Makefile.am | 2 +- cmd/zpool/Makefile.am | 2 +- config/Substfiles.am | 2 +- config/zfs-build.m4 | 1 + contrib/bpftrace/Makefile.am | 4 +-- contrib/dracut/Makefile.am | 2 +- contrib/initramfs/Makefile.am | 2 +- contrib/pyzfs/Makefile.am | 2 +- contrib/zcp/Makefile.am | 2 +- etc/Makefile.am | 4 +-- lib/libnvpair/Makefile.am | 2 +- lib/libuutil/Makefile.am | 2 +- lib/libzfs/Makefile.am | 4 +-- lib/libzfs_core/Makefile.am | 2 +- lib/libzfsbootenv/Makefile.am | 2 +- man/Makefile.am | 5 +-- rpm/Makefile.am | 2 +- scripts/Makefile.am | 9 +++-- tests/Makefile.am | 2 +- tests/zfs-tests/cmd/Makefile.am | 4 +-- tests/zfs-tests/tests/Makefile.am | 2 +- 27 files changed, 56 insertions(+), 57 deletions(-) diff --git a/.github/workflows/zfs-tests-functional.yml b/.github/workflows/zfs-tests-functional.yml index 0273610af0..328cb97f10 100644 --- a/.github/workflows/zfs-tests-functional.yml +++ b/.github/workflows/zfs-tests-functional.yml @@ -28,7 +28,7 @@ jobs: ./autogen.sh - name: Configure run: | - ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan + ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan --with-config=dist - name: Make run: | make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod diff --git a/.github/workflows/zfs-tests-sanity.yml b/.github/workflows/zfs-tests-sanity.yml index 73606f909e..4c15cecf58 100644 --- a/.github/workflows/zfs-tests-sanity.yml +++ b/.github/workflows/zfs-tests-sanity.yml @@ -24,7 +24,7 @@ jobs: ./autogen.sh - name: Configure run: | - ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan + ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan --with-config=dist - name: Make run: | make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod diff --git a/.github/workflows/zloop.yml b/.github/workflows/zloop.yml index d49eeae165..64fe96a3ab 100644 --- a/.github/workflows/zloop.yml +++ b/.github/workflows/zloop.yml @@ -23,7 +23,7 @@ jobs: ./autogen.sh - name: Configure run: | - ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan + ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan --with-config=dist - name: Make run: | make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod diff --git a/Makefile.am b/Makefile.am index 0a73a63870..54d300e7d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ CLEANFILES = -EXTRA_DIST = +dist_noinst_DATA = INSTALL_DATA_HOOKS = ALL_LOCAL = CLEAN_LOCAL = @@ -37,26 +37,26 @@ extradir = $(prefix)/src/zfs-$(VERSION) extra_HEADERS = zfs.release.in zfs_config.h.in endif -EXTRA_DIST += autogen.sh copy-builtin -EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE -EXTRA_DIST += README.md RELEASES.md -EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md +dist_noinst_DATA += autogen.sh copy-builtin +dist_noinst_DATA += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE +dist_noinst_DATA += README.md RELEASES.md +dist_noinst_DATA += module/lua/README.zfs module/os/linux/spl/README.md # Include all the extra licensing information for modules -EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE -EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip -EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman -EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip -EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl -EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip -EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams -EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip -EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl -EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip -EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2 -EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip -EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash -EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip +dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE +dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE.descrip +dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman +dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip +dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl +dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip +dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams +dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip +dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl +dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip +dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2 +dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip +dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash +dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash.descrip @CODE_COVERAGE_RULES@ diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 9959760b52..65de980da3 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -10,7 +10,7 @@ mounthelper_PROGRAMS = sbin_SCRIPTS += fsck.zfs SHELLCHECKSCRIPTS += fsck.zfs CLEANFILES += fsck.zfs -EXTRA_DIST += %D%/fsck.zfs.in +dist_noinst_DATA += %D%/fsck.zfs.in $(call SUBST,fsck.zfs,%D%/) @@ -100,9 +100,9 @@ endif if USING_PYTHON -bin_SCRIPTS += arc_summary arcstat dbufstat -CLEANFILES += arc_summary arcstat dbufstat -EXTRA_DIST += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in +bin_SCRIPTS += arc_summary arcstat dbufstat +CLEANFILES += arc_summary arcstat dbufstat +dist_noinst_DATA += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in $(call SUBST,arcstat,%D%/) $(call SUBST,dbufstat,%D%/) diff --git a/cmd/zed/Makefile.am b/cmd/zed/Makefile.am index 6eea1a135f..c437ff51dd 100644 --- a/cmd/zed/Makefile.am +++ b/cmd/zed/Makefile.am @@ -43,4 +43,4 @@ zed_LDADD = \ zed_LDADD += -lrt $(LIBATOMIC_LIBS) $(LIBUDEV_LIBS) $(LIBUUID_LIBS) zed_LDFLAGS = -pthread -EXTRA_DIST += $(addprefix %D%/,agents/README.md) +dist_noinst_DATA += %D%/agents/README.md diff --git a/cmd/zed/zed.d/Makefile.am b/cmd/zed/zed.d/Makefile.am index 122d2c0c51..c65b43fb02 100644 --- a/cmd/zed/zed.d/Makefile.am +++ b/cmd/zed/zed.d/Makefile.am @@ -38,7 +38,7 @@ zedconfdefaults = \ vdev_attach-led.sh \ vdev_clear-led.sh -EXTRA_DIST += $(addprefix %D%/,README) +dist_noinst_DATA += %D%/README INSTALL_DATA_HOOKS += zed-install-data-hook zed-install-data-hook: diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am index 9ba72eadf3..3c7c8a9aeb 100644 --- a/cmd/zpool/Makefile.am +++ b/cmd/zpool/Makefile.am @@ -38,7 +38,7 @@ zpool_LDADD += -lgeom endif zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS) -EXTRA_DIST += $(addprefix %D%/,zpool.d/README compatibility.d) +dist_noinst_DATA += %D%/zpool.d/README SHELLCHECKSCRIPTS += $(dist_zpoolexec_SCRIPTS) zpoolexecdir = $(zfsexecdir)/zpool.d diff --git a/config/Substfiles.am b/config/Substfiles.am index 733073dd20..38e870b2f5 100644 --- a/config/Substfiles.am +++ b/config/Substfiles.am @@ -41,6 +41,6 @@ endef SUBSTFILES = CLEANFILES += $(SUBSTFILES) -EXTRA_DIST += $(SUBSTFILES:=.in) +dist_noinst_DATA += $(SUBSTFILES:=.in) $(call SUBST,%,) diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index 582c479f5b..b40776da7a 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -268,6 +268,7 @@ AC_DEFUN([ZFS_AC_CONFIG], [ user) ZFS_AC_CONFIG_USER ;; all) ZFS_AC_CONFIG_USER ZFS_AC_CONFIG_KERNEL ;; + dist) ;; srpm) ;; *) AC_MSG_RESULT([Error!]) diff --git a/contrib/bpftrace/Makefile.am b/contrib/bpftrace/Makefile.am index 5382f1e1de..4f649cf543 100644 --- a/contrib/bpftrace/Makefile.am +++ b/contrib/bpftrace/Makefile.am @@ -1,5 +1,3 @@ -EXTRA_DIST += $(addprefix %D%/, \ - taskqlatency.bt \ - zfs-trace.sh) +dist_noinst_DATA += %D%/taskqlatency.bt %D%/zfs-trace.sh SHELLCHECKSCRIPTS += %D%/zfs-trace.sh diff --git a/contrib/dracut/Makefile.am b/contrib/dracut/Makefile.am index f0c103b0a4..73ca52b663 100644 --- a/contrib/dracut/Makefile.am +++ b/contrib/dracut/Makefile.am @@ -24,4 +24,4 @@ SHELLCHECKSCRIPTS += $(pkgdracut_02_SCRIPTS) $(pkgdracut_90_SCRIPTS) # Provided by /bin/sleep, and, again, every implementation of that supports this $(call SHELLCHECK_OPTS,$(pkgdracut_90_SCRIPTS)): CHECKBASHISMS_IGNORE = -e 'sleep only takes one integer' -e 'sleep 0.' -EXTRA_DIST += $(addprefix %D%/,README.md) +dist_noinst_DATA += %D%/README.md diff --git a/contrib/initramfs/Makefile.am b/contrib/initramfs/Makefile.am index 6917b517f3..a583341ea2 100644 --- a/contrib/initramfs/Makefile.am +++ b/contrib/initramfs/Makefile.am @@ -36,4 +36,4 @@ SHELLCHECKSCRIPTS += $(i_t_check_scripts) $(call SHELLCHECK_OPTS,$(i_t_check_scripts)): SHELLCHECK_SHELL = sh -EXTRA_DIST += $(addprefix %D%/,README.md) +dist_noinst_DATA += %D%/README.md diff --git a/contrib/pyzfs/Makefile.am b/contrib/pyzfs/Makefile.am index 505cd3c8b3..06d9a09d7f 100644 --- a/contrib/pyzfs/Makefile.am +++ b/contrib/pyzfs/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST += $(addprefix %D%/,libzfs_core README LICENSE docs) +dist_noinst_DATA += %D%/libzfs_core %D%/README %D%/LICENSE %D%/docs SUBSTFILES += %D%/setup.py if PYZFS_ENABLED diff --git a/contrib/zcp/Makefile.am b/contrib/zcp/Makefile.am index 759a9d529d..fc3f01a233 100644 --- a/contrib/zcp/Makefile.am +++ b/contrib/zcp/Makefile.am @@ -1 +1 @@ -EXTRA_DIST += $(addprefix %D%/,autosnap.lua) +dist_noinst_DATA += %D%/autosnap.lua diff --git a/etc/Makefile.am b/etc/Makefile.am index a41f04c904..53064eb6f6 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -2,7 +2,7 @@ sudoersddir = $(sysconfdir)/sudoers.d sudoersd_DATA = \ %D%/sudoers.d/zfs -EXTRA_DIST += $(sudoersd_DATA) +dist_noinst_DATA += $(sudoersd_DATA) sysconf_zfsdir = $(sysconfdir)/zfs @@ -32,7 +32,7 @@ $(call SHELLCHECK_OPTS,$(initconf_DATA)): SHELLCHECK_SHELL = sh if INIT_SYSV -EXTRA_DIST += $(addprefix %D%/,init.d/README.md) +dist_noinst_DATA += %D%/init.d/README.md init_SCRIPTS = \ %D%/init.d/zfs-import \ diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am index 6d9345f528..87b8d32aa1 100644 --- a/lib/libnvpair/Makefile.am +++ b/lib/libnvpair/Makefile.am @@ -32,4 +32,4 @@ endif libnvpair_la_LDFLAGS += -version-info 3:0:0 -EXTRA_DIST += $(addprefix %D%/,libnvpair.abi libnvpair.suppr) +dist_noinst_DATA += %D%/libnvpair.abi %D%/libnvpair.suppr diff --git a/lib/libuutil/Makefile.am b/lib/libuutil/Makefile.am index cb89d423dc..339f9a0647 100644 --- a/lib/libuutil/Makefile.am +++ b/lib/libuutil/Makefile.am @@ -26,4 +26,4 @@ endif libuutil_la_LDFLAGS += -version-info 3:0:0 -EXTRA_DIST += $(addprefix %D%/,libuutil.abi libuutil.suppr) +dist_noinst_DATA += %D%/libuutil.abi %D%/libuutil.suppr diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 07414c4a30..f5eb846792 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -76,5 +76,5 @@ libzfs_la_LDFLAGS += -version-info 5:0:1 pkgconfig_DATA += %D%/libzfs.pc -EXTRA_DIST += $(addprefix %D%/,libzfs.abi libzfs.suppr) -EXTRA_DIST += $(addprefix %D%/,THIRDPARTYLICENSE.openssl THIRDPARTYLICENSE.openssl.descrip) +dist_noinst_DATA += %D%/libzfs.abi %D%/libzfs.suppr +dist_noinst_DATA += %D%/THIRDPARTYLICENSE.openssl %D%/THIRDPARTYLICENSE.openssl.descrip diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am index 9370da4e3e..d1c6fb86d1 100644 --- a/lib/libzfs_core/Makefile.am +++ b/lib/libzfs_core/Makefile.am @@ -43,4 +43,4 @@ libzfs_core_la_LDFLAGS += -version-info 3:0:0 pkgconfig_DATA += %D%/libzfs_core.pc -EXTRA_DIST += $(addprefix %D%/,libzfs_core.abi libzfs_core.suppr) +dist_noinst_DATA += %D%/libzfs_core.abi %D%/libzfs_core.suppr diff --git a/lib/libzfsbootenv/Makefile.am b/lib/libzfsbootenv/Makefile.am index 7b87bfe678..118f154821 100644 --- a/lib/libzfsbootenv/Makefile.am +++ b/lib/libzfsbootenv/Makefile.am @@ -26,4 +26,4 @@ libzfsbootenv_la_LDFLAGS += -version-info 1:0:0 pkgconfig_DATA += %D%/libzfsbootenv.pc -EXTRA_DIST += $(addprefix %D%/,libzfsbootenv.abi libzfsbootenv.suppr) +dist_noinst_DATA += %D%/libzfsbootenv.abi %D%/libzfsbootenv.suppr diff --git a/man/Makefile.am b/man/Makefile.am index 362ee9b7e1..8fa21d2fd2 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST += \ +dist_noinst_man_MANS = \ %D%/man1/cstyle.1 dist_man_MANS = \ @@ -105,8 +105,9 @@ nodist_man_MANS = \ %D%/man8/zed.8 \ %D%/man8/zfs-mount-generator.8 -SUBSTFILES += $(nodist_man_MANS) +dist_noinst_DATA += $(dist_noinst_man_MANS) $(dist_man_MANS) +SUBSTFILES += $(nodist_man_MANS) CHECKS += mancheck mancheck: diff --git a/rpm/Makefile.am b/rpm/Makefile.am index 216cb731fe..af7b25021e 100644 --- a/rpm/Makefile.am +++ b/rpm/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST += \ +dist_noinst_DATA += \ %D%/generic/zfs-dkms.spec.in \ %D%/generic/zfs-kmod.spec.in \ %D%/generic/zfs.spec.in \ diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6f1dc9ccdb..79719e621b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -6,7 +6,7 @@ dist_scripts_SCRIPTS = \ %D%/zimport.sh \ %D%/zloop.sh -EXTRA_SCRIPTS = \ +dist_noinst_SCRIPTS = \ %D%/commitcheck.sh \ %D%/common.sh.in \ %D%/dkms.mkconf \ @@ -18,14 +18,13 @@ EXTRA_SCRIPTS = \ %D%/paxcheck.sh \ %D%/zfs-tests-color.sh -EXTRA_DIST += \ +dist_noinst_DATA += \ %D%/cstyle.pl \ %D%/enum-extract.pl \ %D%/zfs2zol-patch.sed \ - %D%/zol2zfs-patch.sed \ - $(EXTRA_SCRIPTS) + %D%/zol2zfs-patch.sed -SHELLCHECKSCRIPTS += $(dist_scripts_SCRIPTS) $(EXTRA_SCRIPTS) +SHELLCHECKSCRIPTS += $(dist_scripts_SCRIPTS) $(dist_noinst_SCRIPTS) define SCRIPTS_EXTRA_ENVIRONMENT diff --git a/tests/Makefile.am b/tests/Makefile.am index d6ca957ecc..2e633041ab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,6 @@ dist_scripts_runfiles_DATA = \ %D%/runfiles/sunos.run -EXTRA_DIST += $(addprefix %D%/,README.md) +dist_noinst_DATA += %D%/README.md SHELLCHECKSCRIPTS += $(shell find $(srcdir)/%D% -name '*.sh') diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am index 71edd49394..e3c9874dcd 100644 --- a/tests/zfs-tests/cmd/Makefile.am +++ b/tests/zfs-tests/cmd/Makefile.am @@ -41,7 +41,7 @@ scripts_zfs_tests_bin_PROGRAMS += %D%/draid libnvpair.la %C%_draid_LDADD += $(ZLIB_LIBS) -EXTRA_DIST += $(addprefix %D%/,file/file_common.h) +dist_noinst_DATA += %D%/file/file_common.h scripts_zfs_tests_bin_PROGRAMS += %D%/file_append %D%/file_check %D%/file_trunc %D%/file_write %D%/largest_file %D%/randwritecomp %C%_file_append_SOURCES = %D%/file/file_append.c %C%_file_check_SOURCES = %D%/file/file_check.c @@ -116,7 +116,7 @@ scripts_zfs_tests_bin_PROGRAMS += %D%/xattrtest scripts_zfs_tests_bin_PROGRAMS += %D%/zed_fd_spill-zedlet -EXTRA_DIST += $(addprefix %D%/,linux_dos_attributes/dos_attributes.h) +dist_noinst_DATA += %D%/linux_dos_attributes/dos_attributes.h scripts_zfs_tests_bin_PROGRAMS += %D%/read_dos_attributes %D%/write_dos_attributes %C%_read_dos_attributes_SOURCES = %D%/linux_dos_attributes/read_dos_attributes.c %C%_write_dos_attributes_SOURCES = %D%/linux_dos_attributes/write_dos_attributes.c diff --git a/tests/zfs-tests/tests/Makefile.am b/tests/zfs-tests/tests/Makefile.am index 49f9f3aaa7..a91a24d166 100644 --- a/tests/zfs-tests/tests/Makefile.am +++ b/tests/zfs-tests/tests/Makefile.am @@ -1,5 +1,5 @@ CLEANFILES = -EXTRA_DIST = +dist_noinst_DATA = include $(top_srcdir)/config/Substfiles.am