0037304: Build scripts: abort execution when an external command fails - MantisBT

View Issue Details

IDProjectCategoryView StatusDate SubmittedLast Update
0037304mantisbttoolspublic2026年07月12日 09:492026年07月17日 07:00
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037304: Build scripts: abort execution when an external command fails
Description

The main build script (buildrelease-repo.py) is relies on helper scripts (buildrelease.py and docbook-manual.py).

If an external command fails within one of these child scripts, the error is shown on screen but the exit code is not captured by the caller, which continues its execution as though everything ran successfully.

(...)
Running /Users/dregad/bin/publican clean
/Users/dregad/dev/mantisbt/mantis/docbook/Admin_Guide
ERROR: Command '['/Users/dregad/bin/publican', 'clean']' returned non-zero exit status 1.
Creating release tarballs...
(...)

Execution should have stopped after ERROR.

Steps To Reproduce
  1. Make publican unavailable (e.g. rename, chmod, stop docker, etc)
  2. Run build/buildrelease-repo.py --fresh --docbook --ref release-2.28.4 --clean /tmp/release
Additional Information

This caused the release zip / tarball for 2.28.4 to be published on sourceforge without the documentation.

Reported by @atrol on Gitter.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master d2add93a

2026年07月12日 11:06

dregad


Details Diff Call subprocess.run to build manuals

With check=True, an exception is thrown if the command fails, allowing
error handling.

This required adapting the command from string to list so it can be
called without initializing a shell.

Fixes 0037304 Affected Issues
0037304
mod - build/buildrelease-repo.py Diff File
mod - build/buildrelease.py Diff File

MantisBT: master 25b71dbd

2026年07月12日 11:43

dregad


Details Diff Publican does not output anything to stderr

Print stdout in the exception block.

Also, using subprocess.run in Text mode avoids the need to call decode
on the output.

Issue 0037304 Affected Issues
0037304
mod - build/docbook-manual.py Diff File

MantisBT: master 6f31c5e3

2026年07月17日 06:54

dregad


Details Diff Improve error output of run_publican() function

There *can* be stderr output when publican execution fails due to a
system error (e.g. docker not running).

Follow-up on 25b71dbd50506eb41c9bbbdc2a126e3376408587.

Issue 0037304 Affected Issues
0037304
mod - build/docbook-manual.py Diff File
Powered by MantisBT 2.29.0-dev-master-e4ff7ef87
Copyright © 2000 - 2026 MantisBT Team
Contact administrator for assistance
Page execution time: 0.2729 seconds    

AltStyle によって変換されたページ (->オリジナル) /