Opened 4 years ago

Closed 3 years ago

#10847 closed defect (fixed)

"setup-common.py" test fetches dependencies

Reported by: dcf Owned by: dcf
Priority: Medium Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: infinity0, asn Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

make test or python setup-common.py test attempts to download and build M2Crypto if you don't already have it installed.

~/flashproxy$ python setup-common.py test
running test
Searching for M2Crypto
Reading https://pypi.python.org/simple/M2Crypto/
Best match: M2Crypto 0.22.3
Downloading https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz#md5=573f21aaac7d5c9549798e72ffcefedd
Processing M2Crypto-0.22.3.tar.gz
Writing /tmp/easy_install-JYaMle/M2Crypto-0.22.3/setup.cfg
Running M2Crypto-0.22.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JYaMle/M2Crypto-0.22.3/egg-dist-tmp-W0yfDL
unable to execute swig: No such file or directory
error: Setup script exited with error: command 'swig' failed with exit status 1

At least, we need to disable this network fetching somehow. From previous experience I learned that there's no way to prevent setuptools from automatically downloading packages. You can fake it out, however, by setting the http_proxy and https_proxy environment variables, which is what they do in Debian packages.

Another possible alternative is to run the tests in a way that doesn't go through setuptools.

Child Tickets

Change History (5)

comment:1 Changed 4 years ago by infinity0

Cc: asn added

adding asn because the new obfsproxy-with-scramblesuit also does this for PyYAML.

obfsproxy$ python setup.py test
running test
Searching for pyyaml
Reading https://pypi.python.org/simple/pyyaml/
Best match: PyYAML 3.10
Downloading https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.zip#md5=b1a2b30cdf481da4249c917c3307f129
Processing PyYAML-3.10.zip
Writing /tmp/easy_install-Ws4zSb/PyYAML-3.10/setup.cfg
Running PyYAML-3.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Ws4zSb/PyYAML-3.10/egg-dist-tmp-in2Tpn
[..]
Last edited 4 years ago by infinity0 (previous) (diff)

comment:2 Changed 4 years ago by dcf

This general setuptools problem also started to happen during a TBB build in #11116. The building of obfsproxy tries to download argparse.

comment:3 Changed 4 years ago by dcf

The current version of the Debian LibraryStyleGuide doesn't mention the proxy trick, but it's in this old version:
https://wiki.debian.org/Python/LibraryStyleGuide?action=recall&rev=21

comment:4 Changed 4 years ago by infinity0

We could set os.environ["http_proxy"] and os.environ["https_proxy"] by default at the top of the setup.py scripts, before the rest of setuptools is called. (Perhaps even add it as a utility to pyptlib.)

This is hacky, but we would be fixing a bug - it is true that the default behaviour of a normal build script ought not to do this sort of thing.

comment:5 Changed 3 years ago by dcf

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.