-
Notifications
You must be signed in to change notification settings - Fork 165
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
Better format caching #181
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By adding a "use" statement inside the ctry! macro.
This lets us identify I/O backends that are "bundles" from the user perspective -- large collections of TeX files. From the software architecture perspective, these are IoProviders that can be used to generate format files in a fully standalone fashion. This trait will be used to improve the format caching code such that the runtime options to specify a new Zip bundle or web-based bundle will actually work again.
CC @jneem, this changes some APIs that may affect your project. |
Codecov Report
@@ Coverage Diff @@
## master #181 +/- ##
==========================================
+ Coverage 36.62% 37.97% +1.34%
==========================================
Files 129 131 +2
Lines 60106 60830 +724
==========================================
+ Hits 22015 23099 +1084
+ Misses 38091 37731 -360
Continue to review full report at Codecov.
|
The -b and -w options have been broken for a long time due to the switch to on-the-fly creation of format files: I added a mechanism to cache format files, but it was only active when using the default bundle. In this commit, we split out the format file cache to be active whenever any kind of bundle is being used. The main work is to split out the part of `tectonic::io::local_cache::LocalCache` that cached format files into a highly similar type, `tectonic::io::format_cache::FormatCache`. Then there's some plumbing to be done to activate the cache no matter how the active bundle is specified.
When the `-w` option was given to specify an alternative web-based bundle, no local cache was being used, which made things super inefficient. It's pretty trivial to just activate caching for this code path as well.
This is the modern way to identify the file containing main().
1eabd91
to
b4ee19f
Compare
I'll be honest, I don't want to do this at all, but Codecov is yelling at me and it looks like exercising this code might make it happier. Not sure why the yelling is happening in this PR, which as far as I can tell affects very unrelated code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 straightens out the story about caching format files so that the
--bundle
and--web-bundle
options actually work again.I've also snuck in a few unrelated changes: I'm bumping the version to 0.1.9-dev, and renaming
src/cli_driver.rs
tosrc/bin/tectonic.rs
, which is what it should have been named for a while now.