-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes in pod6 files not available after the first call to update-cache #16
Comments
OK, the thing seems to be that as soon as you cal "load" it's cached, and
it will not change.
|
The new version of 040-pod-extraction is failing now with:
This is due to the fact that, before, stuff was created and then tested in a different instance of a program. Now that we do it in the same instance it's not going to work. So that's the deeper problem I talk about in #17 |
The way I see it, there are several options
I think that the only reasonable purpose, relying on tested and documented APIs is the second one. The first is undocumented, and probably not frozen or specced. Ditto for third: we overcome some lock, it's bound to break. Besides, second would be also a way to re-use existing installations so that we can "install" documentation, for instance, and create HTML out of it, which would result in all kinds of good things. |
Can someone describe for me what you are actually trying to achieve and what kind of issues you are encountering? I'm a bit surprised that no one has ever talked to me about the best way to use our precompilation infrastructure. I could probably give you answers, so you don't have to guess and if there are no answers yet improve our API, so it covers your use case (whatever that is). Also note that the stable API is defined by these classes and roles:
Everything else is subject to change. Everything not covered by spec tests is subject to change. |
Thanks @niner, for dropping by. The basic idea is we want to use the precomp API for a POD cache. In a pinch I would describe it more or less like the current CUR infrastructure, but mutable. We would like to be able to cache a document we have already seen, and then check if the new version of the document is different (by date), and if it is, substitute it. |
Please don't assume that I know anything about our Pod stuff because....I don't :D Rakudo doesn't use timestamps for invalidating precomp files. The whole thing works only with checksums of file contents and for good reason. We learned the disadvantages of timestamps the hard way and I'd suggest you spare yourselves the pain and move on to checksums as well. After all the precomp infrastructure wants you to do that anyway. I don't see why you'd have any issues with the precomp infrastructure for the use case as you've described it. After all, things work just fine when you develop a module in a FileSystem repository and make changes to source files. So I'm gonna need more information on your use case and your troubles. |
El sáb., 29 feb. 2020 a las 8:52, niner (<[email protected]>)
escribió:
Please don't assume that I know anything about our Pod stuff because....I
don't :D
Why do you need a POD cache? Where and how should it be used? That's
incidentally something that the README also doesn't answer.
We need to generate the documentation site fast, so we need precompiled
PODs for doing that. We'll open an issue to improve the README.md
Rakudo doesn't use timestamps for invalidating precomp files. The whole
thing works only with checksums of file contents and for good reason. We
learned the disadvantages of timestamps the hard way and I'd suggest you
spare yourselves the pain and move on to checksums as well. After all the
precomp infrastructure wants you to do that anyway.
OK. Any easy way of doing that?
I don't see why you'd have any issues with the precomp infrastructure for
the use case as you've described it. After all, things work just fine when
you develop a module in a FileSystem repository and make changes to source
files. So I'm gonna need more information on your use case and your
troubles.
Can you please tell us how to replicate the functionality you mention?
We're not saying that it does not work, only we have no idea how to do
that, which is why we're using the current mechanism, inspired by the code
that was used in Pod::to::BigPage.
So let's flesh out the use case
* Initially, we'll cache (precompile) and index every file in the Raku/doc
repo. Could be others, but that's the main use case. From those files, the
primary and secondary HTML pages are generated.
* When we update from the repo, some files will have changed. We need to
know which are these; then we generate HTML pages only for those sites.
There's a bit more here and there: generate graphs, things like that. But
that's basically it. This issue is an example of what does not really work
(and which were kind of mimicking so far, but now it does not, possibly
after changes in 2020.02)
|
We need to generate the documentation site fast, so we need precompiled
PODs for doing that. We'll open an issue to improve the README.md
So you're regenerating that site quite often and want to only process the
files that are actually changed? Sounds like the precomp cache can help, but
then you'd still need to generate (presumably) HTML from the bytecode. Why not
skip even that step and just not touch the HTML file at all unless the source
file changed?
OK. Any easy way of doing that?
If you go through CompUnit::PrecompilationRepository::Default then it will
automatically use checksums. You give it the path to the source file and it
will do the check and either precompile or just load the thing.
Can you please tell us how to replicate the functionality you mention?
We're not saying that it does not work, only we have no idea how to do
that, which is why we're using the current mechanism, inspired by the code
that was used in Pod::to::BigPage.
Sounds to me as simple as:
my $precomp-repo = CompUnit::PrecompilationRepository::Default.new(
:store(CompUnit::PrecompilationStore::File.new(:$prefix)),
);
my $handle = $precomp-repo.try-load(
CompUnit::PrecompilationDependency::File.new(
:src($pod-file-path),
:id(CompUnit::PrecompilationId.new-from-str($pod-file-path)),
:spec(CompUnit::DependencySpecification.new(:$short-name),
),
);
So let's flesh out the use case
* Initially, we'll cache (precompile) and index every file in the Raku/doc
repo. Could be others, but that's the main use case. From those files, the
primary and secondary HTML pages are generated.
* When we update from the repo, some files will have changed. We need to
know which are these; then we generate HTML pages only for those sites.
So you do want to save that HTML generation step? Honestly I'd just use
make(1) in that case. After all "The make utility will determine automatically
which pieces of a large program need to be recompiled, and issue the commands
to recompile them."
There's a bit more here and there: generate graphs, things like that. But
that's basically it. This issue is an example of what does not really work
(and which were kind of mimicking so far, but now it does not, possibly
after changes in 2020.02)
This issue does not exactly explain what's wrong. Neither does it explain how
the system is supposed to work. No steps to reproduce, expected or actual
results.
|
Steps to reproduce it: Raku/Documentable#73 (comment) |
After installing Documentable::CLI (had to skip tests as Pod::To::Cached doesn't seem to installed), I tried the script you pointed out:
Is that the error this issue is about? |
You need to run it from the Documenable repo, so you have to clone it first. Sorry, I should have said that. |
I don't get any error. Seems to work just fine? |
Have you modified the subtitle of the pod? Does that change appear? Nope. |
And that's the error, that we never truly update the cache. I mean, we update it, but those changes are not available to the program running the cache. For those changes to be available, we need to stop running the program and start it again. |
On Samstag, 29. Februar 2020 19:22:23 CET Antonio wrote:
Have you modified the subtitle of the pod?
Yes, as you can see by the call to vi
Does that change appear? Nope.
Appear where?
|
When you print it. In the first run of the script you got:
And in the second run, supposedly after you modified the subtitle:
As you can see, the changes are not available. |
Unfortunately I've got to go now. Would have been so useful to have this info as real steps to reproduce, so I wouldn't have had to guess so much. |
Sorry for all the trouble and misunderstanding, I should have added that to the issue. I will try to do it better next time, thanks for your time. |
I replaced Pod::To::Cached with the code I suggested above and it precompiles and picks up changes in the files just fine:
|
That's fantastic. I will try to use that code in |
El sáb., 29 feb. 2020 a las 18:31, niner (<[email protected]>)
escribió:
> We need to generate the documentation site fast, so we need precompiled
> PODs for doing that. We'll open an issue to improve the README.md
So you're regenerating that site quite often and want to only process the
files that are actually changed? Sounds like the precomp cache can help,
but
then you'd still need to generate (presumably) HTML from the bytecode. Why
not
skip even that step and just not touch the HTML file at all unless the
source
file changed?
That's what we do, that's what we would like to keep doing, but haven't
been able since some recent change. Also, the thing is a bit more
complicated, but that's the gist of it.
> OK. Any easy way of doing that?
If you go through CompUnit::PrecompilationRepository::Default then it will
automatically use checksums. You give it the path to the source file and
it
will do the check and either precompile or just load the thing.
> Can you please tell us how to replicate the functionality you mention?
> We're not saying that it does not work, only we have no idea how to do
> that, which is why we're using the current mechanism, inspired by the
code
> that was used in Pod::to::BigPage.
Sounds to me as simple as:
my $precomp-repo = CompUnit::PrecompilationRepository::Default.new(
:store(CompUnit::PrecompilationStore::File.new(:$prefix)),
);
my $handle = $precomp-repo.try-load(
CompUnit::PrecompilationDependency::File.new(
:src($pod-file-path),
:id(CompUnit::PrecompilationId.new-from-str($pod-file-path)),
:spec(CompUnit::DependencySpecification.new(:$short-name),
),
);
That looks great. We'll check.
So let's flesh out the use case
> * Initially, we'll cache (precompile) and index every file in the
Raku/doc
> repo. Could be others, but that's the main use case. From those files,
the
> primary and secondary HTML pages are generated.
> * When we update from the repo, some files will have changed. We need to
> know which are these; then we generate HTML pages only for those sites.
So you do want to save that HTML generation step? Honestly I'd just use
make(1) in that case. After all "The make utility will determine
automatically
which pieces of a large program need to be recompiled, and issue the
commands
to recompile them."
It's a bit more complicated, because multiple files are generated from
multiple sources, and the files that are actually generated are not known
until the compiled document is checked...
> There's a bit more here and there: generate graphs, things like that. But
> that's basically it. This issue is an example of what does not really
work
> (and which were kind of mimicking so far, but now it does not, possibly
> after changes in 2020.02)
This issue does not exactly explain what's wrong. Neither does it explain
how
the system is supposed to work. No steps to reproduce, expected or actual
results.
Well, this are the issues of one of the tests that are failing now. But
what you mention above is helpful. We'll give it a try, thanks.
|
Thanks @niner, I appreciate.
|
We need to fix this pronto, using code suggested by @niner |
I'm checking this and the changes needed to get it going, and I'm under the impression it's going to be better to just writing a new cache from scratch to use it from Documentable. Most attributes (for instance, the JSON file with state) is not really going to be needed if we use this. |
You can see that happening in Raku/Documentable#73.
Maybe this question is relevant to the problem.
The text was updated successfully, but these errors were encountered: