Skip to content
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

Emit a dependency file that makefiles can include. #20

Closed
wants to merge 1 commit into from

Conversation

msullivan
Copy link

At the end of a build we output a dependency file in the object
directory containing a dependency list in make's format. We make no
effort to sort out the details of the dependencies: we just collect
all the file deps from the latex and bibtex tasks and make them
dependencies of the output pdf; the important thing is just that any
changes get detected so latex run is invoked, which will then figure
out the details.

If the output file is paper.pdf, we default to dumping the deps file
as latex.out/paper.pdf.d.

@aclements
Copy link
Owner

Interesting. Do you find this more useful than the phony rules in practice?

Unfortunately, these generated make dependencies are not simply coarser-grained, but less correct than latexrun's internally managed dependencies. That is, with this change, not only are there cases where make will unnecessarily run latexrun (which is probably fine, since latexrun will just exit immediately), but there are cases where make will fail to run latexrun when it is necessary.

@msullivan
Copy link
Author

I find it really annoying when make does things when there is nothing to be done, even if that is just shelling out to another build system. I'm not sure if there is a more practical complaint than that, though.

Interesting. Do you have an example of when this happens?

@aclements
Copy link
Owner

Interesting. Do you have an example of when this happens?

The most obvious one is that latexrun understands when environment variables that matter to TeX change. This includes things like input paths, format paths, and font paths. There are subtler things, too. For example, if the job fails or is interrupted after the first iteration has committed, but before it has stabilized, make will think it's done because the output file is newer than all of the inputs, but latexrun knows that the inputs have changed even though they're older than the output.

At the end of a build we output a dependency file in the object
directory containing a dependency list in make's format. We make no
effort to sort out the details of the dependencies: we just collect
all the file deps from the latex and bibtex tasks and make them
dependencies of the output pdf; the important thing is just that any
changes get detected so latex run is invoked, which will then figure
out the details.

If the output file is paper.pdf, we default to dumping the deps file
as latex.out/paper.pdf.d.
@msullivan
Copy link
Author

Submitted a better approach.

@msullivan msullivan closed this Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants