Subject: Re: [bug#48033] [PATCH] gnu: public-inbox: Update to 1.6.1.

From: Kyle Meyer <[email-masked]>
Date: Wed, 28 Apr 2021 00:22:27 -0400

Xinglu Chen writes:

> When adding ‘highlight’ to the inputs, one of the tests fail.
>
[...]
> failed to open(filetypes.conf): No such file or directory at /tmp/guix-build-public-inbox-1.6.1.drv-0/source/blib/lib/PublicInbox/HlMod.pm line 25.
> # Tests were run but no plan was declared and done_testing() was not seen.
> # Looks like your test exited with 2 just after 1.

Hmm, HlMod.pm is calling highlight's getFiletypesConfPath(), and it
looks like that returns a bare "filetypes.conf" (which doesn't exist)
rather than
"/gnu/store/...-highlight-3.62/share/highlight/config/filetypes.conf".

Here's what public-inbox's call boils down to:

--8<---------------cut here---------------start------------->8---
use highlight;
my $dir = highlight::DataDir->new;
$dir->initSearchDirectories('');
print $dir->getFiletypesConfPath('filetypes')."\n";
--8<---------------cut here---------------end--------------->8---

On my Debian Buster system that prints

  $ perl scratch.pl
  /etc/highlight/filetypes.conf

And when I go through Guix:

  $ guix environment -C --ad-hoc perl highlight -- perl scratch.pl
  filetypes.conf

I'm not sure why that would be.  Guix's highlight definition sets
HL_CONFIG_DIR, and that seems to get wired up correctly:

  $ guix environment -C --ad-hoc highlight -- highlight --print-config

  Config file search directories:
  /gnu/store/6a3jjm38qs80miyqpcb6j9madzy26plg-highlight-3.62/share/highlight/
  /gnu/store/6a3jjm38qs80miyqpcb6j9madzy26plg-highlight-3.62/share/highlight/config/

  Filetype config file:
  /gnu/store/6a3jjm38qs80miyqpcb6j9madzy26plg-highlight-3.62/share/highlight/config/filetypes.conf

  Compiler directive HL_DATA_DIR = /gnu/store/6a3jjm38qs80miyqpcb6j9madzy26plg-highlight-3.62/share/highlight/
  Compiler directive HL_CONFIG_DIR = /gnu/store/6a3jjm38qs80miyqpcb6j9madzy26plg-highlight-3.62/share/highlight/config/