{"action":"created","issue":{"url":"https://api.github.com/repos/smartfile/python-libarchive/issues/6","repository_url":"https://api.github.com/repos/smartfile/python-libarchive","labels_url":"https://api.github.com/repos/smartfile/python-libarchive/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/smartfile/python-libarchive/issues/6/comments","events_url":"https://api.github.com/repos/smartfile/python-libarchive/issues/6/events","html_url":"https://github.com/smartfile/python-libarchive/issues/6","id":195354289,"number":6,"title":"pip --global-options ignored","user":{"login":"SkyLeach","id":940228,"avatar_url":"https://avatars.githubusercontent.com/u/940228?v=3","gravatar_id":"","url":"https://api.github.com/users/SkyLeach","html_url":"https://github.com/SkyLeach","followers_url":"https://api.github.com/users/SkyLeach/followers","following_url":"https://api.github.com/users/SkyLeach/following{/other_user}","gists_url":"https://api.github.com/users/SkyLeach/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyLeach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyLeach/subscriptions","organizations_url":"https://api.github.com/users/SkyLeach/orgs","repos_url":"https://api.github.com/users/SkyLeach/repos","events_url":"https://api.github.com/users/SkyLeach/events{/privacy}","received_events_url":"https://api.github.com/users/SkyLeach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-13T20:05:51Z","updated_at":"2016-12-13T20:30:07Z","closed_at":null,"body":"For Mac users there is a catch-22 with the default libarchive shipped with the OS.  (Tested on Sierra and El Capitain).\r\n\r\nIf one updates the core library, tons of things break in OSX.\r\n\r\nIf one doesn't update the core library, libarchive doesn't work.\r\n\r\nmissing symbol:\r\n\r\n    Traceback (most recent call last):\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/bin/imgunbundle\", line 11, in <module>\r\n        load_entry_point('imgunbundler', 'console_scripts', 'imgunbundle')()\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 561, in load_entry_point\r\n        return get_distribution(dist).load_entry_point(group, name)\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2627, in load_entry_point\r\n        return ep.load()\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2287, in load\r\n        return self.resolve()\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2293, in resolve\r\n        module = __import__(self.module_name, fromlist=['__name__'], level=0)\r\n      File \"/Users/skyleach/src/imgunbundle/imgunbundler/imgunbundle.py\", line 57, in <module>\r\n        from unbundlers import unbundle_cpio\r\n      File \"/Users/skyleach/src/imgunbundle/imgunbundler/unbundlers/unbundle_cpio.py\", line 2, in <module>\r\n        import libarchive.public\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/libarchive/public.py\", line 1, in <module>\r\n        from libarchive.adapters.archive_read import \\\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/libarchive/adapters/archive_read.py\", line7, in <module>\r\n        import libarchive.calls.archive_read\r\n      File \"/Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/libarchive/calls/archive_read.py\", line 17, in <module>\r\n        c_archive_read_support_filter_all = libarchive.archive_read_support_filter_all\r\n      File \"/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py\", line 375, in __getattr__\r\n        func = self.__getitem__(name)\r\n      File \"/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py\", line 380, in __getitem__\r\n        func = self._FuncPtr((name_or_ordinal, self))\r\n    AttributeError: dlsym(0x7fa97a61aca0, archive_read_support_filter_all): symbol not found\r\n\r\nGenerally the solution for mac users would be to install an updated libarchive using homebrew into `/usr/local/opt/libarchive`.\r\n\r\nFolowing this we would instruct pip to pass the location to the module compiler using `pip install --global-option=\"-L/usr/local/opt/libarchive/lib\" --global-option=\"-I/usr/local/opt/libarchive/include\" libarchive`\r\n\r\nHowever this doesn't work with libarchive:\r\n```\r\n        /Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.\r\n          cmdoptions.check_install_build_global(options)\r\n        Collecting libarchive\r\n          Using cached libarchive-0.4.3.tar.gz\r\n        Requirement already satisfied: nose in /Users/skyleach/.virtualenvs/imgunbundler/lib/python2.7/site-packages (from libarchive)\r\n        Skipping bdist_wheel for libarchive, due to binaries being disabled for it.\r\n        Installing collected packages: libarchive\r\n          Running setup.py install for libarchive: started\r\n            Running setup.py install for libarchive: finished with status 'error'\r\n            Complete output from command /Users/skyleach/.virtualenvs/imgunbundler/bin/python2.7 -u -c \"import setuptools, tokenize;__file__='/private/var/folders/kt/yxsj572j6z18h6gq073_zvdr0000gn/T/pip-build-1krdrd/libarchive/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" -L/usr/local/opt/libarchive/lib -I/usr/local/opt/libarchive/include install --record /var/folders/kt/yxsj572j6z18h6gq073_zvdr0000gn/T/pip-Lpnx1J-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/skyleach/.virtualenvs/imgunbundler/bin/../include/site/python2.7/libarchive:\r\n            usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\r\n               or: -c --help [cmd1 cmd2 ...]\r\n               or: -c --help-commands\r\n               or: -c cmd --help\r\n            \r\n            error: option -L not recognized\r\n            \r\n            ----------------------------------------\r\n        Command \"/Users/skyleach/.virtualenvs/imgunbundler/bin/python2.7 -u -c \"import setuptools, tokenize;__file__='/private/var/folders/kt/yxsj572j6z18h6gq073_zvdr0000gn/T/pip-build-1krdrd/libarchive/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" -L/usr/local/opt/libarchive/lib -I/usr/local/opt/libarchive/include install --record /var/folders/kt/yxsj572j6z18h6gq073_zvdr0000gn/T/pip-Lpnx1J-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/skyleach/.virtualenvs/imgunbundler/bin/../include/site/python2.7/libarchive\" failed with error code 1 in /private/var/folders/kt/yxsj572j6z18h6gq073_zvdr0000gn/T/pip-build-1krdrd/libarchive/\r\n```\r\n\r\nI grepped through the python-libarchive code for LDFLAGS and CPPFLAGS and didn't seem them being brought in.  I also tried setting them before calling pip install as environment variables: ``export LDFLAGS=' -L/usr/local/opt/libarchive/lib';export CPPFLAGS='-I/usr/local/opt/libarchive/include';export PKG_CONFIG_PATH='/usr/local/opt/libarchive/lib/pkgconfig'; pip install libarchive`` but that didn't work either.\r\n\r\nSeems to be no way to specify which version of libarchive to link against?"},"comment":{"url":"https://api.github.com/repos/smartfile/python-libarchive/issues/comments/266852794","html_url":"https://github.com/smartfile/python-libarchive/issues/6#issuecomment-266852794","issue_url":"https://api.github.com/repos/smartfile/python-libarchive/issues/6","id":266852794,"user":{"login":"SkyLeach","id":940228,"avatar_url":"https://avatars.githubusercontent.com/u/940228?v=3","gravatar_id":"","url":"https://api.github.com/users/SkyLeach","html_url":"https://github.com/SkyLeach","followers_url":"https://api.github.com/users/SkyLeach/followers","following_url":"https://api.github.com/users/SkyLeach/following{/other_user}","gists_url":"https://api.github.com/users/SkyLeach/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyLeach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyLeach/subscriptions","organizations_url":"https://api.github.com/users/SkyLeach/orgs","repos_url":"https://api.github.com/users/SkyLeach/repos","events_url":"https://api.github.com/users/SkyLeach/events{/privacy}","received_events_url":"https://api.github.com/users/SkyLeach/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T20:30:07Z","updated_at":"2016-12-13T20:30:07Z","body":"wrong libarchive, my bad"}}
{"actor":{"display_login":"SkyLeach"}}