Skip to content

Commit c9e65f5

Browse files
committed
Exp: try to make the Windows Docbook tests better
Try to fix Windows fails on Docbook tests in case xsltproc is found. On both GitHub Actions and AppVeyor, it's found as part of StrawberryPerl, which is part of the default install. Intermittent fails seem caused by network issues (whether actual problems, or forced revectoring to https not supported by xsltproc according to some internet issue reports), so propagate two xsltproc flags for this that were in three of the "live" (named "cmd" here) tests, but not the others. Also made other parts of the setup of these tests more consistent (passing found xsltproc wasn't done) Signed-off-by: Mats Wichmann <[email protected]>
1 parent cd43bf7 commit c9e65f5

File tree

19 files changed

+58
-29
lines changed

19 files changed

+58
-29
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
1818
From Mats Wichmann:
1919
- Fix typos in CCFLAGS test. Didn't affect the test itself, but
2020
didn't correctly apply the DefaultEnvironment speedup.
21+
- Try to fix Windows fails on Docbook tests in case xsltproc is found.
22+
On both GitHub Actions and AppVeyor, it's found as part of
23+
StrawberryPerl, which is part of the default install. Intermittent
24+
fails seem caused by network issues, so propagate two xsltproc flags
25+
for this that were in three of the "live" (named "cmd" here) tests,
26+
but not the others. Also made other parts of the setup more consistent.
2127

2228

2329
RELEASE 4.9.0 - Sun, 02 Mar 2025 17:22:20 -0700

SCons/Tool/docbook/__init__.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,22 @@ def __create_output_dir(base_dir) -> None:
157157
# TODO: Set minimum version of saxon-xslt to be 8.x (lower than this only supports xslt 1.0.
158158
# see: https://saxon.sourceforge.net/saxon6.5.5/
159159
# see: https://saxon.sourceforge.net/
160-
xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
161-
'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
162-
# Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)
163-
# 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS',
164-
'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
165-
'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}
166-
xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}
167-
fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
168-
'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
169-
'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}
160+
xsltproc_com = {
161+
'xsltproc': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
162+
'saxon': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
163+
# Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)
164+
# 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS',
165+
'saxon-xslt': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
166+
'xalan': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE',
167+
}
168+
xmllint_com = {
169+
'xmllint': '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'
170+
}
171+
fop_com = {
172+
'fop': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
173+
'xep': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
174+
'jw': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET',
175+
}
170176

171177
def __detect_cl_tool(env, chainkey, cdict, cpriority=None) -> None:
172178
"""
@@ -180,11 +186,11 @@ def __detect_cl_tool(env, chainkey, cdict, cpriority=None) -> None:
180186
cpriority = cdict.keys()
181187
for cltool in cpriority:
182188
if __debug_tool_location:
183-
print("DocBook: Looking for %s"%cltool)
189+
print(f"DocBook: Looking for {cltool}")
184190
clpath = env.WhereIs(cltool)
185191
if clpath:
186192
if __debug_tool_location:
187-
print("DocBook: Found:%s"%cltool)
193+
print(f"DocBook: Found:{cltool}")
188194
env[chainkey] = clpath
189195
if not env[chainkey + 'COM']:
190196
env[chainkey + 'COM'] = cdict[cltool]

test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
test.dir_fixture('image')
4141

4242
# Normal invocation
43-
test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
43+
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
4444
test.must_not_be_empty(test.workpath('output/index.html'))
4545

4646
# Cleanup
47-
test.run(arguments=['-f','SConstruct.cmd','-c'])
47+
test.run(arguments=['-f','SConstruct.cmd','-c','DOCBOOK_XSLTPROC=%s'%xsltproc])
4848
test.must_not_exist(test.workpath('output/index.html'))
4949

5050
test.pass_test()

test/Docbook/basedir/htmlchunked/image/SConstruct.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44

55
DefaultEnvironment(tools=[])
66
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
7+
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
8+
if DOCBOOK_XSLTPROC:
9+
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
10+
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
711
env.DocbookHtmlChunked('manual', xsl='html.xsl', base_dir='output/')

test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
test.dir_fixture('image')
4141

4242
# Normal invocation
43-
test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
43+
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
4444
test.must_not_be_empty(test.workpath('output/index.html'))
4545
test.must_not_be_empty(test.workpath('htmlhelp.hhp'))
4646
test.must_not_be_empty(test.workpath('toc.hhc'))
4747

4848
# Cleanup
49-
test.run(arguments=['-f','SConstruct.cmd','-c'])
49+
test.run(arguments=['-f','SConstruct.cmd','-c','DOCBOOK_XSLTPROC=%s'%xsltproc])
5050
test.must_not_exist(test.workpath('output/index.html'))
5151
test.must_not_exist(test.workpath('htmlhelp.hhp'))
5252
test.must_not_exist(test.workpath('toc.hhc'))

test/Docbook/basedir/htmlhelp/image/SConstruct.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44

55
DefaultEnvironment(tools=[])
66
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
7+
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
8+
if DOCBOOK_XSLTPROC:
9+
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
10+
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
711
env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/')
812

test/Docbook/basedir/slideshtml/image/SConstruct.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ if v >= (1, 78, 0):
1313

1414
DefaultEnvironment(tools=[])
1515
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
16+
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
17+
if DOCBOOK_XSLTPROC:
18+
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
1619
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
1720
env.DocbookSlidesHtml('virt'+ns_ext, xsl='slides.xsl', base_dir='output/')
1821

test/Docbook/basedir/slideshtml/slideshtml_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
test.dir_fixture('image')
4141

4242
# Normal invocation
43-
test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
43+
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
4444
test.must_not_be_empty(test.workpath('output/index.html'))
4545
test.must_contain(test.workpath('output/index.html'), 'sfForming')
4646

4747
# Cleanup
48-
test.run(arguments=['-f','SConstruct.cmd','-c'], stderr=None)
48+
test.run(arguments=['-f','SConstruct.cmd','-c','DOCBOOK_XSLTPROC=%s'%xsltproc])
4949
test.must_not_exist(test.workpath('output/index.html'))
5050

5151
test.pass_test()

test/Docbook/basic/epub/image/SConstruct.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
77
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
88
if DOCBOOK_XSLTPROC:
99
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
10-
10+
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
1111
env.DocbookEpub('manual')

test/Docbook/basic/html/html_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
test.dir_fixture('image')
3939

4040
# Normal invocation
41-
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc])
41+
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
4242
test.must_not_be_empty(test.workpath('manual.html'))
4343

4444
# Cleanup

0 commit comments

Comments
 (0)