Bug#1017109: Bug #1017109: issue building the /*/devel/website/stats/*.wml files with Debian 11's wml version

2022-08-14 Thread Laura Arjona Reina



It seems that the changes in Makefile work for Chinese too, I may have a 
missing dependency y my local environment causing my former failures.

I'll leave this open for a while for the case somebody comes with a better 
solution. If not, will close the bug in several days.

Note that the change also fixed the path to CSS (mentioned in 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924172#75 ) so I may close 
that bug too.

Kind regards

-- 
Laura Arjona Reina
https://wiki.debian.org/LauraArjona
Sent with K-9 mail



Bug#1017109: issue building the /*/devel/website/stats/*.wml files with Debian 11's wml version

2022-08-13 Thread Laura Arjona Reina

Package: www.debian.org
User: www.debian@packages.debian.org
Usertag: scripts
Severity: normal
X-Debbugs-CC: a...@debian.org

Hello all
After upgrading www-master from Debian 10 buster (wml 2.12.2) to Debian 
11 bullseye (wml 2.32.0), we're experiencing an issue when building the 
stats files for the website:


make[4]: Entering directory 
'/srv/www.debian.org/webwml/english/devel/website/stats'
wml -q -D CUR_YEAR=2022 -o UNDEFuEN:ar.en.html@g+w   -D CUR_LANG=English 
-D CUR_ISO_LANG=en -D CUR_LOCALE=en_US.UTF-8 -D CHARSET=utf-8 \

../../../../english/devel/website/stats/ar.wml
ePerl:Error: Perl runtime error (interpreter rc=2)

 Contents of STDERR channel: -
couldn't open ./../../../../index.wml or 
/srv/www.debian.org/webwml/english/devel/website/stats/../../../../index.wml: 
No such file or directory

Died at /tmp/kZRxwsy3aN/wml.tmp1 line 747.
--
** WML:Break: Error in Pass 3 (rc=1).
Died at /usr/share/wml/TheWML/Frontends/Wml/Runner.pm line 402.
 
TheWML::Frontends::Wml::Runner::_run_pass(TheWML::Frontends::Wml::Runner=HASH(0x55c872bf8850),
 3, SCALAR(0x55c8731471c8), REF(0x55c873147198), REF(0x55c8731471b0)) called at 
/usr/share/wml/TheWML/Frontends/Wml/Runner.pm line 440
 
TheWML::Frontends::Wml::Runner::_passes_loop(TheWML::Frontends::Wml::Runner=HASH(0x55c872bf8850))
 called at /usr/share/wml/TheWML/Frontends/Wml/Runner.pm line 727
 
TheWML::Frontends::Wml::Runner::_output_and_cleanup(TheWML::Frontends::Wml::Runner=HASH(0x55c872bf8850))
 called at /usr/share/wml/TheWML/Frontends/Wml/Runner.pm line 932
 
TheWML::Frontends::Wml::Runner::run_with_ARGV(TheWML::Frontends::Wml::Runner=HASH(0x55c872bf8850),
 HASH(0x55c872df9390)) called at /usr/bin/wml line 47
make[4]: *** [Makefile:33: ar.en.html] Error 2
make[4]: Leaving directory 
'/srv/www.debian.org/webwml/english/devel/website/stats'

make[3]: [../../../Makefile.common:84: stats-install] Error 2 (ignored)
make[3]: Leaving directory 
'/srv/www.debian.org/webwml/english/devel/website'


The error happens with all the files in the "stats" folder, in all the 
languages.
I have checked that the source wml files (created with the script 
stattrans.pl) are similar with buster and bullseye. It seems the problem 
is in how the file is referenced when passed to wml: if I try to build 
the file like this:


wml -q -D CUR_YEAR=2022 -o UNDEFuEN:ar.en.html@g+w   -D CUR_LANG=English 
-D CUR_ISO_LANG=en -D CUR_LOCALE=en_US.UTF-8 -D CHARSET=utf-8 ar.wml


then it builds fine. If I try

wml -q -D CUR_YEAR=2022 -o UNDEFuEN:ar.en.html@g+w   -D CUR_LANG=English 
-D CUR_ISO_LANG=en -D CUR_LOCALE=en_US.UTF-8 -D CHARSET=utf-8 
../stats/ar.wml


 again it builds fine, the same with 
../../../devel/website/stats/ar.wml but it fails when the file is 
referenced as "../../../../english/devel/website/stats/ar.wml"


I am not sure if this happens because with that path are two .wmlrc 
files involved, or because the new wml version is buggy about how it 
handles long relative paths.


For now, I suggest to workaround the issue changing the corresponding 
line in the english/devel/website/stats/Makefile:


-%.$(LANGUAGE).html: $(ENGLISHDIR)/$(CUR_DIR)/%.wml 
$(LOCALEDIR)/stats.mo | $(VCSREVCACHE)

+%.$(LANGUAGE).html: %.wml $(LOCALEDIR)/stats.mo | $(VCSREVCACHE)

then the English folders builds fine, but we would need to create 
symbolic links in the other languages /devel/website/stats, in a similar 
way as it was done with the sitemap.wml in bug #924172, so they can be 
built too. I don't know how to do this, though, I've added this code to  
/english/devel/website/stats/Makefile:


ifneq "$(LANGUAGE)" "en"

%.wml:
    $(shell ln -s $(ENGLISHDIR)/$(CUR_DIR)/*.wml .)
endif

prior to the %.$(LANGUAGE).html recipe, and it seems it works for all 
languages except Chinese (variants):


wml -q -D CUR_YEAR=2022 -O1 -o 
UNDEFuZH@uCNuCNHKuCNTW:ar.zh-cn.html.tmp@g+w -o 
UNDEFuZH@uHKuCNHKuHKTWuTWHK:ar.zh-hk.html.tmp@g+w -o 
UNDEFuZH@uTWuCNTWuHKTWuTWHK:ar.zh-t
w.html.tmp@g+w --prolog=../../../bin/format_zh.pl 
--epilog=../../../bin/strip_initial_blank_line.sh -D CUR_LANG=Chinese -D 
CUR_ISO_LANG=zh -D CUR_LOCALE=zh_CN.UTF-8 -D

CHARSET=UTF-8 \
ar.wml
Can't call method "Clone" on an undefined value at 
/usr/share/wml/SliceTermParser.pm line 285.

   
SliceTermParser::__ANON__(TheWML::Backends::Slice::Main=HASH(0x564e54d0cec8), 
HASH(0x564e54d0cf88)) called at /usr/share/wml/TheWML/Backends/Slice/Main.pm 
line
600
   
TheWML::Backends::Slice::Main::pass3(TheWML::Backends::Slice::Main=HASH(0x564e54d0cec8))
 called at /usr/share/wml/TheWML/Backends/Slice/Main.pm line 650
   
TheWML::Backends::Slice::Main::main(TheWML::Backends::Slice::Main=HASH(0x564e54d0cec8))
 called at /usr/share/wml/TheWML/Frontends/Wml/PassesManager.pm line 291
   TheWML::Frontends::Wml::PassesManager::__ANON__("-o", 
"UNDEFuZH\@uCNuCNHKuCNTW:ar.zh-cn.html.tmp\@g+w", "-o", 
"UNDEFuZH\@uHKuCNHKuHKTWuTWHK:ar.zh-hk.html.tmp\@
g+w", "-o",