Bug#870640: Make source package bootstrappable

Osamu Aoki osamu at debian.org
Tue Aug 29 13:38:24 UTC 2017


Hi,

Thanks for your reply.
On Mon, Aug 28, 2017 at 06:49:02PM +0200, Mattia Rizzolo wrote:
> On Mon, Aug 28, 2017 at 10:36:45PM +0900, Osamu Aoki wrote:
...
> > Then the commit message made me wonder why perl library is needed for build
> > script.  It was unintuitive but reminded me of my own experience of
> > writing buggy code and its failed test build for uscan.pl.  It failed
> > before even running "make test".  This is because scripts/Makefile has
> > "all" target from which the following code is run:
> > 
> > 	perl -I ../lib -c $@
> > 
> > This is to catch syntax error but probably cause error if pertinent perl
> > library modules are not available.  (Actually, 2 such lines.)
> > 
> > In order to skip such dependency to perl library modules during the
> > build, I think, you need to disable these syntax checking lines by
> > changing above mentioned lines to:
> > 
> > ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
> > 	perl -I ../lib -c $@
> > endif
> 
> Wouldn't make sense to move that thing to the test target instead?

Also you mentioned later:
> Well, rather not.  Build profiles are a packaging thing, such check
> should be done in d/rules, and have it call make with some other option.

Valid points by itself.  From the POV of logical factoring, yes I agree.

But this is a Debian native package with script/Makefile already
mentioning data in debian/*.  So being picky on this point serves little
benefits.

>From practical checking of code by running test/test_* directly after
updating the code, build system after logical factoring requires us to
run test target manually in advance.  Extra work.  Also test target will
likely to check all commands making it slow and non-focused.

Anyway, if you insist logical solution:
$ git diff # tab code broken
diff --git a/scripts/Makefile b/scripts/Makefile
index ece5455a..3a83cb0f 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -18,6 +18,8 @@ CFLAGS += -std=c99
 LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
 CWRAPPERS = debpkg-wrapper
 SCRIPTS = $(patsubst %.pl,%,$(PL_FILES)) $(patsubst %.sh,%,$(SH_FILES))
+PL_CHECKS $(patsubst %.pl,%.pl.check,$(PL_FILES))
+SH_CHECKS $(patsubst %.pl,%.sh.check,$(SH_FILES))
 COMPL_FILES := $(wildcard *.bash_completion)
 BC_BUILD_DIR:=bash_completion
 COMPLETION = $(patsubst %.bash_completion,$(BC_BUILD_DIR)/%,$(COMPL_FILES))
@@ -44,17 +46,18 @@ ifeq ($(shell dpkg-vendor --query Vendor),Ubuntu)
 # will be for preparing PPA uploads.
 	sed -i 's/get_ubuntu_devel_distro()/"$(shell lsb_release -cs)"/' $@
 endif
-	perl -I ../lib -c $@
 
 %.tmp: %.sh $(VERSION_FILE)
 	sed -e "s/###VERSION###/$(VERSION)/" $<  > $@
-	bash -n $@
+%.sh.check: %
+	bash -n $<
 %.tmp: %.pl $(VERSION_FILE)
 	sed -e "s/###VERSION###/$(VERSION)/" $<  > $@
-	perl -I ../lib -c $@
 %: %.tmp
 	cp $< $@
 	chmod +x $@
+%.pl.check: %
+	perl -I ../lib -c $<
 
 %.1: %.pl
 	podchecker $<
@@ -88,7 +91,7 @@ clean:
 	rm -f $(SCRIPTS) $(patsubst %,%.tmp,$(SCRIPTS)) \
 		$(GEN_MAN1S) $(SCRIPT_LIBS) $(CWRAPPERS)
 
-test:
+test: $(PL_CHECKS) $(SH_CHECKS)
 	python3 -m flake8 --max-line-length=99 $(PYTHON3_SCRIPTS)
 	$(foreach python,$(shell py3versions -r ../debian/control),$(python) setup.py test$(\n))

something along this should solve all stupid perl module build
dependency issues.  If you like this way, I am OK with this.

> The following packages have unmet dependencies:
>  builddeps:/build/devscripts_2.17.10.dsc:arm64 : Depends: libfile-desktopentry-perl:arm64 but it is not installable
>                                                  Depends: libfile-homedir-perl:arm64 but it is not installable
>                                                  Depends: libgit-wrapper-perl:arm64 but it is not installable
>                                                  Depends: liblist-compare-perl:arm64 but it is not installable
>                                                  Depends: liburi-perl:arm64 but it is not installable
>                                                  Depends: libwww-perl:arm64 but it is not installable


Oh, unless you disable the target content in "devscripts.1:
devscripts.1.in" , perl is needed for building this manpage.  It calls
perl via "perl ../debian/genmanpage.pl"

>                                                  Depends: perl:arm64 but it is not going to be installed



Osamu



More information about the devscripts-devel mailing list