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

Complain if a filesystem file with an absolute path is accessed #8

Closed
pkgw opened this issue Mar 15, 2017 · 7 comments
Closed

Complain if a filesystem file with an absolute path is accessed #8

pkgw opened this issue Mar 15, 2017 · 7 comments
Labels
good first issue A good issue for new contributors to try tackling!

Comments

@pkgw
Copy link
Collaborator

pkgw commented Mar 15, 2017

The idea is that we want to identify when the document compilation requires "external" ("system"?) files that may make the document build not reproducible. I think there's a way to do this that's helpful but doesn't make the user experience too annoying. We probably just want to warn on the first system file rather than each one, since I expect that the usual case for this will be system fonts, which usually involves accessing a whole bunch of related files in a group.

@pkgw pkgw added the good first issue A good issue for new contributors to try tackling! label Mar 17, 2017
@pkgw
Copy link
Collaborator Author

pkgw commented Jun 2, 2017

CC #31, #36, #50 — looks like we're going to need to spend some time on the local-filesystem access code paths, which would be a good time to add a warning here.

We should probably also add a warning if a filesystem path is accessed outside of the "document root", i.e. if someone tries to open ../../../etc/passwd or whatever. But, you could imagine having a whole tree where the file that you're compiling is manual/manual.tex and it is OK for that file to reference ../shared/setup.tex (taking manual/ as the CWD). So perhaps the default is that the "document root" is the directory containing the input TeX file, but there's a way to override that inference and use a containing directory instead.

@pkgw
Copy link
Collaborator Author

pkgw commented Jun 28, 2022

Finally fixed in #911!

@pkgw pkgw closed this as completed Jun 28, 2022
@malbarbo
Copy link
Contributor

@pkgw How can one avoid such warnings?

I'm getting warning such as:

warning: accessing absolute path `/nix/store/91qbwa97mgiwanvgaihc2rykxy6lcfd4-source-sans-3.046/share/fonts/truetype/SourceSans3-Semibold.ttf`; build may not be reproducible in other environments

@pkgw
Copy link
Collaborator Author

pkgw commented Oct 21, 2022

@malbarbo Currently there isn't a way to disable the warning, but one could certainly be added.

I'm curious about your use case. I presume that you're doing builds in some Nix setup where absolute paths are working their way into the system? (I hardly know anything about Nix, I'm afraid.) Do you think it is possible (even if annoying/undesirable) to reorganize your document and/or build process to avoid the absolute paths?

@malbarbo
Copy link
Contributor

@pkgw I do not have any specific configuration or use case, the warning show up with a minimal example.

To reproduce the issue start the nixos iso in a virtual machine, download the latest tectonic and build the following example

\documentclass{beamer}
\usetheme{metropolis}

\begin{document}
\end{document}

Note that the warnings are only generated when using metropolis theme.

@vlasakm
Copy link
Contributor

vlasakm commented Nov 28, 2022

@pkgw I do not have any specific configuration or use case, the warning show up with a minimal example.

Thank you for the minimal example @malbarbo. The issue isn't NixOS specific, it's #9 (see #965, in particular #965 (comment)).

The only problem is that for example in the case of metropolis you are not loading the fonts yourself, but the package does. In this case the culprit is in the file beamerfontthememetropolis.sty.

As a proof of concept, I can replace it with my own version: beamerfontthememetropolis.sty (placed so that Tectonic can find it, for example in the same directory as the compiled file when tectonic document.tex is used). Let me know if you too can compile your example succesfully in that way. (Beware that the document should "error out" and not produce a PDF, since it has no content).

Upstream already knows about this for 5 years (matze/mtheme#280), so getting a fix there is probably infeasible. Resolving #9 should solve this metropolis issue for Tectonic though.

@pkgw
Copy link
Collaborator Author

pkgw commented Jan 24, 2023

It sounds like this is another case where a patch in the Tectonic bundle (via the tectonic-texlive-repos repo) would make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue for new contributors to try tackling!
Projects
None yet
Development

No branches or pull requests

3 participants