Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
From Mats Wichmann:
- Fix typos in CCFLAGS test. Didn't affect the test itself, but
didn't correctly apply the DefaultEnvironment speedup.
- Try to fix Windows fails on Docbook tests in case xsltproc is found.
It's still not certain why this started failing. On both GitHub
Actions and AppVeyor, it's found as part of StrawberryPerl, part of
the default install - maybe this wasn't the case before? The xsltproc
from choco install is considerably older and may have been more lenient?
Anyway, intermittent fails seem caused by something network related,
so propagate two xsltproc flags that avoid loading the dtd that were
present in three of the 11 "live" tests, but not the other eight.
Also, all 11 now pass the test-discovered xslt processor the same
way, which was not the case previously.


RELEASE 4.9.0 - Sun, 02 Mar 2025 17:22:20 -0700
Expand Down
30 changes: 18 additions & 12 deletions SCons/Tool/docbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,22 @@ def __create_output_dir(base_dir) -> None:
# TODO: Set minimum version of saxon-xslt to be 8.x (lower than this only supports xslt 1.0.
# see: https://saxon.sourceforge.net/saxon6.5.5/
# see: https://saxon.sourceforge.net/
xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
# Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)
# 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS',
'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}
xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}
fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}
xsltproc_com = {
'xsltproc': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
'saxon': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
# Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)
# 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS',
'saxon-xslt': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
'xalan': '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE',
}
xmllint_com = {
'xmllint': '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'
}
fop_com = {
'fop': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
'xep': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
'jw': '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET',
}

def __detect_cl_tool(env, chainkey, cdict, cpriority=None) -> None:
"""
Expand All @@ -180,11 +186,11 @@ def __detect_cl_tool(env, chainkey, cdict, cpriority=None) -> None:
cpriority = cdict.keys()
for cltool in cpriority:
if __debug_tool_location:
print("DocBook: Looking for %s"%cltool)
print(f"DocBook: Looking for {cltool}")
clpath = env.WhereIs(cltool)
if clpath:
if __debug_tool_location:
print("DocBook: Found:%s"%cltool)
print(f"DocBook: Found:{cltool}")
env[chainkey] = clpath
if not env[chainkey + 'COM']:
env[chainkey + 'COM'] = cdict[cltool]
Expand Down
4 changes: 2 additions & 2 deletions test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
test.dir_fixture('image')

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

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

test.pass_test()
Expand Down
4 changes: 4 additions & 0 deletions test/Docbook/basedir/htmlchunked/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

DefaultEnvironment(tools=[])
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookHtmlChunked('manual', xsl='html.xsl', base_dir='output/')
4 changes: 2 additions & 2 deletions test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
test.dir_fixture('image')

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

# Cleanup
test.run(arguments=['-f','SConstruct.cmd','-c'])
test.run(arguments=['-f','SConstruct.cmd','-c','DOCBOOK_XSLTPROC=%s'%xsltproc])
test.must_not_exist(test.workpath('output/index.html'))
test.must_not_exist(test.workpath('htmlhelp.hhp'))
test.must_not_exist(test.workpath('toc.hhc'))
Expand Down
4 changes: 4 additions & 0 deletions test/Docbook/basedir/htmlhelp/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@

DefaultEnvironment(tools=[])
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/')

3 changes: 3 additions & 0 deletions test/Docbook/basedir/slideshtml/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if v >= (1, 78, 0):

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

4 changes: 2 additions & 2 deletions test/Docbook/basedir/slideshtml/slideshtml_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
test.dir_fixture('image')

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

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

test.pass_test()
Expand Down
2 changes: 1 addition & 1 deletion test/Docbook/basic/epub/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookEpub('manual')
2 changes: 1 addition & 1 deletion test/Docbook/basic/html/html_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
test.dir_fixture('image')

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

# Cleanup
Expand Down
2 changes: 1 addition & 1 deletion test/Docbook/basic/html/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookHtml('manual')

2 changes: 1 addition & 1 deletion test/Docbook/basic/htmlchunked/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookHtmlChunked('manual')

2 changes: 1 addition & 1 deletion test/Docbook/basic/htmlhelp/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookHtmlhelp('manual')

2 changes: 1 addition & 1 deletion test/Docbook/basic/man/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookMan('refdb')

2 changes: 1 addition & 1 deletion test/Docbook/basic/pdf/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC

env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookPdf('manual')

3 changes: 3 additions & 0 deletions test/Docbook/basic/slideshtml/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if v >= (1, 78, 0):

DefaultEnvironment(tools=[])
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookSlidesHtml(
'virt' + ns_ext,
Expand Down
4 changes: 2 additions & 2 deletions test/Docbook/basic/slideshtml/slideshtml_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
test.dir_fixture('image')

# Normal invocation
test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
test.must_not_be_empty(test.workpath('index.html'))
test.must_contain(test.workpath('index.html'), 'sfForming')

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

test.pass_test()
Expand Down
3 changes: 3 additions & 0 deletions test/Docbook/basic/slidespdf/image/SConstruct.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

DefaultEnvironment(tools=[])
env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
DOCBOOK_XSLTPROC = ARGUMENTS.get('DOCBOOK_XSLTPROC', "")
if DOCBOOK_XSLTPROC:
env['DOCBOOK_XSLTPROC'] = DOCBOOK_XSLTPROC
env.Append(DOCBOOK_XSLTPROCFLAGS=['--novalid', '--nonet'])
env.DocbookSlidesPdf('virt')

4 changes: 2 additions & 2 deletions test/Docbook/basic/slidespdf/slidespdf_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
test.dir_fixture('image')

# Normal invocation
test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
test.run(arguments=['-f','SConstruct.cmd','DOCBOOK_XSLTPROC=%s'%xsltproc], stderr=None)
test.must_not_be_empty(test.workpath('virt.fo'))
test.must_not_be_empty(test.workpath('virt.pdf'))

# Cleanup
test.run(arguments=['-f','SConstruct.cmd','-c'], stderr=None)
test.run(arguments=['-f','SConstruct.cmd','-c','DOCBOOK_XSLTPROC=%s'%xsltproc])
test.must_not_exist(test.workpath('virt.fo'))
test.must_not_exist(test.workpath('virt.pdf'))

Expand Down
Loading