Closed mfansler closed 1 year ago
Can't locate File/Find.pm in @INC (you may need to install the File::Find module) (@INC contains: /home/mambauser/.TinyTeX/texmf-dist/scripts/texlive /home/mambauser/.TinyTeX/tlpkg /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /home/mambauser/.TinyTeX/bin/x86_64-linux/tlmgr line 87.
@norbusan I wonder if this error message could be improved when Perl is not present in the system. I don't know much about Perl, and I have no idea what this error message means. Thanks!
On second glance, looks like I was a bit hasty concluding that Perl wasn't installed in the first container. Rather, that error message is complaining that the File::Find
module is missing.
I don't understand, File::Find
is a core perl module, if you have Perl installed, that module should be installed, too.
I don't understand,
File::Find
is a core perl module, if you have Perl installed, that module should be installed, too.
Apologies if I'm misinterpreting the error. 😬 (not a Perl person)
In the container I see:
$ docker run --rm -it mambaorg/micromamba:1.4.9
(base) $ which perl
/usr/bin/perl
(base) $ perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi
(with 47 registered patches, see perl -V for more detail)
Copyright 1987-2021, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
(base) $ perl -mFile
Can't locate File.pm in @INC (you may need to install the File module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl).
BEGIN failed--compilation aborted.
(base) $ perl -mFile::Find
Can't locate File/Find.pm in @INC (you may need to install the File::Find module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl).
BEGIN failed--compilation aborted.
I interpret that as Perl 5.32.1 is installed, but not the File::Find
module. Note that this is a container targeting production, i.e., it's not surprising to find extreme minimization.
Thanks @mfansler
Wow, that is really stripped down, and I consider this BADLY incorrect.
The image you are using is based on Debian, and only has perl-base
installed.
To quote from https://packages.debian.org/bookworm/perl-modules-5.36
Architecture independent Perl modules. These modules are part of Perl and required if the `perl' package is installed.
Now, I agree that perl
is not installed, only perl-base
. But to be honest, this is badly broken because (to quote again):
Note that this package only exists to save archive space and should be considered an internal implementation detail of the
perl
package. Other packages should not depend onperl-modules-5.36
directly, they should useperl
(which depends onperl-modules-5.36
) instead.
So, as much as I understand your problem, I think this is purely a problem of a completely misconfigured docker image.
Good to know!
I think for Conda Forge purposes I'm going to have the package emit a message at installation time informing users that tinytex::install_tinytex()
requires a perl
installation. We could go as far as requiring perl
through Conda, but I think this is such an edge case (and, as you identify, substandard context) that it should rarely be encountered. I won't pursue getting the micromamba
image adjusted. It suffices for the target application (micromamba
) and when needed a proper perl
can easily be added to any Conda environment, as shown by OP.
For purposes of this issue, my take is that:
perl
is a requirement, and that perl-base
is insufficient; andtinytex::install_tinytex()
checked for perl -mFile::Find
prior to downloading, and short-circuited with a user-friendly message when unavailableThanks for the feedback/insights! I appreciate that this is in no way urgent (you both certainly have more productive matters at hand!) and perhaps just having this issue filed is satisfactory documentation.
I just tested on macOS and it's odd that perl -mFile
also fails but tinytex::install_tinytex()
works fine.
% which perl
/usr/bin/perl
% perl -mFile
Can't locate File.pm in @INC (you may need to install the File module) (@INC contains: /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.3 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30).
BEGIN failed--compilation aborted.
Sorry, that part might have been misleading. File::Find
being a module probably doesn't entail File
being a module. I was just trying it out.
perl -mFile::Find
hangs on my machine and there's no output. Not sure why.
I believe it's waiting for input. Not sure what the standard is, but passing empty file (e.g., /dev/null
) will get it going. Here's from macOS:
## not found
$ perl -mFile /dev/null
Can't locate File.pm in @INC (you may need to install the File module) (@INC contains: /Users/mfansler/miniconda3/lib/perl5/5.32/site_perl /Users/mfansler/miniconda3/lib/perl5/site_perl /Users/mfansler/miniconda3/lib/perl5/5.32/vendor_perl /Users/mfansler/miniconda3/lib/perl5/vendor_perl /Users/mfansler/miniconda3/lib/perl5/5.32/core_perl /Users/mfansler/miniconda3/lib/perl5/core_perl .).
BEGIN failed--compilation aborted.
## found
$ perl -mFile::Find /dev/null
So one could run something like:
$ perl -mFile::Find /dev/null 2> /dev/null
Then check that $?
is 0.
Okay, that works. Thanks!
However, I think a better solution is to declare the dependency on perl
for the (conda?) package r-tinytex
. I prefer not having to manage this dependency inside an R function. I have no idea how conda packages are built, and don't know whom to contact in this case.
I have no idea how conda packages are built, and don't know whom to contact in this case.
I'm on the Conda Forge R team. :wink:
However, I think a better solution is to declare the dependency on
perl
for the (conda?) packager-tinytex
.
I hesitate to do this because it's a waste of 100 MB of disk space for users on desktop Linux or macOS (both have functional system Perl) and suspect they comprise the majority user base. I think an install message suffices for the DevOps people deploying to containers that actually need it. I'm only proposing to do this on the Conda Forge feedstock and requires nothing to be done here.
I prefer not having to manage this dependency inside an R function.
I'm already satisfied just having it documented. I think those that hit it could find it.
I'm already satisfied just having it documented.
Okay, I can certainly do that.
I'm on the Conda Forge R team.
Haha, didn't know that and good to know now!
This doesn't seem to be resolved yet? Inside of the official mamba docker image, Mamba is trying to install tinytex as a dep for something else and I'm getting these error messages consistently:
error libmamba response code: -1 error message: Invalid argument
critical libmamba failed to execute pre/post link script for r-tinytex
I have tried two approaches to including perl in the dockerfile:
apt-get
FROM mambaorg/micromamba
USER root
RUN apt-get update && apt-get install -y perl \ && rm -rf /var/lib/apt/lists/*
USER $MAMBA_USER
RUN micromamba install --yes --name base -c bioconda -c conda-forge \ falco \ fastp \ multiqc \ r-base \ r-dplyr \ r-dt \ r-flexdashboard \ r-ggplot2 \ r-knitr \ r-magrittr \ r-plotly \ r-rmarkdown \ r-tidyr \ r-viridislite
2. install via conda/mamba
FROM mambaorg/micromamba
RUN micromamba install --yes --name base -c bioconda -c conda-forge \ falco \ fastp \ multiqc \ r-base \ r-dplyr \ r-dt \ r-flexdashboard \ r-ggplot2 \ r-knitr \ r-magrittr \ r-plotly \ r-rmarkdown \ r-tidyr \ r-viridislite \ perl
The results are identical (critical failure) and I cannot proceed with environment creation
@pdimens no, the problem is that the post-link script (which merely emits text) is crashing. Please add comments to this Issue - this is purely a Conda Forge thing and not something that needs to revive this thread. I will try to get to it this week.
I've made the editorial decision to remove the notification emitted by the Conda Forge package regarding the need for Perl. There was both issue with the mechanism for emitting the message and confusion around interpretation of the message when it did work (users misinterpreted it as a warning/thought it meant Perl was not detected). In the end, seemed like more trouble than it was worth.
This issue is to report a finding that on the Conda Forge CI (running on image quay.io/condaforge/linux-anvil-cos7-x86_64), we found that
tinytex::install_tinytex()
would result in error unless Perl was installed on the system. I realize most end-user systems will have this, but containers may not, and I did not see this expectation documented. I suggest it should be documented.For replication, here are examples running with and without Perl.
Failure without Perl
Shell
Result
Expected behavior with Perl
Shell
Result
By filing an issue to this repo, I promise that
xfun::session_info('tinytex')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/tinytex')
.I understand that my issue may be closed if I don't fulfill my promises.