flathub / org.tug.texworks

https://flathub.org/apps/details/org.tug.texworks
0 stars 3 forks source link

Provided paths could need some corrections #8

Closed jakobjakobson13 closed 3 years ago

jakobjakobson13 commented 3 years ago

Sorry for going on your nerves @stloeffler (especially as I was the one who started the whole flatpak mess), but I think some of your paths could need some corrections. In my installation I found the following paths and some of them seem wrong to me due to the reasons given in the comments behind it.

/app/bin  # is fine
/app/texlive/bin/x86_64-linux  # is fine
/usr/bin  # /usr is forbidden by flatpak
/app/texlive/bin  # is fine
/var/run/host/usr/local/bin  # /var is forbidden by flatpak
/var/run/host/usr/bin  # /var is forbidden by flatpak

See https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access.

stloeffler commented 3 years ago

I think the paths are fine (though it is important to distinguish between paths in the sandbox - which these are - and paths on the host system). BTW, all the statements below refer to my tests so far, if you have made different experiences please share them.

/usr/bin exists in the sandbox, but is currently empty (it does not correspond to /usr/bin on the host system). The main reason for keeping this is that it might potentially be populated in the future (e.g. using platform extensions or something).

As mentioned on the page you linked, the host /usr (and /etc) are mounted in the sandbox under /var/run/host (at least with --filesystem=host, which we use to have access to, e.g., external mounts, network shares, etc.). So /var/run/host/usr/local/bin in the sandbox corresponds to /usr/local/bin on the host, which is typically where TeXlive is found if it was installed manually, and /var/run/host/usr/bin corresponds to /usr/bin, which is where TeX would be found if installed by a package manager or something.

I know this breaks the sandbox-y nature of things, but I want to avoid to tell people that they have to reinstall about 2GB of (a potentially outdated version of) TeXlive just to use the app when they already have TeX on their system. (Such a requirement would probably also lead to countless bug reports saying "my TeX is not found")

jakobjakobson13 commented 3 years ago

Okay, this makes sense so far. However, when I just install your latest build with

$ flatpak install https://dl.flathub.org/build-repo/33248/org.tug.texworks.flatpakref

and rely on my ubuntu tex binaries to compile a tex document, I get the following errors in the log console of texworks

/var/run/host/usr/bin/pdflatex: error while loading shared libraries: libpoppler.so.73: cannot open shared object file: No such file or directory
/var/run/host/usr/bin/lualatex: error while loading shared libraries: libtexlua52.so.5: cannot open shared object file: No such file or directory
/var/run/host/usr/bin/xelatex: error while loading shared libraries: libicuuc.so.60: cannot open shared object file: No such file or directory
stloeffler commented 3 years ago

You're right. I had only tested it with a manual TL installation (under /usr/local/bin) which happened to dynamically link only to libraries that were also available in the sandbox (and apparently sufficiently compatible). However, since this is in no way guaranteed, I have disabled the bin path patch for now, updated appdata.xml accordingly, and have opened a new issue (#11) to keep track of any future progress regarding running TL from the host.