zulip/tools/setup
Steve Howell 7eb6d32d59 provision: Let build_emoji build its own cache.
We no longer need to maintain duplicate code
related to where we set up the emoji
cache directory.

And we no longer need two extra steps for
people doing advanced (i.e. manual) setup.

There was no clear benefit to having provision
build the cache directory for `build_emoji`,
when it was easy to make `build_emoji` more
self-sufficient.  The `build_emoji` tool
was already importing the library that has
`run_as_root`, and it was already responsible
for 99% of the create-directory kind of tasks.

(We always call `build_emoji` unconditionally from
`provision`, so there's no rationale in terms
of avoiding startup time or something.)

ASIDE:

Its not completely clear to me why we need
to put this directory in "/srv", instead of
somewhere more local (like we already do for
Travis), but maybe it's just to be like
its siblings in "/srv":

    node_modules
    yarn.lock
    zulip-emoji-cache
    zulip-npm-cache
    zulip-py3-venv
    zulip-thumbor-venv
    zulip-venv-cache
    zulip-yarn

I guess the caches that we keep in var are
dev-only, although I think some of what's under
`zulip-emoji-cache` is also dev-only in nature?

    ./var/webpack-cache
    ./var/mypy-cache

In `docs/subsystems/emoji.md` we say this:

```
The `build_emoji` tool generates the set of files under
`static/generated/emoji` (or really, it generates the
`/srv/zulip-emoji-cache/<sha1>/emoji` tree, and
`static/generated/emoji` is a symlink to that tree;we do this in
order to cache old versions to make provisioning and production
deployments super fast in the common case that we haven't changed the
emoji tooling). [...]
```

I don't really understand that rationale for the development
case, since `static/generated` is as much ignored by `git` as
'/srv' is, without the complications of needing `sudo` to create it.

And in production, I'm not sure how much time we're really saving,
as it takes me about 1.4s to fully rebuild the cache in dev, not to
mention we're taking on upgrade risk by sharing files between versions.
2020-04-17 09:53:26 -07:00
..
dev-vagrant-docker dev-vagrant-docker: Upgrade docker-systemctl-replacement. 2019-06-24 22:06:32 -07:00
emoji provision: Let build_emoji build its own cache. 2020-04-17 09:53:26 -07:00
__init__.py
build_pygments_data pygments_data: Replace JS module with JSON module. 2020-02-12 10:09:12 -08:00
dev-motd Vagrantfile: Be nicer to /etc/update-motd.d. 2019-05-24 17:33:06 -07:00
generate-fixtures flush-memcached: Respect MEMCACHED_LOCATION; handle errors. 2019-10-01 16:05:55 -07:00
generate-test-credentials generate-test-credentials: Fix shellcheck warnings. 2018-08-03 09:15:27 -07:00
generate_zulip_bots_static_files.py production: Fix generating bot static files in production. 2020-04-17 09:25:48 -07:00
install-aws-server install-aws-server: Use our settings.py if available. 2019-06-13 14:39:25 -07:00
install-sgrep sgrep: Install syntactic code search tool as an external linter. 2020-04-01 15:08:34 -07:00
install-shellcheck install-shellcheck: Check the tarball’s SHA-256 hash. 2020-03-31 15:01:54 -07:00
lang.json bugdown: Add 'none' as alias for no syntax highlighting in codeblocks. 2020-04-09 16:02:02 -07:00
optimize-svg Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
postgres-init-dev-db flush-memcached: Respect MEMCACHED_LOCATION; handle errors. 2019-10-01 16:05:55 -07:00
postgres-init-test-db tools: Fix postgres-init-*-db cache handling. 2019-06-17 16:24:13 -07:00
setup_venvs.py setup_venv: Replace virtualenv_args list with python2 bool. 2020-02-05 12:38:10 -08:00