Add --deps
and --deps-format
flags for emitting a dependency list
#7022
+277
−134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces
--make-deps
with two new flags:--deps
— where to write the list of dependencies--deps-format
— one ofzero
,json
,make
:make
: Makefile format, matches the behavior of--make-deps
main.pdf: lib.typ /home/tau/.cache/typst/packages/preview/physica/0.9.6/physica.typ /home/tau/.cache/typst/packages/preview/physica/0.9.6/typst.toml main.typ image.png
json
: JSON array of strings, each string being a (relative) path to a dependencyzero
: sequence of strings delimited by a NUL byteComparison of formats:
+1
-1
(largely unstandardized, essentially defined by an implementation — in fact,--make-deps
was implemented by rewriting a part of GCC in Rust, and the GCC code says something like "well GNU Make does this; note that this still breaks sometimes")$
0
(can be improved to+1
by using "pretty" option)+1
(standard is short and concise, easy to implement in any language, used by most utilities, but still requires stuff like escape processing)-0.5
(needsbat -A
or similar)+2
(doesn't require any sort of escape parsing, can be parsed without copying)Scale used:
Unresolved questions:
--deps-format
? Currently it'szero
, because it's the only lossless one, but I admit it's not the most common format. Maybe use JSON as the middle ground?zero
, becausenull
can be confused for "lack of value", andtext0
is a bit longer and includes combines letters and digits, which a part of my brain doesn't like for some reason.(continuation of #6648)