[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make perl & examples optional
Re: Make perl & examples optional
Tue, 08 Sep 2020 12:42:02 -0700
On 2020-09-07 22:46, Akim Demaille wrote:
Hi Kaz, hi Thomas,
Le 7 sept. 2020 à 08:57, Kaz Kylheku <firstname.lastname@example.org> a écrit :
On 2020-09-06 09:13, Akim Demaille wrote:
Le 6 sept. 2020 à 16:41, Thomas Deutschmann <email@example.com> a
in Gentoo Linux we are carrying the following patch for quite some
to make perl dependency which is required for examples optional.
Any chance to get this applied upstream?
I don't see how Perl is needed. I do not mean Perl to be required,
so you'll have to be more specific on why you think it is.
Besides, if I spent so much time providing users with examples, it
is clearly not to see them removed by the distro. These examples are
part of the package, and must be treated like documentation.
I'd like to add that the examples are compiled and executed as test
cases during "make check". The --disable-tests option provided by this
patch completely unhooks these programs from being built and tested
by "make check". Thus if/when Gentoo runs "make check", those things
are not being tested. The main test suite still runs, but Bison is
tested just a little less by the omission of the examples. (They
take very little extra time.)
I disagree with Kaz here. First of all, the examples are not tests,
they are examples.
And these examples have tests because I want to
I see; my mistake is one of loose metonymy. So that is to say, if
there is an example program, and it has tests, I'm informally
calling that program itself a "test" or "test case".
Of course, properly speaking, what is the "test case" is any one
of the input/output pairs with which it is exercised, not
the program itself.
Sorry about that!
make sure that the examples I provide the users with, work. These
tests are not there to check Bison, but to check the examples.
I'm very surprised by this statement, given that a regression in
Bison could easily show up as a failure in one of these example
test cases. For that matter, if it does, that will show up first,
because those example tests are run before the main test suite.
A change in the behavior of Bison could break the build time of
an example program; the build steps of an example program
provide an implicit case for build sanity of the Bison output,
according to the manner it is used to assemble that example program.
I do not know how gemtoo treats the tests. Thomas, do you run the
tests as part of packaging Bison?
Surely, Akim's "must be treated like documentation" can be interpreted
as exactly that: the examples go into some bison-doc package?
But Thomas's question is unrelated: he doesn't want to get rid of the
examples, he wants to get rid of Perl.
It sounds like a possible "X/Y problem".
"Can you help me with X? (Oh, what I'm trying to do is Y, which I
believe is best achieved through X, and X isn't working)."
And he claims that one cannot
support the examples without Perl. And I believe he is mistaken. I
just tried again, successfully.
If someone told me, something in Bison needs perl, I would begin
bison $ git grep '\<perl\>'
A few minutes of searching have led me to the following.
It looks like there is some step to extract examples from the
documentation and build them? Or something like that. And that
seems to require Perl:
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(EXTEXIFLAGS) $(doc)
EXTRA_DIST += $(extracted)
MAINTAINERCLEANFILES += $(extracted) %D%/extracted.stamp
%D%/extracted.stamp: $(doc) doc/version.texi $(extexi)
$(AM_V_GEN)rm -f $@ $@.tmp
$(AM_V_at)mv $@.tmp $@
So, if you remove the examples/local.mk from being included at all,
then this is blown away, and perl is not required.
I see that the the examples/extracted.stamp file has been created
on my system, so it seems that this recipe fired, including
the $(extract) ... command which relies on $(PERL).
It looks like that would not have worked without Perl having
But, meta question: isn't it fairly common for programs to have
just *build* time dependencies in Perl?
I suspect that if you want to make GNU/Linux distro which does
not require any perl to be available *on the build machine*,
might that not be unrealistic?
Of course, we can think about a distro which doesn't have a
run-time Perl on the target, which is different.