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

Cannot build the doc target on Linux-Arch64 (virtualenv uses python3) #209

Closed
JodiTheTigger opened this issue Oct 15, 2015 · 9 comments
Closed

Comments

@JodiTheTigger
Copy link
Contributor

Trying to pass the CI tests for Issue #205 (Issue #208), and it fails to build the doc target.

So I tried to build it myself, and get introduced to the hellish world of python dependencies.

My fundamental problem is that I have both python2 and python3 installed, and it seems even though the doc script is python2 #!/usr/bin/env python2 the virtualenv and pip utilities are using python3. I'm pretty sure that's bad.

New python executable in virtualenv/bin/python3
Also creating executable in virtualenv/bin/python
@JodiTheTigger
Copy link
Contributor Author

In build.py:25 I changed
check_call(['virtualenv', virtualenv_dir])
to
check_call(['virtualenv2', virtualenv_dir])

And it seemed to solve the python3 problem.

Now I get

1.4a0
Traceback (most recent call last):
  File "/home/richard/Code/cppformat/doc/build.py", line 86, in <module>
    build_docs()
  File "/home/richard/Code/cppformat/doc/build.py", line 82, in build_docs
    'html/_static/cppformat.css'])
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
ninja: build stopped: subcommand failed.

Seems cppformat.css is missing.

> ls doc/html/_static/*.css
doc/html/_static/basic.css  doc/html/_static/breathe.css  doc/html/_static/pygments.css

@vitaut
Copy link
Contributor

vitaut commented Oct 15, 2015

Thanks for the bug report. cppformat.css is the name of the output file, so it's not why the command fails. But do you have less (lessc) installed?

Regarding the python2/python3 issue, the only reason why build.py uses Python 2 is because execfile doesn't work in Python 3. Do you know if there a portable equivalent?

@JodiTheTigger
Copy link
Contributor Author

Ah, I didn't have lessc (or node, npm, less-plugin-clean-css) installed.

So I installed them all, and my build of doc works fine.

So this bug is for python2/3 multi installs (need to call virtualenv2, if it exists, over virtualenv).

Maybe you need to note that you need to have a look at cppformat/support/travis-build.py for the dependencies for building the doc target.

@JodiTheTigger
Copy link
Contributor Author

As an aside, could you check why my pull request for #208 is failing? Since I can now build doc fine locally.

@JodiTheTigger
Copy link
Contributor Author

Sorry, I don't quite know what the execfile replacement is for python3.

Maybe stack overflow can help?
http://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3-0

@vitaut
Copy link
Contributor

vitaut commented Oct 16, 2015

Maybe you need to note that you need to have a look at cppformat/support/travis-build.py for the dependencies for building the doc target.

Most of the dependencies are installed automatically, but I've improved the error message in a596b87. Now it should give

lessc not found; make sure that Less (http://lesscss.org/) is installed

instead of exception and stack trace.

@JodiTheTigger
Copy link
Contributor Author

I wasn't building the doc target via travis-ci. I was building it locally. The error message will help, but I installed the lessc npm, only to have it fail as I didn't install the clean-css plugin (which for me was a seperate install locally).

Anyway, that is all off topic.

Does virtualenv2 exist on your python install? maybe run that instead of virtualenv (which will default to pytohn3 for multi python installs).

@vitaut
Copy link
Contributor

vitaut commented Oct 17, 2015

I don't have virtualenv2, but the issues should be fixed in 5898720. Now the script is compatible with both Python 2 and Python 3.

@vitaut
Copy link
Contributor

vitaut commented Oct 17, 2015

And I've added section Building the documentation with the list of dependencies. Hope I haven't missed anything.

Thanks!

@vitaut vitaut closed this as completed Oct 17, 2015
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

No branches or pull requests

2 participants