Skip to content
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

Merged
merged 2 commits into from Nov 5, 2020

Conversation

mppf
Copy link
Member

@mppf mppf commented Nov 5, 2020

Follow-up to PR #16644 and #16560

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 PR 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 as well as make && make docs
to function when CHPL_HOME is not set.

While testing this PR, I noticed additionally that make clobber does
not remove the generated files in man/man1, so this PR adjusts
Makefile and man1/Makefile to do so.

Reviewed by @ronawho - thanks!

  • make && make man && make docs works
  • test/chpldoc/ passes

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)
Copy link
Contributor

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?

Copy link
Member Author

@mppf mppf Nov 5, 2020

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.

Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Member Author

@mppf mppf Nov 5, 2020

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

@mppf mppf merged commit 04730b9 into chapel-lang:master Nov 5, 2020
@mppf mppf deleted the fix-make-make-man branch November 5, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants