Repository: zulip/zulip

Issue:
Commit c74a74d causes docker dev image build to fail.
Hi,

I had 1.3.13 successfully install in a docker dev environment, which fully built and installed. I decided to try the latest source in master today and this error occurred:

```
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.4
    creating build/lib.linux-x86_64-3.4/typed_ast
    copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.4/typed_ast
    copying typed_ast/ast35.py -> build/lib.linux-x86_64-3.4/typed_ast
    copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.4/typed_ast
    copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.4/typed_ast
    running build_ext
    building '_ast27' extension
    creating build/temp.linux-x86_64-3.4
    creating build/temp.linux-x86_64-3.4/ast27
    creating build/temp.linux-x86_64-3.4/ast27/Parser
    creating build/temp.linux-x86_64-3.4/ast27/Python
    creating build/temp.linux-x86_64-3.4/ast27/Custom
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.4m -I/srv/zulip-venv-cache/2d0d4429f07d3367f31c904bcf110e00407cafa8/zulip-py3-venv/include/python3.4m -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.4/ast27/Parser/acceler.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/srv/zulip-venv-cache/2d0d4429f07d3367f31c904bcf110e00407cafa8/zulip-py3-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-u0_6ev0b/typed-ast/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-eq6ql577-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/zulip-venv-cache/2d0d4429f07d3367f31c904bcf110e00407cafa8/zulip-py3-venv/include/site/python3.4/typed-ast" failed with error code 1 in /tmp/pip-build-u0_6ev0b/typed-ast/                                                              
Traceback (most recent call last):
  File "/srv/zulip/provision.py", line 202, in <module>
    sys.exit(main())
  File "/srv/zulip/provision.py", line 153, in main
    virtualenv_args=['-p', 'python3'])
  File "/srv/zulip/scripts/lib/setup_venv.py", line 44, in setup_virtualenv
    do_setup_virtualenv(cached_venv_path, requirements_file, virtualenv_args or [])
  File "/srv/zulip/scripts/lib/setup_venv.py", line 68, in do_setup_virtualenv
    run(["pip", "install", "--no-deps", "--requirement", requirements_file])
  File "/srv/zulip/zulip_tools.py", line 78, in run
    raise subprocess.CalledProcessError(rc, args)
subprocess.CalledProcessError: Command '['pip', 'install', '--no-deps', '--requirement', '/srv/zulip/requirements/mypy.txt']' returned non-zero exit status 1
```

At the time of this writing commit https://github.com/zulip/zulip/commit/8cecb3774321adf638b93781a175e74e68a6564b is the latest version I used, so the error must have been between this commit and last commit for release 1.3.13.

When I reverted this commit https://github.com/zulip/zulip/commit/c74a74dc7427549eba4ececcf91c483ca2876796 everything compiled as normal. There must be a dependency that is pulled in that makes it work.

Hope this helps.

Jon



Discussion:

Resolving patch:
diff --git a/scripts/lib/setup_venv.py b/scripts/lib/setup_venv.py
--- a/scripts/lib/setup_venv.py
+++ b/scripts/lib/setup_venv.py
@@ -18,6 +18,7 @@
     from typing import List, Optional
 
 VENV_DEPENDENCIES = [
+    "build-essential",
     "libffi-dev",
     "libfreetype6-dev",
     "libldap2-dev",
@@ -25,6 +26,7 @@
     "postgresql-server-dev-all",
     "python3-dev",          # Needed to install typed-ast dependency of mypy
     "python-dev",
+    "python-pip",
     "python-virtualenv",
 ]
 


Test patch: