You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation build was slow, and often pathologically slow. The root
of the slowness ties back to all the circumstances in which `cargo run`
would be invoked. In the worst cases, `cargo run` would be run for each man
page *and* those `cargo run`'s would rebuild all of StGit.
One change is to capture the StGit version using `cargo metadata` instead
of by running `stg` with `cargo run`. Running `cargo metadata` does not
have a side effect of building `stg` and is thus always fast. Additionally,
the version is now captured as a simply expanded make variable instead of
recursively expanded variable which ensures that `cargo metadata` will only
be run once per make invocation.
A consequence of this change is that man pages now simply reflect the StGit
version as identified in Cargo.toml, without the supplemental git hash when
building from a non-tagged and/or dirty tree.
Another change is to change the dependency chain for how/when the stg-*.txt
asciidoc files are generated. Previously the STG_COMMANDS_TXT variable
would invoke `cargo run completion list commands` each time it was
recursively expanded. The new strategy is to piggyback on doc.dep to ensure
that stg-*.txt are generated, where txt-stamp is the proxy for stg-*.txt.
With this approach, the stg-*.txt files are generated only when necessary
and they are found by make via $(wildcard).
With these updates, the `clean` target no longer triggers `cargo run` and
thus avoids the previous pathology when running `make clean` on an already
clean repo would first build stg.
Fixes: #229
0 commit comments