[Chapel Merge] Add errors when using same location for chpldoc Sphinx files and output files

Branch: refs/heads/main
Revision: e4601d0d54fa842d22789a864af4d1bba35cc64c
Author: lydia-duncan
Link: Add errors when using same location for chpldoc Sphinx files and output files by lydia-duncan · Pull Request #25574 · chapel-lang/chapel · GitHub
Log Message:
Add errors when using same location for chpldoc Sphinx files and output files (#25574)

[reviewed by @DanilaFe]

Resolves #16904

There's two scenarios where this is problematic, both of which involve
expecting to generate both .rst and .html files:

  • --save-sphinx and --output-dir have been explicitly defined to the
    same location
  • --save-sphinx has been overridden to use the same location as the
    default for --output-dir

Add a specialized error messages for both cases.

Update the future requesting the error message for its actual output and
resolve it. I ended up wanting the error message to be broader as a
result of there likely being more scenarios where this would be a
problem, so update the test to reflect the new intended message. While
there, also add a few more flag combinations to ensure the behavior is
as expected. The test now covers:

  • --save-sphinx using the default output directory
  • --save-sphinx and --output-dir being both explicitly set to "docs"
  • --save-sphinx and --output-dir being both explicitly set to
    something else entirely
  • --save-sphinx being set to "docs" and --output-dir being set to
    something else

The test now also ensures that we don't put things in the directories
when there's a problem any more.

Passed a paratest with futures

Compare: Comparing 0c1c4276d2648c1ab1725b7f412fcfd33a0aea12...bf88b52b09efac25e0d5967645bfd0eec7da235c · chapel-lang/chapel · GitHub

Diff:
M test/chpldoc/compflags/folder/save-sphinx/.gitignore
A test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.allowed.good
D test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.bad
A test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.catfiles
M test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.chpldocopts
A test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.cleanfiles
A test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.explicit.good
D test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.future
M test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.good
M test/chpldoc/compflags/folder/save-sphinx/saveSphinxInDocs.doc.prediff
M tools/chpldoc/chpldoc.cpp
https://github.com/chapel-lang/chapel/pull/25574.diff