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

Support HTTP proxies #59

Closed
l2dy opened this issue Jun 2, 2017 · 22 comments
Closed

Support HTTP proxies #59

l2dy opened this issue Jun 2, 2017 · 22 comments

Comments

@l2dy
Copy link

l2dy commented Jun 2, 2017

error: cannot write format file tectonic-format-latex.fmt.gz
caused by: this I/O layer cannot save format files
Environment

Tectonic 0.1.5
macOS 10.12.5
rustc 1.17.0
cargo 0.18.0

@pkgw
Copy link
Collaborator

pkgw commented Jun 2, 2017

Can you paste the exact command line that you're using to run Tectonic?

I believe that you need to add the argument --outfmt=format ... if that works, then clearly there is a bug in the user experience here that needs to be addressed.

@l2dy
Copy link
Author

l2dy commented Jun 3, 2017

tectonic -w 'https://dl.bintray.com/pkgw/tectonic/tl2016extras/2016.0r4/tlextras-2016.0r4.tar' zh.tex with <redacted>.

I tried --outfmt pdf but that didn't work.

@pkgw
Copy link
Collaborator

pkgw commented Jun 3, 2017

Ohhhh, sorry, I misinterpreted. You have run into a different area where the command-line program is delivering a confusing user experience. The -w option is currently a bit busted compared to what happens if you run the program without any arguments.

If you just run tectonic zh.tex I think it should work. I am having trouble testing since I don't have the Noto Serif CJK SC fonts installed on my system.

@l2dy
Copy link
Author

l2dy commented Jun 3, 2017

In China the default URL (i.e., http://purl.org/net/pkgwpub/tectonic-default) is blocked. Can I use HTTP proxy in tectonic?

@pkgw
Copy link
Collaborator

pkgw commented Jun 3, 2017

Oh! I was wondering why you bothered to use the -w option.

Tectonic uses the Rust crate hyper for web accesses. It looks like proxy support could be enabled with some explicit code in Tectonic: see this thread.

I will change this issue to be about adding proper proxy support.

In the meantime, you should be able to get things working by creating a configuration file that specifies the specific URL. On Linux, this file is looked for at ~/.config/Tectonic/config.toml. On OSX, I believe it will be ~/Library/Application Support/Tectonic/config.toml. The contents should then be:

[[default_bundles]]
url = "https://dl.bintray.com/pkgw/tectonic/tl2016extras/2016.0r4/tlextras-2016.0r4.tar"

In more encouraging news, I downloaded the fonts and I think that the document will compile correctly if you can access the bundle in this way.

@pkgw pkgw changed the title cannot write format file Support HTTP proxies Jun 3, 2017
@l2dy
Copy link
Author

l2dy commented Jun 3, 2017

Thanks, it worked. Please document the config file somewhere.

@webbery
Copy link

webbery commented Jun 20, 2017

I cann't find ~/.config/Tectonic/config.toml in ubuntu 16.04.
I saw -b option. Does it mean I can use native texlive?

@l2dy
Copy link
Author

l2dy commented Jun 20, 2017

@webbery Did you try to create the file?

@webbery
Copy link

webbery commented Jun 20, 2017

@l2dy No, I didn't. Should I copy above content url to config.toml?

@l2dy
Copy link
Author

l2dy commented Jun 20, 2017

If you're facing the same problem (purl.org not accessible), yes.

@webbery
Copy link

webbery commented Jun 20, 2017

thanks, it works

@pkgw
Copy link
Collaborator

pkgw commented Jun 21, 2017

@webbery If you don't mind revealing this information, could you say where you are trying to use Tectonic that makes purl.org not accessible? Also China? I completely understand if you'd rather not share.

@webbery
Copy link

webbery commented Jun 21, 2017

Yes, I'm in China. I found another error if I compiled following tex file:

\documentclass[UTF8]{ctexart}
\begin{document}
\end{document}

Here is the error:

Running TeX ...
Rerunning TeX because "test.aux" changed ...
Running xdvipdfmx ...
error: cannot open "test.xdv"

But if I use vpn, it works fine and produce test.pdf.

@pkgw
Copy link
Collaborator

pkgw commented Jul 9, 2017

@l2dy @webbery I would like to see if I can fix this. Do either of you know of the "best" way to have Tectonic detect whether an HTTP proxy should be used for your OS? I can make it a configuration option, but it would be good for the program to automatically follow system settings if they're available. As far as I can tell Rust does not have a crate that provides this functionality (yet).

@pkgw
Copy link
Collaborator

pkgw commented Jul 9, 2017

Actually, maybe the env_proxy crate is what I need.

@l2dy
Copy link
Author

l2dy commented Jul 9, 2017

I'd suggest following curl's convention. The env_proxy crate seems to obey it.

https://www.freebsd.org/cgi/man.cgi?query=curl&apropos=0&sektion=0&manpath=FreeBSD+11.0-RELEASE+and+Ports&arch=default&format=html#ENVIRONMENT

@spl
Copy link
Contributor

spl commented Mar 13, 2019

Is this the way to set up a proxy with hyper?

@pkgw
Copy link
Collaborator

pkgw commented Mar 14, 2019

@spl I think not, unfortunately, because Tectonic is on hyper 0.10, while those instructions are for 0.11. It would be good to upgrade Tectonic to a newer version of hyper and the rest, but last time I checked it looked like it would be a nontrivial amount of work. Maybe it would be less work to backport the instructions to 0.10, but it also wouldn't be bad to just bite the bullet and upgrade.

@l2dy
Copy link
Author

l2dy commented Dec 10, 2020

reqwest 0.10.9 enables system proxies by default, so all we need is a simple upgrade now.

@pkgw
Copy link
Collaborator

pkgw commented Dec 15, 2020

It shouldn't be too hard to update to the reqwest 0.10 series, I think, but it requires a few updates. I would love if someone could try their hand at making this change! I'd also like to finally address @malbarbo's longstanding #525 pull request ... I just haven't had the time.

@ratmice
Copy link
Contributor

ratmice commented Feb 9, 2021

I think that this one can be closed since #726 was merged

@pkgw
Copy link
Collaborator

pkgw commented Feb 9, 2021

I agree! If anyone encounters a proxy-related problem with Tectonic and finds this issue, I'd recommend opening a new one instead of commenting here.

@pkgw pkgw closed this as completed Feb 9, 2021
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

No branches or pull requests

5 participants