Bug 223320 - security/obfsproxy: fails to run
Summary: security/obfsproxy: fails to run
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Carlos J. Puga Medina
URL:
Keywords: patch, patch-ready
: 223332 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-30 08:41 UTC by Hadi
Modified: 2017-11-18 12:42 UTC (History)
3 users (show)

See Also:
cpm: maintainer-feedback? (cs)


Attachments
patch (1.45 KB, patch)
2017-11-03 11:36 UTC, Carlos J. Puga Medina
cpm: maintainer-approval? (cs)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hadi 2017-10-30 08:41:16 UTC
FreeBSD hadi-pc.my.domain 11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 #0: Wed Aug  9 11:55:48 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  


I'm using Tor+obfsproxy for surfacing web, but for some reason obfsproxy doesnt seems to work after recent updates:

[hadi@hadi-pc /usr/home/hadi]$ obfsproxy
Traceback (most recent call last):
  File "/usr/local/bin/obfsproxy", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3019, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 655, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 963, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'argparse' distribution was not found and is required by obfsproxy


https://forums.freebsd.org/threads/61465/ :
It seems obfsproxy has to make argparse dependency conditional :

--- setup.py.orig    2014-12-31 16:34:31.000000000 +0100
+++ setup.py    2017-07-01 12:13:23.655178000 +0200
@@ -31,12 +31,14 @@
     install_requires = [
         'setuptools',
         'PyCrypto',
-        'Twisted',
-        'argparse',
+        'Twisted_Core',
         'pyptlib >= 0.0.6',
         'pyyaml'
         ],

+    if sys.version_info < (2, 7):
+        install_requires.append('argparse')
+
     extras_require = {
         'SOCKS': ["txsocksx"]
         }
Comment 1 Hadi 2017-10-30 09:11:49 UTC
I'm not familiar with obfsproxy port structure, but i want to know if obfs4 will be supported with this port ? or it has to be done with another port ?
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2017-10-31 06:47:05 UTC
*** Bug 223332 has been marked as a duplicate of this bug. ***
Comment 3 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-11-03 11:36:13 UTC
Created attachment 187690 [details]
patch

- Make argparse a conditional dependency
- Pet portlint, USE_* comes before USES
- Bump PORTREVISION
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-11-18 12:42:12 UTC
A commit references this bug:

Author: cpm
Date: Sat Nov 18 12:41:18 UTC 2017
New revision: 454427
URL: https://svnweb.freebsd.org/changeset/ports/454427

Log:
  security/obfsproxy: Make argparse a conditional dependency

  Backport a patch to setup.py making argparse a conditional dependency
  to fix the following error at runtime:

  pkg_resources.DistributionNotFound: The 'argparse' distribution was not found and is required by obfsproxy

  While I'm here, pet portlint, USE_* comes before USES. Bump PORTREVISION.

  PR:		223320
  Submitted by:	cpm
  Reported by:	Hadi <rezaee.hadi@gmail.com>
  Approved by:	cs (maintainer timeout, 2 weeks)

Changes:
  head/security/obfsproxy/Makefile
  head/security/obfsproxy/files/patch-setup.py