-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix make && make man when CHPL_HOME is not set #16664
Conversation
Some nightly testing configurations run `make` and then `make man` without having `CHPL_HOME` set. However, `make man` was recently changed to use `run-in-venv.bash` but this script required `CHPL_HOME` be set. This commit adjusts `run-in-venv.bash` to determine `CHPL_HOME` if it is not set and in that event to set `CHPL_HOME` for the subcommand. This allows `make && make man` to function when `CHPL_HOME` is not set. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
echo "Error: CHPL_HOME is not set" 1>&2 | ||
exit 1 | ||
# compute the chpl home directory | ||
export CHPL_HOME=$(cd $(dirname $0) ; cd ..; cd ..; pwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to export CHPL_HOME, I think we're just using it to find some scripts below. Should we instead us the FIND_CHPL_HOME
style that the start_test/sub_test wrappers use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other (Python) scripts we run currently require CHPL_HOME
to be set. It seems better to have run-in-venv sort this out than having each python script run in the venv infer CHPL_HOME
from its path.
In particular make && make docs
without CHPL_HOME
set does not work without the export here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, how did those python scripts work before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error we see without it is this:
Traceback (most recent call last):
File "/home/mppf/w/10/doc/util/chpl2rst.py", line 312, in <module>
main(**arguments)
File "/home/mppf/w/10/doc/util/chpl2rst.py", line 288, in main
preamble = gen_preamble(chapelfile, link=link)
File "/home/mppf/w/10/doc/util/chpl2rst.py", line 132, in gen_preamble
output.append(gen_link(link, chapelfile))
File "/home/mppf/w/10/doc/util/chpl2rst.py", line 74, in gen_link
chpl_home = os.path.realpath(os.getenv('CHPL_HOME'))
File "/usr/lib/python3.8/posixpath.py", line 390, in realpath
filename = os.fspath(filename)
TypeError: expected str, bytes or os.PathLike object, not NoneType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work in the 1.23 release without setting CHPL_HOME
:
make -j11 && make docs
...
cd doc && make docs
Error: CHPL_HOME is not set
make[2]: *** [Makefile:125: error_docs] Error 1
make[1]: *** [Makefile:38: docs] Error 2
make: *** [Makefile.devel:26: docs] Error 2
Follow-up to PR #16644 and #16560
Some nightly testing configurations run
make
and thenmake man
without having
CHPL_HOME
set. However,make man
was recentlychanged to use
run-in-venv.bash
but this script requiredCHPL_HOME
be set.
This PR adjusts
run-in-venv.bash
to determineCHPL_HOME
if it isnot set and in that event to set
CHPL_HOME
for the subcommand. Thisallows
make && make man
as well asmake && make docs
to function when
CHPL_HOME
is not set.While testing this PR, I noticed additionally that
make clobber
doesnot remove the generated files in
man/man1
, so this PR adjustsMakefile
andman1/Makefile
to do so.Reviewed by @ronawho - thanks!