Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests
rosuav at gmail.com
Mon Feb 18 13:48:57 EST 2019
On Tue, Feb 19, 2019 at 5:23 AM Marcin G <marcgala at hotmail.com> wrote:
> My boss wants my code to run on Python 3.5, so I thought I'd install 3.5 to be able to ascertain this.
> But Linux Mint 19 ships with Python 3.6 and python.org only provides source code for 3.5.6<https://www.python.org/downloads/release/python-356/>. So I thought I'd try compiling 3.5.6 myself.
TBH it's highly unlikely that the difference between 3.5.x and 3.5.y
will be significant here. To test that your code will run on 3.5, you
can almost certainly just grab any 3.5.
> This produced compiler warnings about: comparison between signed and unsigned, switches falling though, use of deprecated macros in glibc headers and too big object sizes leading to overflows in memcpy. This worries me the most, because it looks like undefined behavior to my untrained eye. I wonder if my system is misconfigured? Or if the configure script picks wrong sizes for some reason? Is there incompatibility between Python 3.5 and newer glibc headers?
Unfortunately a LOT of large projects spew warnings. :( It would be
awesome if we could confidently expect that a correctly-configured
system would build any released Python without warnings, but we can't,
so I would just look for actual errors.
> In addition, make test shows up one failing test: test_ssl.
Hmm. From looking at your full log (THANK YOU for posting that, btw -
so many people don't), it looks like an issue with certificate
checking. Might be a bug in the test itself. Does the same thing
happen with a more recent Python build? It could be a weirdness with
specific versions of OpenSSL.
I don't think it's going to be a killer problem. It's a failure in a
narrow part of SSL handling, one that most code won't hit.
> All I want is to have an installation that is not broken. If the above failures are false positives, I can gladly ignore them; however, since (unsupressed) warnings and failing tests are usually a sign of serious problems, I wonder what should I do get a functional installation?
> I do believe I should have all dependencies installed. First, I kept installing libraries until `make` stopped showing me info about missing bits for optional modules. Then, just to make sure, I did sudo apt-get build-dep python3. Problem is still not solved, however.
TBH I wouldn't use that as a final step - I'd use it as the first
step. It's usually going to get all, or at least nearly all, the
libraries you need; way easier than manually grabbing libraries until
make stops complaining.
Summary: I'd say you do currently have a 3.5.6 build that's viable for
testing, but you could also have picked up any other 3.5.x that might
be available in packaged form, and it would also have been
test-worthy. The test failure might be something to dive into
separately, but I believe it's okay to ignore it here.
More information about the Python-list