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

[manpages] the BuildMan target does not work during the Debian build process #646

Open
picca opened this issue Aug 2, 2017 · 3 comments

Comments

@picca
Copy link
Collaborator

picca commented Aug 2, 2017

Hello, now thaht I can run the BuildMan via

python setup.py build and the right options during the Debian build, I get this in the generated manpages.

.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
.TH TRACEBACK "1" "July 2017" "Traceback (most recent call last):" "User Commands"
.SH NAME
Traceback \- manual page for Traceback (most recent call last):
.SH DESCRIPTION
.SS "Traceback (most recent call last):"
.IP
File "/tmp/check_calib_u1jdOA", line 2, in <module>
.IP
import pyFAI.app.check_calib as app
.IP
File "/home/picca/Debian/pyfai/pyfai/pyFAI/__init__.py", line 48, in <module>
.IP
raise RuntimeError("Do NOT use %s from its sources: build it and use the built version" % project)
.PP
RuntimeError: Do NOT use pyFAI from its sources: build it and use the built version
[29579 refs]
.IP
File "/tmp/check_calib_u1jdOA", line 2, in <module>
.IP
import pyFAI.app.check_calib as app
.IP
File "/home/picca/Debian/pyfai/pyfai/pyFAI/__init__.py", line 48, in <module>
.IP
raise RuntimeError("Do NOT use %s from its sources: build it and use the built version" % project)
.PP
RuntimeError: Do NOT use pyFAI from its sources: build it and use the built version
[29579 refs]
.SH "SEE ALSO"
The full documentation for
.B Traceback
is maintained as a Texinfo manual.  If the
.B info
and
.B Traceback
programs are properly installed at your site, the command
.IP
.B info Traceback
.PP
should give you access to the complete manual.

As you can see I get a RuntimeError, So the pyFAI loaded by the script is the one from the source.
I need to figure out why this is the case.

The first culprite could be the PYTHONPATH modification done in the BuildMan

I would say. never ever modify an USER env in a setup.py script.

this is why in the autotolls you have

CFLAGS and AM_CGLAGS for the maintainer.

this is the principe of less surpise ;)

@picca
Copy link
Collaborator Author

picca commented Aug 2, 2017

I can confirm that

-        env["PYTHONPATH"] = os.pathsep.join(path)
+        #env["PYTHONPATH"] = os.pathsep.join(path)

solve the issue during the Debian build

@vallsv
Copy link
Collaborator

vallsv commented Aug 2, 2017

We anyway have to inject the build_lib path to the subprocess. The env of the setup is not the same as the env needed for help2man. How do you execute the BuildMan BTW? I don't understand this part.

We uses

python setup.py build build_man

@picca
Copy link
Collaborator Author

picca commented Sep 4, 2017

This is how I need to build the manpages.

override_dh_auto_build:
        dh_auto_build
        PYBUILD_SYSTEM=custom \
        PYBUILD_BUILD_ARGS="PYTHONPATH={build_dir} xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} setup.py build_man" dh_auto_build

indeed this is done with the PYTHONPATH commented explained previously.

I just discoverd that the build_man failed with python3 when I do not use xvfb.
So it seems that with python3 the --help command request a working X windows system.
This is not true with python2

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