Re: POD formatter version comments
Shawn H Corey writes:
> On 2024-03-15 14:38, Russ Allbery wrote:
>> If you would be happy with a PR to remove that bullet point, we're just
>> vigorously agreeing. π Otherwise, I'm not sure what you're asking for
>> instead.
> I guess I wasn't clear. I was talking about making the requirement an
> option for the formatters. When the user runs a formatter, they can
> specify an option to include the info in their output. In other words,
> move it from a requirement to an optional implementation for a formatter.
Oh, thank you! I had indeed completely misunderstood what you meant.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~|| 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
Re: POD formatter version comments
Karen Etheridge writes: > I believe the paragraph in the docs should stay, but change the MUST to > a SHOULD, with a proviso that there should be a way to disable it (for > the purposes of repeatable builds etc). If the paragraph is removed > entirely, no one will implement it (the fact that it is not > well-implemented now is sad, but beside the point). I have no strong > feelings as to whether the option should default to on or off, but the > option should exist for those that wish this extra content. The tricky thing about reproducible builds is that the folks who are attempting to do them are doing mass numbers of packages at once, and are generally trying to do it without changing the package build system (which sort of defeats the point). So having an option to disable non-reproducible behavior can be a bit tricky: it has to be accessible to their build infrastructure (which usually means an environment variable), and it also means that the default build is not reproducible, thus partly undermining the security benefits. Sometimes the benefits of whatever is making the build non-reproducible are significant enough that this is all worth it. I think that's the case for the date embedded in manual pages, for example, since that provides users with a valuable hint about when the documentation was last modified, and there's no other good way to get that date, if not explicitly provided, other than using the file modification timestamp (something that's not always reproducible). For that case, I left that the default behavior, but added support for the SOURCE_DATE_EPOCH environment variable [1] to override any dates derived from file timestamps. This has the advantage of being a generic setting that can be adopted by a variety of different software with similar needs. Debian automatically sets that environment variable to the date of the last Debian changelog entry in its build system, so that means Debian packages no long require special configuration to be reproducible in that way. [1] https://reproducible-builds.org/docs/source-date-epoch/ Versions seem like both a less important and a trickier issue. On one hand, reproducible builds in the classic security sense only make sense when using the same versions of all tools, in which case pure version information isn't a problem. This is supported by [2]. (Some of the other things perlpodspec currently suggest, such as the current time or the name of the input file, would be more of a problem.) [2] https://reproducible-builds.org/docs/version-information/ On the other hand, it's still useful to be able to compare the output between build systems using, say, two different point releases of Perl to see if there are any significant differences, and the embedded version numbers add a lot of noise. I admit that I've frequently annoyed myself by embedding version numbers in comments in output and then having to write tedious scripts to filter those version numbers out again so that I can compare output between old and new versions of tools looking for significant differences. I kind of want to tell my future self to stop doing that, although there is a trade-off between that and having useful provenance information. On a practical level, there doesn't seem to be a good generic environment variable already in use that says "omit provenance information that may not be significant"; the only two environment variables that have been standardized for this purpose are SOURCE_DATE_EPOCH and BUILD_PATH_PREFIX_MAP. That means that if we want to leave it on by default but provide an easy way to turn it off, we'd have to make up a new environment variable, which would at least start as specific to Perl and would be another thing people had to somehow learn about and track. For that reason, I'm currently leaning towards dropping this information by default. I'm not sure that I want to add a flag to add it back in. Every new flag is some small amount of ongoing support and documentation complexity overhead, and it's been a long time since I've used this information to understand a bug report. For perlpodspec, based on this discussion, I propose the following fairly minimal change. (I've never had a reason to submit a PR against Perl before; now seems like a good time to start.) >From ac979b8560449d363d1b3309ef5b80aa00b4b8f2 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 24 Mar 2024 12:13:18 -0700 Subject: [PATCH] Adjust perlpodspec rules for formatter comments Relax the must requirement that Pod formatters embed version information in a comment to "may." Add a "should not" rule against comments containing information that would cause otherwise-identical output to change unnecessarily. --- pod/perlpodspec.pod | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pod/perlpodspec.pod b/pod/perlpodspec.pod index ca09d28555..d7387a28d0 100644 --- a/pod/perlpodspec.pod +++ b/pod/perlpodspec.pod @@ -695,7 +695,7 @@
Re: POD formatter version comments
On Wed, Mar 20, 2024, at 18:34, Karen Etheridge wrote: > I believe the paragraph in the docs should stay, but change the MUST to a > SHOULD, with a proviso that there should be a way to disable it (for the > purposes of repeatable builds etc). If the paragraph is removed entirely, no > one will implement it (the fact that it is not well-implemented now is sad, > but beside the point). I have no strong feelings as to whether the option > should default to on or off, but the option should exist for those that wish > this extra content. I don't have strong feelings about using SHOULD here, although mostly I think it's simpler to strike the paragraph. If the paragraph is removed, nothing will change except some noncompliant formatters might become compliant. Removing the "formatters must" does not imply a "formatters must not", so nobody is being robbed of an option to do this or to keep doing it. I think a better paragraph, if we don't just delete, might be: Formatters may introduce comments to their output that provide information on the tooling used to produce that output. When doing this, implementers should consider that reproducible build systems benefit from reduced churn in the build products. This implies that it should be possible to suppress those comments. If the *significant* content of a translation doesn't change between versions, mandatory *insignificant* changes might be a hindrance. -- rjbs
Re: POD formatter version comments
On Wed, Mar 20, 2024 at 2:28β―AM Graham Knop wrote: > On Fri, Mar 15, 2024 at 7:55β―PM Shawn H Corey wro > I guess I wasn't clear. I was talking about making the requirement an > option for the formatters. When the user runs a formatter, they can specify > an option to include the info in their output. In other words, move it from > a requirement to an optional implementation for a formatter. > > Formatters can implement whatever options they want, and can output > however they want. What is the purpose of stating this specific option > as something they can do? It can't be standardized, because it will > inherently be dependent on the output format. > I believe the paragraph in the docs should stay, but change the MUST to a SHOULD, with a proviso that there should be a way to disable it (for the purposes of repeatable builds etc). If the paragraph is removed entirely, no one will implement it (the fact that it is not well-implemented now is sad, but beside the point). I have no strong feelings as to whether the option should default to on or off, but the option should exist for those that wish this extra content.
Re: POD formatter version comments
On Fri, Mar 15, 2024 at 7:55β―PM Shawn H Corey wrote: > > On 2024-03-15 14:38, Russ Allbery wrote: > > If you would be happy with a PR to remove that bullet point, we're just > vigorously agreeing. π Otherwise, I'm not sure what you're asking for > instead. > > > I guess I wasn't clear. I was talking about making the requirement an option > for the formatters. When the user runs a formatter, they can specify an > option to include the info in their output. In other words, move it from a > requirement to an optional implementation for a formatter. Formatters can implement whatever options they want, and can output however they want. What is the purpose of stating this specific option as something they can do? It can't be standardized, because it will inherently be dependent on the output format.
Re: POD formatter version comments
On Fri, Mar 15, 2024 at 08:43:08AM -0700, Russ Allbery wrote: > Does anyone want to make an argument for keeping this in the spec? If > not, I'm going to submit a PR to Perl to remove this whole bullet point. > (The note about including errors as comments is not wrong, but I don't > think it needs to be said in the specification document and it's mostly > covered by the next bullet point anyway.) I think that it is annoying for the reason mentionned of leading to differences in generated files for no good reason. As an anecdotal evidence in favor of removing the requirement, in the GNU Texinfo build system we generate a man page (for pod2texi) using pod2man and we remove the versions in the "Automatically generated by Pod::Man ..." line. -- Pat
Re: POD formatter version comments
On 2024-03-15 14:38, Russ Allbery wrote: If you would be happy with a PR to remove that bullet point, we're just vigorously agreeing. π Otherwise, I'm not sure what you're asking for instead. I guess I wasn't clear. I was talking about making the requirement an option for the formatters. When the user runs a formatter, they can specify an option to include the info in their output. In other words, move it from a requirement to an optional implementation for a formatter. -- πππππ π» πΆππππ π¨π¦
Re: POD formatter version comments
Shawn H Corey writes:
> On 2024-03-15 12:44, Russ Allbery wrote:
>> Shawn H Corey writes:
>>> I think it should be an option. Sometimes it is necessary to know that
>>> a change in appearance is caused by changes to a module and not to the
>>> generating document.
>> Do we need to explicitly state that it's an option, or would removing
>> the requirement to always do it still be okay? The way I was thinking
>> of it is that what formatters put into comments is generally up to
>> them; by default, they *can* include anything they want. Removing the
>> requirement thus just leaves the decision unconstrained.
> I'm not sure what you're saying. If it's an option, then it is
> automatically not a requirement. Unless you mean what information to
> include is the requirement. In which case, having a standard would be
> nice.
I'm trying to figure out if you object to my proposal to delete that
bullet point from perlpodspec. When I proposed doing that, your reply was
that including that information should be an option. That confused me
because I didn't think I was removing it as an option, just removing it as
a requirement by removing the bullet point in perlpodspec that tells
people to do it.
If you would be happy with a PR to remove that bullet point, we're just
vigorously agreeing. :) Otherwise, I'm not sure what you're asking for
instead.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~|| 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
Re: POD formatter version comments
On 2024-03-15 12:44, Russ Allbery wrote: Shawn H Corey writes: I think it should be an option. Sometimes it is necessary to know that a change in appearance is caused by changes to a module and not to the generating document. Do we need to explicitly state that it's an option, or would removing the requirement to always do it still be okay? The way I was thinking of it is that what formatters put into comments is generally up to them; by default, they *can* include anything they want. Removing the requirement thus just leaves the decision unconstrained. I'm not sure what you're saying. If it's an option, then it is automatically not a requirement. Unless you mean what information to include is the requirement. In which case, having a standard would be nice. -- πππππ π» πΆππππ π¨π¦
Re: POD formatter version comments
Shawn H Corey writes:
> I think it should be an option. Sometimes it is necessary to know that a
> change in appearance is caused by changes to a module and not to the
> generating document.
Do we need to explicitly state that it's an option, or would removing the
requirement to always do it still be okay? The way I was thinking of it
is that what formatters put into comments is generally up to them; by
default, they *can* include anything they want. Removing the requirement
thus just leaves the decision unconstrained.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~|| 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
Re: POD formatter version comments
On 2024-03-15 11:43, Russ Allbery wrote: perlpodspec currently contains the following note on POD processor implementations: I think it should be an option. Sometimes it is necessary to know that a change in appearance is caused by changes to a module and not to the generating document. BTW, information of this type is called a colophon and is placed at the end of the document. -- πππππ π» πΆππππ π¨π¦
