cmhughes / latexindent.pl

Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
GNU General Public License v3.0
884 stars 84 forks source link

Conda install complains about Unicode::GCString module #334

Closed musm closed 2 years ago

musm commented 2 years ago

Following the instructions for the conda install:

❯ latexindent
Can't locate Unicode/GCString.pm in @INC (you may need to install the Unicode::GCString module) (@INC contains: /usr/local/texlive/2021/texmf-dist/scripts/latexindent /home/mus/anaconda3/lib/perl5/5.32

Is there a fix?

cmhughes commented 2 years ago

Have you seen https://github.com/cmhughes/latexindent.pl/issues/303?

Tagging @tdegeus

tdegeus commented 2 years ago

Presumably you are on Mac's M1?

Since you happen to use conda: I advanced the fix:

conda install -c conda-forge latexindent.pl

Note that the executable there is called latexindent.pl (and not latexindent).

musm commented 2 years ago

So actually I'm on WSL (ubuntu) Yes, I've installed through

❯ conda install latexindent.pl -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

❯ latexindent
Can't locate Unicode/GCString.pm in @INC (you may need to install the Unicode::GCString module) (@INC contains: /usr/local/texlive/2021/texmf-dist/scripts/latexindent /home/mus/anaconda3/lib/perl5/5.32/site_perl /home/mus/anaconda3/lib/perl5/site_perl /home/mus/anaconda3/lib/perl5/5.32/vendor_perl /home/mus/anaconda3/lib/perl5/vendor_perl /home/mus/anaconda3/lib/perl5/5.32/core_perl /home/mus/anaconda3/lib/perl5/core_perl .) at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm line 20.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm line 20.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 41.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 41.
Compilation failed in require at /usr/local/bin/latexindent line 27.
BEGIN failed--compilation aborted at /usr/local/bin/latexindent line 27.

~
musm commented 2 years ago

Ahh I just saw that it should be latexindent.pl not latexindent

~ took 17s
❯ which latexindent
/usr/local/bin/latexindent

~
❯ which latexindent.pl
/home/mus/anaconda3/bin/latexindent.pl
tdegeus commented 2 years ago

Great! So I presume that it works?

Just a few words of explanation: Unicode::GCString is a compiled package and available on CPAN only for common hardwares. Apparently you virtual machine does not qualify. In principle you have the possibility to compile it yourself, but I presume you are just happy with the conda feedstock ?

musm commented 2 years ago

The conda installation works perfectly on my end, so presumably it's precompiled and shipped through that distribution mechanism.

I've opened https://github.com/cmhughes/latexindent.pl/pull/335 to clarify the executables name

tdegeus commented 2 years ago

The conda works, because I advanced https://github.com/cmhughes/latexindent.pl/tree/feature/no-GCString

musm commented 2 years ago

Interesting, so Unicode::GCString is no longer a required dependency and I was seeing this error since the distributed version in texlive is presumably from an earlier version of latexindent?

tdegeus commented 2 years ago

It will not be a required dependency, so texlive is just using the stable release. On conda I took the liberty to advance the fix, so let's say it's running in beta mode, until https://github.com/cmhughes/latexindent.pl/issues/303 is fixed

cmhughes commented 2 years ago

GCString is still required .

I'm trying to remove the dependency in 303. It's not guaranteed it will succeed, but I am trying.

On Thu, 3 Feb 2022, 17:58 Tom de Geus, @.***> wrote:

It will not be a required dependency, so texlive is just using the stable release. On conda I took the liberty to advise the fix, so let's say it's running in beta mode, until #303 https://github.com/cmhughes/latexindent.pl/issues/303 is fixed

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/334#issuecomment-1029251986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYFJZ3LLSLEKIUXELG3UZK63NANCNFSM5NPNTEDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

cmhughes commented 2 years ago

Implemented in https://github.com/cmhughes/latexindent.pl/releases/tag/V3.17; see also https://github.com/cmhughes/latexindent.pl/issues/303