-
Notifications
You must be signed in to change notification settings - Fork 162
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
--web-bundle
for v2 CLI: fix #1002 and allow overrides
#1132
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1132 +/- ##
==========================================
+ Coverage 46.28% 46.34% +0.06%
==========================================
Files 171 171
Lines 65099 65121 +22
==========================================
+ Hits 30129 30181 +52
+ Misses 34970 34940 -30 ☔ View full report in Codecov by Sentry. |
Whoops, I should write tests, but I don't know how to... 😿 |
You may want to do that after upstream approves the intentions of the PR. I have a question: Is it possible to implement the following behavior:
This way, the PR would help a lot both Nixpkgs' situation, and all other users. For Nix users, this would allow to wrap Tectonic with
With the above described behavior to be able to override the web-bundle, a no-Nix user won't need to |
4cefc2d
to
4404d97
Compare
@bryango this seems to get into great shape! Considering you have added extensive tests, do you think it should be ready for inclusion in Nixpkgs? Along with an additional |
Hi @doronbehar! Thank you very much for following along! I like your previous suggestions very much and have been trying to implement them.
This is the eventual goal! I think I finally got everything working, but I am not entirely satisfied about the current resolution. The code feels a bit too hacky... I will try to improve it a bit more, and after some more testing, I think it would be good to go into nixpkgs! But it might take some time 🥺 |
--web-bundle
for v2 CLI, fixes #1002 and allows overrides--web-bundle
for v2 CLI: fix #1002 and allow overrides
60c9aeb
to
4ccac89
Compare
`config.rs` is refactored such that `test-bundle://` is interpreted as the valid web-bundle for offline testing.
In particular, we now allow `-X` to _not_ be the first cli argument. This makes way for common options such as `--web-bundle` to be specified _before_ the `-X` flag.
6107941
to
21069ff
Compare
- Promote `--web-bundle` to a top level option, in v1 & v2 CLI. - Allow `--web-bundle` to be specified in any position in v2 CLI. This makes use of `clap::Arg::global`. - Allow user overrides of `--web-bundle` by specifying it multiple times, and the last specification wins over the previous ones. This makes use of `clap::Arg::overrides_with`. By design, `tectonic -X build` is special as it never reads from the global config, but only from the local `Tectonic.toml` file, to ensure maximal reproducibility across different environments. Therefore, for `-X build`, the global `--web-bundle` option, if specified, is ignored with a warning `tt_note`.
e9a60e3
to
2c74050
Compare
2c74050
to
61eb46a
Compare
@pkgw @doronbehar @rm-dr Happy new year! I think this is the best I can do, and it's ready for review. The changes may look large and scattered, but in fact half of them are test changes. It is easy to review commit by commit: https://github.com/tectonic-typesetting/tectonic/pull/1132/commits
Going through the history, maybe @Sinofine @CraftSpider would be interested in taking a look? |
Sorry for taking to long to review this Upon first read I wasn't a fan of the changes to allow Likewise I don't love having the So I'm going to go ahead and merge this. Sorry again for the lack of responsiveness. |
Thank you very much for merging this!
The current solution is indeed ugly, but once v2 CLI has fully taken over, this would hopefully look a bit better!
Please there is no need to apologize! It is already hard enough to work in academics, let alone maintaining many open source codebases where users like me are constantly blabbing for features 😆 Thank you very much for doing this! |
This PR is split off from #1131. See #1131 for relevant discussions on the web bundle interface.
tectonic -X new
andtectonic -X init
, with the usual--web-bundle
flag--web-bundle
by specifying it multiple times. The last specification of--web-bundle
wins.tectonic -X build
is special as it never reads from the global config, but only from the localTectonic.toml
file, for maximal reproducibility. In this case, the global--web-bundle
option, if specified, is ignored with a warning.For a horrible example,