sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.86k stars 128 forks source link

`_build/man/rmlint.1` should be `_build/man/1/rmlint.1` in develop branch #502

Closed Flurrywinde closed 3 years ago

Flurrywinde commented 3 years ago

In compiling the develop branch, I got:

gzip_file(["docs/rmlint.1.gz"], ["docs/_build/man/rmlint.1"])
gzip: /home/kanon/code/rmlint/docs/_build/man/rmlint.1: No such file or directo
ry
Warning: could not gzip /home/kanon/code/rmlint/docs/_build/man/rmlint.1 to /ho
me/kanon/code/rmlint/docs/rmlint.1.gz: Command 'gzip -c /home/kanon/code/rmlint
/docs/_build/man/rmlint.1 > /home/kanon/code/rmlint/docs/rmlint.1.gz' returned
non-zero exit status 1.
SeeSpotRun commented 3 years ago

Hmmm, it looks like we call gzip without actually checking if it's installed, which leads to a not-very-helpful error message.

Please check output of

$ gzip -V

Edit: Oh wait, I didn't see the issue heading. I'll come back to you...

Edit 2: why do you say "should be _build/man/1/rmlint.1" ? There's nothing in the SConscript file that adds a .../1/... to the build path.

Flurrywinde commented 3 years ago

gzip -V produces gzip 1.10. As for the .../1/..., IIRC, when I saw, gzip: /home/kanon/code/rmlint/docs/_build/man/rmlint.1: No such file or directory, I did a search for rmlint.1, and I found it here: /home/kanon/code/rmlint/docs/_build/man/1/rmlint.1. It must get there somehow.

So then I edited the command in the warning and ran it myself from the command line: gzip -c /home/kanon/code/rmlint/docs/_build/man/1/rmlint.1 > /home/kanon/code/rmlint/docs/rmlint.1.gz.

SeeSpotRun commented 3 years ago

Ok that's odd. Looks like I have some reading up to do on scons and its handling of environment variables. I suspect that there is some environment-based expansion (maybe here?)

... of the string 'man' passed here: https://github.com/sahib/rmlint/blob/e9018c47554bc4316794023fa882ce2ad226bec6/docs/SConscript#L50-L57

Can you think of anything in your setup (what distro are you running) or environment that might help explain why this manifests for you and not for others?

SeeSpotRun commented 3 years ago

... maybe something to do with MANPATH or /etc/man_db.conf?

SeeSpotRun commented 3 years ago

Please try from https://github.com/SeeSpotRun/rmlint/tree/fix/manpage_path

This should use same path mapping for both sphinx and gzip.

SeeSpotRun commented 3 years ago

Ah wait, it looks like it's a new sphinx 'feature' introduced here: https://github.com/sphinx-doc/sphinx/commit/178c05b0597e144fdc2117c7b46ac15723a290e8

So sphinx is now inserting /1/ in the path but scons doesn't know about this. Have turned this off via https://github.com/SeeSpotRun/rmlint/commit/491ea0cf25ddbe4147ed49359aa1a4d9bf2d5381

Flurrywinde commented 3 years ago

Confirmed: running scons on the current develop branch produces the error, but running it with 491ea0c checked out works fine. All is well.