tealdeer-rs / tealdeer

A very fast implementation of tldr in Rust.
https://tealdeer-rs.github.io/tealdeer/
Apache License 2.0
4.17k stars 123 forks source link

Cache not found but update successful #371

Closed mat-m closed 3 months ago

mat-m commented 3 months ago

on RedHat 8, with tldr 1.4.1

The cache is updated and filled (41M), but the command do not find it.

Technical info below

~/[0]>tldr ls
Cache not found. Please run `tldr --update`.
~/[1]>tldr --update
Successfully updated cache.
~/[0]>echo $?
0
~/[0]>ls -ln /home/env/adlbin/.cache/tealdeer/tldr-main/ | tail -2
-rw-rw-r--  1 994 932    45 Jul 11 19:49 requirements.txt
drwxrwxr-x  3 994 932  4096 Jul 12 17:30 scripts
~/[0]>tldr ls
Cache not found. Please run `tldr --update`.
~/[1]>tldr -v
tealdeer v1.4.1 (Linux)
~/[0]>file $(which tldr)
/usr/local/bin/tldr: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
niklasmohrin commented 3 months ago

The problem is that when v1.4.1 was released (September 2020!), the pages repository still used "master" as the main branch name and we thus expect the folder to be called tldr-master (see here in the code). However, when downloading from https://github.com/tldr-pages/tldr/archive/master.tar.gz , we get a file named tldr-main.zip (and also containing the folder tldr-main, as seen in your output).

As a workaround, you can rename the folder under .cache/tealeer so that it is called tldr-master instead. The best solution however would be to update to a newer version - nowadays, the pages come through an archive from tldr.sh that should be more stable than the direct github download.

mat-m commented 3 months ago

Since I can't control the version installed, I symlinked tldr-master to tldr-main.

Thank you for the explanation, that helped

ernstki commented 1 month ago

The problem is that when v1.4.1 was released (September 2020!)

I'm happy to have a workaround, but please allow me to respectfully make a case for trying to keep old things working, too.

If it were an oh-dot-something software, okay, it would be a different story, but it's a one-dot-something software. My gut tells me that simply keeping the master branch where it was and moving forward with main would let all your 1.4.1 installs continue working forever.

No, this is not some great tragedy, and yes, I get it's a volunteer-run project with NO WARRANTY EXPRESSED OR IMPLIED, and you provide binaries, but it's the principle of the thing.

Maybe you were concerned that keeping an out-of-date master branch (stuck in the 1.4.1 days) around might confuse people. That seems legit. If that was the case, I understand.

Thanks, regardless.

niklasmohrin commented 1 month ago

I agree, however, the missing branch is from the tldr-pages repository and not ours. Today's tealdeer does some automatic migration for backwards compatibility, but our build from 2020 could not predict that the structure of the pages archive would change, so there is no backwards migration.

I suppose we could release some 1.4.1 build with such a backwards migration, but I am unsure I want to publish a release with outdated dependencies. If the demand is high enough (and we would know that our patch-release would make it into distro repositories where the problem currently occurs), I suppose we could check whether we can come up with something

ernstki commented 2 weeks ago

I agree, however, the missing branch is from the tldr-pages repository and not ours.

That's a good point, which I hadn't considered. I don't suppose there's a demand for it, and regarding the distros, I believe that would be the distro package maintainers' responsibility anyway, not yours. As for end users, even in our definitely-not-cutting-edge HPC environment I was easily able to build a new binary.

Thanks for your thoughtful reply.