On Wed Feb 17 17:04:51 2016, ETHER wrote:
Show quoted text> On 2016-02-17 09:29:09, tlhackque wrote:
>
> > Touching README and README.md in [Run::BeforeBuild] works around
> > this.
> > But, pod2readme notes the READMEs are newer than the source file &
> > silently refuses to build them. [and 'optimization') So, -F is
> > required.
> >
> > It would be simpler if one could do something to register files
> > created
> > by the script for the manifest.
> > Perhaps:
> > [Run::BeforeArchive]
> > adds_file = README
> > adds_file = README.md
> > This could be a no-op if the named file already exists.
>
> That won't make any difference at all in the result. The file needs to
> be
> added in the FileGatherer phase (which is right after
> [Run::BeforeBuild]
> runs), no matter who does it.
Yes, but can't Run::BeforeArchive do that as a FileGatherer? There doesn't seem to be an external way to say "This file is going to exist, so look for it when you MANIFEST/sign/archive". And it seems reasonable that one reason to run a script is to create a file... So specifying what it produces in the same place where it's told to run seems reasonable.
Show quoted text>
> > 2) BeforeArchive runs after [CopyFilesFromBuild] Arguably, this is
> > an
> > issue with [CopyFilesFromBuild] - running too soon...
>
> Yes, [CopyFilesFromBuild] runs in the AfterBuild phase, which is
> before
> BeforeArchive.
>
> I would suggest using [CopyFilesFromRelease] instead, which will be
> late
> enough. You can also use [Git::Commit] at that time to commit the
> file to
> your repository so you don't need to add a blank one again next time
> around.
I think that CopyFilesFromRelease only runs if one does a release. I like to check the README before exposing it. So I'll do multiple trial builds, then a test. Finally a TRIAL release to cpan. And only then a release.
So CopyFilesFromRelease is too late in the process. Sigh.
It's not obvious what the harm would be in CopyFilesFromBuild running later, unless the file it wants to copy is removed by cleanup between where it runs now and 'later'.
I still make mistakes, but I do try to minimize how much they're exposed.
The README in the repo is always the last one released, so one can see what was packaged. And also so when you open the project on GitHub, you see it as the "home page".
Show quoted text>
> But, if you run your command in the *build* directory, rather than in
> the
> repository, the file will exist and you won't have to depend on
> [CopyFilesFrom*] to bring the file to you.
Actually, it's the other way around.
I do run the command in the build directory. that's the -in %d to runbrew.
The dummy blank file is to satisfy Manifest. I delete the old one so if something goes wrong, there's a zero length file, not some confusion from an old one.
The reason to copy it to the top level is because that's where the git repo is, so the latest README gets pushed to the remote repo - GitHub in this case - when I commit.
The build directories and tar files are all in .gitignore
If I were to build it in the top level, it wouldn't go in the kit, and I'd have all the MANIFEST issues in spades. Plus, the Pod::Weaver output is only in the distribution directory.
Show quoted text>
> > I work-around that by copying my output as part of the command.
> >
> > 3) %d is documented as 'not in "BeforeBuild'. Using %d in before
> > build
> > should produce an error. The current behavior is to ignore it,
> > which
> > means a command can access an unintended path. E.g. %d%pfoo will
> > access /foo.
>
> What do you mean by ignore it? %d should evaluate to the empty string
> in
> BeforeBuild.
It does. And that's the problem. If you inadvertently use %d in BeforeBuild, it
evaluates to the empty string instead of throwing an error. So, if you thought
%d%pfoo would go to (or read from) your distribution directory, well, it goes to the root directory (/) instead.
Clearly you can't do what was requested, so rather than a silent failure, an error seems in order.
Show quoted text>
> > 4) If I don't remove the build directory before building, there is no
> > 'mismatch'
> > complaint. This seems to indicate that dzil isn't emptying the
> > build
> > directory at the start of a build. This seems like a bad thing,
> > as
> > it means that repeated builds can accumulate stale files.
>
> Yes, that sounds bad, and a worthy issue to file for Dist-Zilla.
> (Which I've done here --
https://github.com/rjbs/Dist-
> Zilla/issues/521)
Thanks.
Show quoted text>
> > a) Documentation nit:
> > %v isn't available in [Run::BeforeBuild] as documented, because
> > it comes from [VersionFromModule]. And [VersionFromModule]
> > looks
> > in the [empty] build directory. Which isn't there yet.
>
> %v asks for $zilla->version; it's the plugin's responsibility to
> provide that
> as soon as it's able. There's nothing that [Run::BeforeBuild] can do
> about
> that, but it can be noted in the documentation.
Agree.